Skip to content

Commit

Permalink
Fixed bug affecting output of unmapped transcripts to sam file
Browse files Browse the repository at this point in the history
  • Loading branch information
Dana Elizabeth Wyman committed Sep 28, 2018
1 parent 49ea010 commit 6343c56
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion TranscriptClean.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,6 @@ def cleanNoncanonical(transcripts, annotatedJunctions, genome, n, spliceAnnot, o
Transcript2.addUncorrected_NC_SJ(currTranscript)

else: # Attempt to perform correction
print currTranscript.QNAME
currSeq = currTranscript.SEQ
currCIGAR = currTranscript.CIGAR
corrected = []
Expand Down
9 changes: 7 additions & 2 deletions transcript2.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,13 @@ def printableSAM(self, genome, spliceAnnot):
fields = [ self.QNAME, self.FLAG, self.CHROM, self.POS, self.MAPQ, self.CIGAR, \
self.RNEXT, self.PNEXT, self.TLEN, self.SEQ, self.QUAL, self.otherFields, \
self.NM, self.MD, self.jM, self.jI ]
fields = filter(None, fields)
return "\t".join([str(x) for x in fields]).strip()

final_fields = []
for field in fields:
if field != "" and field != None:
final_fields.append(field)

return "\t".join([str(x) for x in final_fields]).strip()

def printableFa(self):
""" Returns a fasta-formatted string representation of the transcript """
Expand Down

0 comments on commit 6343c56

Please sign in to comment.