INNER CODE UNIT · Python

get_exons

hillerlab/TOGA · CESAR_wrapper.py:380

def get_exons(bed_data, t_db):
    """Extract exons sequences for reference."""
    exons_raw = (
        bed_data["blocks"][::-1] if not bed_data["strand"] else bed_data["blocks"]
    )
    exons_pos = {}  # contain exon_num : positions
    s_sites = []
    exon_flanks = {}
    for num, exon in enumerate(exons_raw):
        # start, end if strand == + end, start otherwise
        # need to know start and end to extract from 2bit file
        exons_pos[num] = (
            (int(exon[0]), int(exon[1]))
            if bed_data["strand"]
            else (int(exon[1]), int(exon[0]))
        )

    max_exon_num = max(exons_pos.keys())

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…