Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:COMBINE-lab/salmon into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
k3yavi committed Oct 24, 2018
2 parents b07b017 + a3e6324 commit d3a5a09
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/SalmonDefaults.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace salmon {
namespace defaults {
// general
constexpr const bool discardOrphansAln{false};
constexpr const bool discardOrphansQuasi{false};
constexpr const bool allowOrphansFMD{false};
constexpr const bool seqBiasCorrect{false};
Expand Down
1 change: 1 addition & 0 deletions include/SalmonOpts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ struct SalmonOpts {

// for utility (may need to be cleaned up later)
bool discardOrphansQuasi;
bool discardOrphansAln;
double coverageThresh;
std::vector<std::string> unmatedReadFiles;
std::vector<std::string> mate1ReadFiles;
Expand Down
6 changes: 6 additions & 0 deletions src/ProgramOptionsGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ namespace salmon {
po::options_description alignin("\n"
"alignment input options");
alignin.add_options()
("discardOrphans",
po::bool_switch(&(sopt.discardOrphansAln))->default_value(salmon::defaults::discardOrphansAln),
"[Alignment-based mode only] : Discard orphan alignments in the input "
". If this flag is passed, then only paired alignments will be "
"considered toward quantification estimates. The default behavior is "
"to consider orphan alignments if no valid paired mappings exist.")
("libType,l", po::value<std::string>()->required(), "Format string describing the library type")
("alignments,a", po::value<vector<string>>()->multitoken()->required(),
"input alignment (BAM) file(s).")
Expand Down
7 changes: 6 additions & 1 deletion src/SalmonQuantifyAlignments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ void processMiniBatch(AlignmentLibraryT<FragT>& alnLib,
using salmon::math::logAdd;
using salmon::math::logSub;

auto orphanProb = salmonOpts.discardOrphansAln ? LOG_0 : LOG_EPSILON;

// k-mers for sequence bias
Mer leftMer;
Mer rightMer;
Expand Down Expand Up @@ -289,7 +291,10 @@ void processMiniBatch(AlignmentLibraryT<FragT>& alnLib,
// If we are expecting a paired-end library, and this is an orphan,
// then logFragProb should be small
if (isUnexpectedOrphan(aln, expectedLibraryFormat)) {
logFragProb = LOG_EPSILON;
logFragProb = orphanProb;
if (logFragProb == LOG_0) {
continue;
}
}

if (flen > 0.0 and aln->isPaired() and useFragLengthDist and
Expand Down

0 comments on commit d3a5a09

Please sign in to comment.