Skip to content

Commit

Permalink
Solution for chromosome names with 'chr'.
Browse files Browse the repository at this point in the history
  • Loading branch information
TCLamnidis committed May 18, 2018
1 parent 6800ff3 commit a8e33ec
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions SexDet.ErrorCalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def CalcErrors(AutSnps, XSnps, YSnps, NrAut, NrX, NrY):
XSnps=0
for line in args.Input:
fields=line.strip().split()
Chrom=fields[0]
if fields [0][0:3]=="chr":
Chrom=fields[0][3:]
else:
Chrom=fields[0]
if fields[0][0]=="#":
if args.SampleList==None:
Zip = zip(fields[2:],range(len(fields[2:])))
Expand All @@ -66,11 +69,11 @@ def CalcErrors(AutSnps, XSnps, YSnps, NrAut, NrX, NrY):
else:
continue
depths=[int(x) for x in fields[2:]]
if Chrom != "Y" and Chrom != "X" and Chrom != "chrY" and Chrom != "chrX":
if Chrom != "Y" and Chrom != "X":
AutSnps+=1
if Chrom == "Y" or Chrom == "chrY":
if Chrom == "Y":
YSnps+=1
if Chrom == "X" or Chrom == "chrX":
if Chrom == "X":
XSnps+=1
for x in Names:
# Totals[Names[x]]+=depths[Names[x]]
Expand Down

0 comments on commit a8e33ec

Please sign in to comment.