INNER CODE UNIT · Python
Output
aquaskyline/Clairvoyante · clairvoyante/callVar.py:50
def Output(args, call_fh, num, XBatch, posBatch, base, z, t, l):
if args.v2 == True or args.v3 == True:
if num != len(base):
sys.exit("Inconsistent shape between input tensor and output predictions %d/%d" % (num, len(base)))
# -------------- ------ ------------ ------------------
# Base chng Zygo. Var type Var length
# A C G T HET HOM REF SNP INS DEL 0 1 2 3 4 >=4
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
for j in range(len(base)):
if args.showRef == False and np.argmax(t[j]) == 0: continue
# Get variant type, 0:REF, 1:SNP, 2:INS, 3:DEL
varType = np.argmax(t[j])
# Get zygosity, 0:HET, 1:HOM
varZygosity = np.argmax(z[j])
# Get Indel Length, 0:0, 1:1, 2:2, 3:3, 4:4, 5:>4
varLength = np.argmax(l[j])
# Get chromosome, coordination and reference bases with flanking param.flankingBaseNum flanking bases at coordination
chromosome, coordination, refSeq = posBatch[j].split(":")