@@ -82,48 +82,3 @@ pub fn is_in_flag(flag: u16, in_: u16) -> bool {
82
82
}
83
83
true
84
84
}
85
-
86
- /* Deprecated
87
- pub fn check_flag(flag: u16, in_: u16, not_in: u16) -> bool {
88
- //! This function uses bitwise operations to test if flags are set or not.
89
- //!
90
- //! # Arguments
91
- //!
92
- //! * `flag`: u16 - The record flag you want to test
93
- //! * `in_`: u16 - The flags you want to check if they are set (use 0 for no test)
94
- //! * `not_in`: u16 - The flags you want to check if they are not set (use 0 for no test)
95
- //!
96
- //! # Usage:
97
- //! example: let test if a flag is both paired and first in pair
98
- //! ```
99
- //! use rust_htslib::bam::flags::{Flag, check_flag};
100
- //! let read_flag = 65;
101
- //! assert_eq!(check_flag(read_flag, Flag::PAIRED + Flag::FIRST_IN_PAIR, 0), true);
102
- //! ```
103
- //! let test that the read is mapped. READ_UNMAPPED
104
- //! ```
105
- //! use rust_htslib::bam::flags::{Flag, check_flag};
106
- //! let read_flag = 18;
107
- //! assert_eq!(check_flag(read_flag, 0, Flag::READ_UNMAPPED), true);
108
- //! ```
109
- //!
110
- //! Finally let do a more complexe real example test:
111
- //! ```
112
- //! use rust_htslib::bam::flags::{Flag, check_flag};
113
- //! let read_flag = 19;
114
- //! assert_eq!(check_flag(read_flag, Flag::PAIRED + Flag::PROPERLY_PAIRED + Flag::READ_RERVERSE , Flag::READ_UNMAPPED + Flag::MATE_UNMAPPED), true);
115
- //! ```
116
- //!
117
- //binary flag check
118
- //assert that: - in_ is in n
119
- // - not_in is not in n
120
- // bitwise operation
121
- if (not_in & flag) != 0 {
122
- return false;
123
- }
124
- if (in_ & flag) != in_ {
125
- return false;
126
- }
127
- return true;
128
- }
129
- */
0 commit comments