INNER CODE UNIT · Python
samples
wheaton5/souporcell · consensus.py:368
samples = [str(cluster) for cluster in range(max_cluster+1)]
vcfwriter.template.samples = samples
locus = -1
for rec in vcfreader:
locus += 1
if locus in locus_index:
newrec = vcf.model._Record(rec.CHROM, rec.POS, rec.ID, rec.REF, rec.ALT, rec.QUAL, rec.FILTER, rec.INFO, 'GT:AO:RO:T:E:GO:GN', {str(x):x for x in range(max_cluster+1)})
calls = []
for cluster in range(max_cluster+1):
genotypes = fit['genotypes'][locus_index[locus]][cluster]
sumexp = logsumexp(genotypes)#[math.exp(x) for x in genotypes])
#//print(genotypes)
go = []
for g in genotypes:
if math.isnan(g):
go.append('NaN')
else: