@@ -43,14 +43,17 @@ int JunctionsExtractor::parse_options(int argc, char *argv[]) {
43
43
optind = 1 ; // Reset before parsing again.
44
44
int c;
45
45
stringstream help_ss;
46
- while ((c = getopt (argc, argv, " ha:m:M:f:F:q:o:r:t:s:b:" )) != -1 ) {
46
+ while ((c = getopt (argc, argv, " ha:A: m:M:f:F:q:o:r:t:s:b:" )) != -1 ) {
47
47
switch (c) {
48
48
case ' h' :
49
49
usage (help_ss);
50
50
throw common::cmdline_help_exception (help_ss.str ());
51
51
case ' a' :
52
52
min_anchor_length_ = atoi (optarg );
53
53
break ;
54
+ case ' A' :
55
+ min_read_anchor_length_ = atoi (optarg );
56
+ break ;
54
57
case ' m' :
55
58
min_intron_length_ = atoi (optarg );
56
59
break ;
@@ -119,6 +122,7 @@ int JunctionsExtractor::parse_options(int argc, char *argv[]) {
119
122
}
120
123
121
124
cerr << " Minimum junction anchor length: " << min_anchor_length_ << endl;
125
+ cerr << " Minimum read anchor length: " << min_read_anchor_length_ << endl;
122
126
cerr << " Minimum intron length: " << min_intron_length_ << endl;
123
127
cerr << " Maximum intron length: " << max_intron_length_ << endl;
124
128
cerr << " Require alignment flags: " << require_flags_ << endl;
@@ -140,6 +144,8 @@ int JunctionsExtractor::usage(ostream& out) {
140
144
out << " Options:" << endl;
141
145
out << " \t\t " << " -a INT\t Minimum anchor length. Junctions which satisfy a minimum \n "
142
146
<< " \t\t\t " << " anchor length on both sides are reported. [8]" << endl;
147
+ out << " \t\t " << " -A INT\t Minimum read anchor length. Reads which satisfy a minimum \n "
148
+ << " \t\t\t " << " anchor length on both sides 'support' a junction. [5]" << endl;
143
149
out << " \t\t " << " -m INT\t Minimum intron length. [70]" << endl;
144
150
out << " \t\t " << " -M INT\t Maximum intron length. [500000]" << endl;
145
151
out << " \t\t " << " -f INT\t Only use alignments where all flag bits set here are set. [0]" << endl;
@@ -171,12 +177,17 @@ string JunctionsExtractor::get_new_junction_name() {
171
177
return name_ss.str ();
172
178
}
173
179
174
- // Do some basic qc on the junction
180
+ // Do some basic qc on the junction (and the read alignment)
175
181
bool JunctionsExtractor::junction_qc (Junction &j1) {
182
+ // don't add support for junction if read alignment doesn't meet criteria
176
183
if (j1 .end - j1 .start < min_intron_length_ ||
177
184
j1 .end - j1 .start > max_intron_length_) {
178
185
return false ;
179
186
}
187
+ if (j1 .start - j1 .thick_start < min_read_anchor_length_) return false ;
188
+ if (j1 .thick_end - j1 .end < min_read_anchor_length_) return false ;
189
+
190
+ // add support, update if this junction is sufficiently anchored
180
191
if (j1 .start - j1 .thick_start >= min_anchor_length_)
181
192
j1 .has_left_min_anchor = true ;
182
193
if (j1 .thick_end - j1 .end >= min_anchor_length_)
0 commit comments