Skip to content

Commit 0438499

Browse files
committed
add option to specify strand tag in bam for junction_extractor
1 parent decc77d commit 0438499

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/junctions/junctions_extractor.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ int JunctionsExtractor::parse_options(int argc, char *argv[]) {
4141
optind = 1; //Reset before parsing again.
4242
int c;
4343
stringstream help_ss;
44-
while((c = getopt(argc, argv, "ha:m:M:o:r:s:")) != -1) {
44+
while((c = getopt(argc, argv, "ha:m:M:o:r:t:s:")) != -1) {
4545
switch(c) {
4646
case 'a':
4747
min_anchor_length_ = atoi(optarg);
@@ -58,6 +58,9 @@ int JunctionsExtractor::parse_options(int argc, char *argv[]) {
5858
case 'r':
5959
region_ = string(optarg);
6060
break;
61+
case 't':
62+
strand_tag_ = string(optarg);
63+
break;
6164
case 'h':
6265
usage(help_ss);
6366
throw common::cmdline_help_exception(help_ss.str());
@@ -104,6 +107,8 @@ int JunctionsExtractor::usage(ostream& out) {
104107
<< "\t\t\t " << "in \"chr:start-end\" format. Entire BAM by default." << endl;
105108
out << "\t\t" << "-s INT\tStrand specificity of RNA library preparation \n"
106109
<< "\t\t\t " << "(0 = unstranded, 1 = first-strand/RF, 2, = second-strand/FR). REQUIRED" << endl;
110+
out << "\t\t" << "-t STR\tTag used in bam to label strand. [XS]" << endl;
111+
107112
out << endl;
108113
return 0;
109114
}

src/junctions/junctions_extractor.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ class JunctionsExtractor {
155155
string region_;
156156
//strandness of data; 0 = unstranded, 1 = RF, 2 = FR
157157
int strandness_;
158+
//tag used in BAM to denote strand, default "XS"
159+
string strand_tag_;
158160
public:
159161
//Default constructor
160162
JunctionsExtractor() {
@@ -163,6 +165,7 @@ class JunctionsExtractor {
163165
max_intron_length_ = 500000;
164166
junctions_sorted_ = false;
165167
strandness_ = -1;
168+
strand_tag_ = "XS";
166169
bam_ = "NA";
167170
output_file_ = "NA";
168171
region_ = ".";

0 commit comments

Comments
 (0)