def get_required_capacity_type_modules(scenario_id, subscenarios, conn):
    """
    Get the required tx capacity type submodules based on the database inputs
    for the specified scenario_id. Required modules are the unique set of
    tx capacity types in the scenario's portfolio. Get the list based
    on the project_operational_chars_scenario_id of the scenario_id.

    This list will be used to know for which tx capacity type submodules we
    should validate inputs, get inputs from database, or save results to
    database.

    Note: once we have determined the dynamic components, this information
    will also be stored in the DynamicComponents class object.

    :param subscenarios: SubScenarios object with all subscenario info
    :param conn: database connection
    :return: List of the required tx capacity type submodules
    """
    c = conn.cursor()
    required_tx_capacity_modules = [
        p[0]
        for p in c.execute(
            """SELECT DISTINCT capacity_type
            FROM inputs_transmission_portfolios
            LEFT OUTER JOIN
            (SELECT transmission_line, load_zone_from, load_zone_to
            FROM inputs_transmission_load_zones
            WHERE transmission_load_zone_scenario_id = {}) as tx_load_zones
            USING (transmission_line)
            INNER JOIN
            (SELECT transmission_line
            FROM inputs_transmission_operational_chars
            WHERE transmission_operational_chars_scenario_id = {})
            USING (transmission_line)
            WHERE transmission_portfolio_scenario_id = {};""".format(
                subscenarios.TRANSMISSION_LOAD_ZONE_SCENARIO_ID,
                subscenarios.TRANSMISSION_OPERATIONAL_CHARS_SCENARIO_ID,
                subscenarios.TRANSMISSION_PORTFOLIO_SCENARIO_ID,
            )
        ).fetchall()
    ]

    return required_tx_capacity_modules