def annotateDF(grp, databases): ''' function to annotate variant dataframe with user-supplied vcf databases ''' chrom = grp['chr'].unique()[0] pos = grp['pos'].unique()[0] ref = grp['ref'].unique()[0] alt = grp['alt'].unique()[0] var = Variant(source=None, sample=None, pos=HTSeq.GenomicPosition(chrom, pos), ref=ref, alt=alt, frac=None, dp=None, eff=None, fc=None) dbEntries = dbLookup(var, databases) return pd.Series(dbEntries)
def annotateDF(grp, databases): ''' function to annotate variant dataframe with user-supplied vcf databases ''' chrom = grp['chr'].unique()[0] pos = grp['pos'].unique()[0] ref = grp['ref'].unique()[0] alt = grp['alt'].unique()[0] var = Variant(source=None, pos=HTSeq.GenomicPosition(chrom, pos), ref=ref, alt=alt, frac=None, dp=None, eff=None, fc=None) dbEntries, dbVAFs = dbLookup(var, databases) for source, annot in dbEntries.items(): grp.insert(len(grp.columns)-4, source, annot) grp.insert(len(grp.columns)-4, source + "_VAF", dbVAFs[source]) return grp
def annotateDF(grp, databases): ''' function to annotate variant dataframe with user-supplied vcf databases ''' chrom = grp['chr'].unique()[0] pos = grp['pos'].unique()[0] ref = grp['ref'].unique()[0] alt = grp['alt'].unique()[0] var = Variant(source=None, pos=HTSeq.GenomicPosition(chrom, pos), ref=ref, alt=alt, frac=None, dp=None, eff=None, fc=None) dbEntries, dbVAFs = dbLookup(var, databases) for source, annot in dbEntries.items(): grp.insert(len(grp.columns) - 4, source, annot) grp.insert(len(grp.columns) - 4, source + "_VAF", dbVAFs[source]) return grp