@@ -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 ;
@@ -123,6 +126,7 @@ int JunctionsExtractor::parse_options(int argc, char *argv[]) {
123
126
}
124
127
125
128
cerr << " Minimum junction anchor length: " << min_anchor_length_ << endl;
129
+ cerr << " Minimum read anchor length: " << min_read_anchor_length_ << endl;
126
130
cerr << " Minimum intron length: " << min_intron_length_ << endl;
127
131
cerr << " Maximum intron length: " << max_intron_length_ << endl;
128
132
cerr << " Require alignment flags: " << require_flags_ << endl;
@@ -144,6 +148,8 @@ int JunctionsExtractor::usage(ostream& out) {
144
148
out << " Options:" << endl;
145
149
out << " \t\t " << " -a INT\t Minimum anchor length. Junctions which satisfy a minimum \n "
146
150
<< " \t\t\t " << " anchor length on both sides are reported. [8]" << endl;
151
+ out << " \t\t " << " -A INT\t Minimum read anchor length. Reads which satisfy a minimum \n "
152
+ << " \t\t\t " << " anchor length on both sides 'support' a junction. [0]" << endl;
147
153
out << " \t\t " << " -m INT\t Minimum intron length. [70]" << endl;
148
154
out << " \t\t " << " -M INT\t Maximum intron length. [500000]" << endl;
149
155
out << " \t\t " << " -f INT\t Only use alignments where all flag bits set here are set. [0]" << endl;
@@ -175,12 +181,19 @@ string JunctionsExtractor::get_new_junction_name() {
175
181
return name_ss.str ();
176
182
}
177
183
178
- // Do some basic qc on the junction
184
+ // Update if junction passes QC based on current read alignment
179
185
bool JunctionsExtractor::junction_qc (Junction &j1) {
186
+ // don't add support for junction if intron is wrong size
180
187
if (j1 .end - j1 .start < min_intron_length_ ||
181
188
j1 .end - j1 .start > max_intron_length_) {
182
189
return false ;
183
190
}
191
+
192
+ // don't add support for junction if read isn't sufficiently anchored
193
+ if (j1 .start - j1 .thick_start < min_read_anchor_length_) return false ;
194
+ if (j1 .thick_end - j1 .end < min_read_anchor_length_) return false ;
195
+
196
+ // add support, update if this junction is sufficiently anchored
184
197
if (j1 .start - j1 .thick_start >= min_anchor_length_)
185
198
j1 .has_left_min_anchor = true ;
186
199
if (j1 .thick_end - j1 .end >= min_anchor_length_)
0 commit comments