File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 11""" module docstring """
22
3- __version__ = "2.9"
3+ __version__ = "2.9.1 "
Original file line number Diff line number Diff line change 1717
1818class SamFlags :
1919 PAIRED = 0x1
20+ PROPERLY_PAIRED = 0x2
21+ UNMAPPED = 0x4
2022 MATE_UNMAPPED = 0x8
2123 REVERSE = 0x10
24+ MATE_REVERSE = 0x20
2225 FIRST_IN_PAIR = 0x40
2326 SECOND_IN_PAIR = 0x80
2427 SECONDARY_ALIGNMENT = 0x100
28+ QUAL_CHECK_FAILURE = 0x200
29+ PCR_OPTICAL_DUPLICATE = 0x400
2530 SUPPLEMENTARY_ALIGNMENT = 0x800
2631
2732 @staticmethod
2833 def is_reverse_strand (flag ):
2934 return bool (flag & SamFlags .REVERSE )
3035
36+ @staticmethod
37+ def is_unmapped (flag ):
38+ return bool (flag & SamFlags .UNMAPPED )
39+
3140
3241class CigarOps :
3342 CIGAR_OPS = "MIDNSHP=X"
Original file line number Diff line number Diff line change 22
33import pysam
44
5- from .bamreader import BamAlignment
5+ from .bamreader import BamAlignment , SamFlags
66
77
88class AlignmentProcessor :
@@ -69,6 +69,9 @@ def get_alignments(
6969 dict (pysam_aln .tags )
7070 )
7171
72+ if SamFlags .is_unmapped (aln .flag ):
73+ continue
74+
7275 if aln .flag & filter_flags :
7376 continue
7477
You can’t perform that action at this time.
0 commit comments