Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:StructuralVariants/manta
Browse files Browse the repository at this point in the history
  • Loading branch information
olest committed Feb 6, 2014
2 parents e22f374 + 1427721 commit 88aaf4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ getSVSplitReadSupport(
SVEvidence& evidence)
{
// apply the split-read scoring, only when:
// 1) the SV is precise, i.e. has successful somatic contigs;
// 1) the SV is precise, i.e. has successfully aligned contigs;
// 2) the values of max depth are reasonable (otherwise, the read map may blow out). (filter is run externally)

if (sv.isImprecise()) return;
Expand Down
26 changes: 10 additions & 16 deletions src/c++/lib/manta/SVLocusScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ typedef std::map<std::string, int32_t> chromMap_t;
static
void
getSACandidatesFromRead(
const ReadScannerOptions& opt,
const ReadScannerDerivOptions& dopt,
const bam_record& localRead,
const SimpleAlignment& localAlign,
Expand All @@ -257,19 +258,15 @@ getSACandidatesFromRead(
if (NULL == saStr) return;

split_string(saStr, ';', saVec);
if (saVec[saVec.size() - 1].empty())
if ( (! saVec.empty()) && saVec.back().empty())
{
saVec.pop_back();
}
}

// For now we will only handle a single split alignment
// In the future we will need to sort the SA tags by order on of segments on
// the actual template.
// We may also have to toss conflicting segments that map to two different areas,
// or at least find some way of dealing with them.
//std::cerr << "At: '" << saStr << "', '" << localRead << "'" << std::endl;
//std::cerr << "Size: " << saVec.size() << std::endl;
// Only handle a single split alignment right now.
// In the future we could sort the SA tags by order on the template, possibly
// also removing segments that map to two different areas,

if (saVec.size() > 1) return;

Expand All @@ -285,6 +282,10 @@ getSACandidatesFromRead(

assert((saDat.size() == 6) && "Unexpected number of SA tag values");

/// filter split reads with low MAPQ:
const unsigned saMapq(illumina::blt_util::parse_unsigned_str(saDat[4]));
if (saMapq < opt.minMapq) continue;

const chromMap_t::const_iterator ci(chromToIndex.find(saDat[0]));
assert(ci != chromToIndex.end());

Expand All @@ -300,13 +301,6 @@ getSACandidatesFromRead(

cigar_to_apath(saDat[3].c_str(), remoteAlign.path);

/*std::cerr << "SA Values: "
<< ", " << saChr
<< ", " << saPos
<< ", " << saStrand
<< ", " << remotePath << '\n';
*/

// At this point we don't care about strand
candidates.push_back(GetSplitSACandidate(dopt, localAlign, remoteAlign));
}
Expand Down Expand Up @@ -746,7 +740,7 @@ getSingleReadSVCandidates(
#endif

/// - process split/SA reads:
getSACandidatesFromRead(dopt, localRead, localAlign, chromToIndex,
getSACandidatesFromRead(opt, dopt, localRead, localAlign, chromToIndex,
candidates);
#ifdef DEBUG_SCANNER
log_os << logtag << " post-split read candidate_size: " << candidates.size() << "\n";
Expand Down

0 comments on commit 88aaf4d

Please sign in to comment.