예제 #1
0
def call(call_gt_args, idx, row_count, para, strands, seq, var_type):
    rname_list = []
    if var_type == 'INS' or var_type == 'DEL':
        gt_re, DR, genotype, GL, GQ, QUAL = call_gt_indel(*call_gt_args)
        rname_list = call_gt_args[3]
    if var_type == 'DUP':
        gt_re, DR, genotype, GL, GQ, QUAL = call_gt_dup(*call_gt_args)
        rname_list = call_gt_args[4]
    if var_type == 'INV':
        gt_re, DR, genotype, GL, GQ, QUAL = call_gt_inv(*call_gt_args)
        rname_list = call_gt_args[4]
    if var_type == 'TRA':
        gt_re, DR, genotype, GL, GQ, QUAL = call_gt_tra(*call_gt_args)
        rname_list = call_gt_args[5]
    rname = ','.join(rname_list)
    if rname == '':
        rname = 'NULL'
    result = [
        para.chrom, para.pos, genotype,
        var_type, para.svlen, para.end, para.cipos, para.cilen,
        [gt_re, DR, GL, GQ,
         QUAL], rname, para.id, para.ref, para.alts, para.qual, strands, seq
    ]
    if idx > 0 and idx % 5000 == 0:
        logging.info(
            str(math.floor(idx / row_count * 100)) +
            '% SV calls of the given vcf has been processed.')
    return result
예제 #2
0
def call_gt_wrapper(call_gt_args, gt_list, idx, row_count, record, var_type):
    if var_type == 'INS' or var_type == 'DEL':
        gt_re, DR, genotype, GL, GQ, QUAL = call_gt_indel(*call_gt_args)
    if var_type == 'DUP':
        gt_re, DR, genotype, GL, GQ, QUAL = call_gt_dup(*call_gt_args)
    if var_type == 'INV':
        gt_re, DR, genotype, GL, GQ, QUAL = call_gt_inv(*call_gt_args)
    if var_type == 'TRA':
        gt_re, DR, genotype, GL, GQ, QUAL = call_gt_tra(*call_gt_args)
    gt_list[idx] = [
        record.CHROM, record.POS, genotype, record.INFO['SVTYPE'],
        record.INFO['SVLEN'], record.INFO['END'], record.INFO['CIPOS'],
        record.INFO['CIEND'], gt_re, ','.join(call_gt_args[3]), record.ID,
        record.REF, record.ALT[0], record.QUAL, record.INFO['STRANDS'],
        record.FILTER
    ]
    if idx > 0 and idx % 5000 == 0:
        logging.info(
            str(math.floor(idx / row_count * 100)) +
            '% SV calls of the given vcf has been processed.')