Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUG Handle case where 1 of pair is mapped

  • Loading branch information...
commit 2788dabb0bc50f4bbec3504c5c05fc78e747290c 1 parent 40e5770
@luispedro authored
Showing with 19 additions and 0 deletions.
  1. +2 −0  src/HTSeq/_HTSeq.pyx
  2. +17 −0 test/test_regression.py
View
2  src/HTSeq/_HTSeq.pyx
@@ -1310,6 +1310,8 @@ cdef class SAM_Alignment( AlignmentWithSequenceReversal ):
strand = "+"
alnmt.mate_start = GenomicPosition( mrnm, posint, strand )
if alnmt.mate_start.chrom == "=":
+ if alnmt.iv is None:
+ raise ValueError( "Cannot handle this line. Mate is paired, but this read is not%s." % lineid )
alnmt.mate_start.chrom = alnmt.iv.chrom
if flagint & 0x0040:
alnmt.pe_which = intern( "first" )
View
17 test/test_regression.py
@@ -0,0 +1,17 @@
+from StringIO import StringIO
+
+import HTSeq
+unpaired = '''@HD\tVN:1.0\tSO:unsorted
+@SQ\tSN:chr1\tLN:249250621
+@SQ\tSN:chr2\tLN:243199373
+@PG\tID:bowtie2\tPN:bowtie2\tVN:2.0.0-beta7
+FCC0DEFACXX:2:1101:1087:101744#CCACATTC\t153\tchr2\t128281285\t42\t75M\t=\t128281285\t0\tTCCGGAGTGTTGCTCATTTACATNATCCTNACCGTCTGACCCNGAATCCCGTTCATCCTGTACTGGGGTAGCACC\t_aabcbca`ccbccbbcb^^\\TKB^a^TLB_hhgfee[VaVOBge^higdhhfgfhgfhgd^ffihfadebd_c`\tAS:i:-3\tXN:i:0\tXM:i:3\tXO:i:0\tXG:i:0\tNM:i:3\tMD:Z:23C5C12T32\tYT:Z:UP
+FCC0DEFACXX:2:1101:1087:101744#CCACATTC\t69\t*\t128281285\t0\t*\t=\t128281285\t0\tGTCTGTCACATGATGTCCTTTGGGGAGGCCATCTTCTCGATCACTAGTTTCATTCTCTGAATGACGTTCTACACT\tfQ``aggghh[[eQXeeeSSdghh_cghiihhghbhbfdfbfgf\\c___dfg`ddgdgR^abeeeb\\\\`acbccZ\tYT:Z:UP
+'''
+
+
+try:
+ assert len(list(HTSeq.SAM_Reader(StringIO(unpaired)))) == 2
+except:
+ pass
+
Please sign in to comment.
Something went wrong with that request. Please try again.