Skip to content

Commit

Permalink
Handle other == NA in infer experiment script - fix #71
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed May 16, 2023
1 parent b7b3c3a commit 1c8cf1d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bin/grape_infer_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def main():
print >>sys.stderr, "Warn: Sample Size too small to give a accurate estimation"
obj = SAM.ParseBAM(options.input_file)
(protocol,sp1,sp2,other)=obj.configure_experiment(refbed=options.refgene_bed, sample_size = options.sample_size)
if other <0: other=0.0
if other is 'NA' or other <0: other=0.0
result = {
'paired': protocol == "PairEnd",
'exp': 'NONE'
Expand All @@ -114,10 +114,9 @@ def main():
elif sp2 > options.threshold:
result['exp'] = "ANTISENSE"
else:
print "Unknown Data type"
print >>sys.stderr, "Unknown Data type"
print >>sys.stderr, 'Fraction of reads explained by other combinations: %.4f' % other
print >>sys.stderr, '-------------------'
#print mesg
json.dump(result, sys.stdout)

if __name__ == '__main__':
Expand Down

0 comments on commit 1c8cf1d

Please sign in to comment.