Skip to content
Snippets Groups Projects
Commit e63d83e5 authored by arq5x's avatar arq5x
Browse files

Fix for issue #145. -f was incorrectly set to 0.0 when using -labels, -intervals, or -names.

parent dabde359
No related branches found
No related tags found
No related merge requests found
......@@ -110,7 +110,7 @@ void TagBam::Tag() {
// use the score field
else if (!_useNames && _useScores && !_useIntervals) {
anno->allHits(a.chrom, a.start, a.end, a.strand,
hits, _sameStrand, _diffStrand, 0.0, false);
hits, _sameStrand, _diffStrand, _overlapFraction, false);
for (size_t i = 0; i < hits.size(); ++i) {
annotations << hits[i].score;
if (i < hits.size() - 1) annotations << ",";
......@@ -121,7 +121,7 @@ void TagBam::Tag() {
// use the name field from the annotation files to populate tag
else if (_useNames && !_useScores && !_useIntervals) {
anno->allHits(a.chrom, a.start, a.end, a.strand,
hits, _sameStrand, _diffStrand, 0.0, false);
hits, _sameStrand, _diffStrand, _overlapFraction, false);
for (size_t j = 0; j < hits.size(); ++j) {
annotations << hits[j].name;
if (j < hits.size() - 1) annotations << ",";
......@@ -132,7 +132,7 @@ void TagBam::Tag() {
// use the full interval information annotation files to populate tag
else if (!_useNames && !_useScores && _useIntervals) {
anno->allHits(a.chrom, a.start, a.end, a.strand,
hits, _sameStrand, _diffStrand, 0.0, false);
hits, _sameStrand, _diffStrand, _overlapFraction, false);
for (size_t j = 0; j < hits.size(); ++j) {
annotations << _annoLabels[i] << ":" <<
hits[j].chrom << ":" <<
......
......@@ -176,6 +176,10 @@ int tagbam_main(int argc, char* argv[]) {
cerr << endl << "*****" << endl << "*****ERROR: Custom tags should be at most two characters per the SAM specification. " << endl << "*****" << endl;
showHelp = true;
}
if (haveFraction && overlapFraction == 0.0) {
cerr << endl << "*****" << endl << "*****ERROR: -f must be > 0.0" << endl << "*****" << endl;
showHelp = true;
}
if (!showHelp) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment