Skip to content

Commit f1ea40b

Browse files
committed
update cse identify
1 parent 08042ef commit f1ea40b

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/cis-splice-effects/cis_splice_effects_identifier.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ void CisSpliceEffectsIdentifier::usage(ostream& out) {
4040
out << "\t\t" << "-j STR\tOutput file containing the aberrant junctions in BED12 format." << endl;
4141
out << "\t\t" << "-s INT\tStrand specificity of RNA library preparation \n"
4242
<< "\t\t\t " << "(0 = unstranded, 1 = first-strand/RF, 2, = second-strand/FR). REQUIRED" << endl;
43+
out << "\t\t" << "-t STR\tTag used in bam to label strand. [XS]" << endl;
4344
out << "\t\t" << "-a INT\tMinimum anchor length. Junctions which satisfy a minimum \n"
4445
<< "\t\t\t " << "anchor length on both sides are reported. [8]" << endl;
4546
out << "\t\t" << "-m INT\tMinimum intron length. [70]" << endl;
@@ -103,7 +104,7 @@ void CisSpliceEffectsIdentifier::parse_options(int argc, char* argv[]) {
103104
optind = 1; //Reset before parsing again.
104105
stringstream help_ss;
105106
char c;
106-
while((c = getopt(argc, argv, "o:w:v:j:e:Ei:IShs:a:m:M:")) != -1) {
107+
while((c = getopt(argc, argv, "o:w:v:j:e:Ei:ISht:s:a:m:M:")) != -1) {
107108
switch(c) {
108109
case 'o':
109110
output_file_ = string(optarg);
@@ -138,6 +139,9 @@ void CisSpliceEffectsIdentifier::parse_options(int argc, char* argv[]) {
138139
case 's':
139140
strandness_ = atoi(optarg);
140141
break;
142+
case 't':
143+
strand_tag_ = string(optarg);
144+
break;
141145
case 'a':
142146
min_anchor_length_ = atoi(optarg);
143147
break;
@@ -246,7 +250,7 @@ void CisSpliceEffectsIdentifier::identify() {
246250
if(write_annotated_variants_)
247251
va.write_annotation_output(v1);
248252
//Extract junctions near this variant
249-
JunctionsExtractor je1(bam_, variant_region, strandness_, min_anchor_length_, min_intron_length_, max_intron_length_);
253+
JunctionsExtractor je1(bam_, variant_region, strandness_, strand_tag_, min_anchor_length_, min_intron_length_, max_intron_length_);
250254
je1.identify_junctions_from_BAM();
251255
vector<Junction> junctions = je1.get_all_junctions();
252256
//Add all the junctions to the unique set

src/cis-splice-effects/cis_splice_effects_identifier.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ class CisSpliceEffectsIdentifier {
8080
bool skip_single_exon_genes_;
8181
//strandness of data
8282
int strandness_;
83+
//tag used in BAM to denote strand, default "XS"
84+
string strand_tag_;
8385
//Minimum anchor length for junctions
8486
//Junctions need atleast this many bp overlap
8587
// on both ends.
@@ -101,6 +103,7 @@ class CisSpliceEffectsIdentifier {
101103
all_exonic_space_(false),
102104
skip_single_exon_genes_(true),
103105
strandness_(-1),
106+
strand_tag_("XS"),
104107
min_anchor_length_(8),
105108
min_intron_length_(70),
106109
max_intron_length_(500000) {}

src/junctions/junctions_extractor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ class JunctionsExtractor {
170170
output_file_ = "NA";
171171
region_ = ".";
172172
}
173-
JunctionsExtractor(string bam1, string region1, int strandness1, uint32_t min_anchor_length1, uint32_t min_intron_length1, uint32_t max_intron_length1) :
174-
bam_(bam1), region_(region1), strandness_(strandness1), min_anchor_length_(min_anchor_length1), min_intron_length_(min_anchor_length1), max_intron_length_(max_intron_length1) {
173+
JunctionsExtractor(string bam1, string region1, int strandness1, string strand_tag1, uint32_t min_anchor_length1, uint32_t min_intron_length1, uint32_t max_intron_length1) :
174+
bam_(bam1), region_(region1), strandness_(strandness1), strand_tag_(strand_tag1), min_anchor_length_(min_anchor_length1), min_intron_length_(min_anchor_length1), max_intron_length_(max_intron_length1) {
175175
junctions_sorted_ = false;
176176
output_file_ = "NA";
177177
}

0 commit comments

Comments
 (0)