INNER CODE UNIT · Python

parse_tsv

BirolLab/straglr · extract_repeats.py:7

def parse_tsv(tsv, loci=None):
    support = defaultdict(dict)
    with open(tsv, 'r') as ff:
        for line in ff:
            if line[0] == '#':
                continue
            cols = line.rstrip().split('\t')
            locus = cols[4]
            status = cols[14]
            read_name = cols[7]
            size = cols[10]
            read_start = cols[11]
            strand = cols[12]

            if status != 'full' or (loci is not None and locus not in loci):
                continue
            support[locus][read_name] = int(read_start), int(size), strand

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…