INNER CODE UNIT · Python

create_simple_bed

BirolLab/straglr · straglr_compare.py:36

def create_simple_bed(loci):
    bed_str = ''
    for locus in loci:
        bed_str += '{}\n'.format('\t'.join(list(map(str, locus[:3]))))

    return BedTool(bed_str, from_string=True).sort()

def parse_straglr_tsv(tsv, use_size=True, skip_chroms=None, old_version=False):
    alleles = {}
    with open(tsv, 'r') as ff:
        for line in ff:
            if line[0] == '#':
                continue

            cols = line.rstrip().split('\t')
            if not old_version and cols[-1] != 'full':
                continue
            

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…