By default, don't clean reads with mates mapped to other chromosomes
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3654 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
e7939f7036
commit
9a24598a98
|
|
@ -96,6 +96,9 @@ public class IndelRealigner extends ReadWalker<Integer, Integer> {
|
||||||
@Argument(fullName="sortInCoordinateOrderEvenThoughItIsHighlyUnsafe", required=false, doc="Should we sort the final bam in coordinate order even though it will be malformed because mate pairs of realigned reads will contain inaccurate information?")
|
@Argument(fullName="sortInCoordinateOrderEvenThoughItIsHighlyUnsafe", required=false, doc="Should we sort the final bam in coordinate order even though it will be malformed because mate pairs of realigned reads will contain inaccurate information?")
|
||||||
protected boolean SORT_IN_COORDINATE_ORDER = false;
|
protected boolean SORT_IN_COORDINATE_ORDER = false;
|
||||||
|
|
||||||
|
@Argument(fullName="realignReadsWithBadMates", required=false, doc="Should we try to realign paired-end reads whose mates map to other chromosomes?")
|
||||||
|
protected boolean REALIGN_BADLY_MATED_READS = false;
|
||||||
|
|
||||||
@Argument(fullName="no_pg_tag", shortName="noPG", required=false, doc="Don't output the usual PG tag in the realigned bam file header. FOR DEBUGGING PURPOSES ONLY. This option is required in order to pass integration tests.")
|
@Argument(fullName="no_pg_tag", shortName="noPG", required=false, doc="Don't output the usual PG tag in the realigned bam file header. FOR DEBUGGING PURPOSES ONLY. This option is required in order to pass integration tests.")
|
||||||
protected boolean NO_PG_TAG = false;
|
protected boolean NO_PG_TAG = false;
|
||||||
|
|
||||||
|
|
@ -246,13 +249,9 @@ public class IndelRealigner extends ReadWalker<Integer, Integer> {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else if ( readLoc.overlapsP(currentInterval) ) {
|
else if ( readLoc.overlapsP(currentInterval) ) {
|
||||||
if ( read.getReadUnmappedFlag() ||
|
if ( doNotTryToClean(read) ) {
|
||||||
read.getNotPrimaryAlignmentFlag() ||
|
|
||||||
read.getMappingQuality() == 0 ||
|
|
||||||
read.getAlignmentStart() == SAMRecord.NO_ALIGNMENT_START ) {
|
|
||||||
readsNotToClean.add(read);
|
readsNotToClean.add(read);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
readsToClean.add(read, ref.getBases());
|
readsToClean.add(read, ref.getBases());
|
||||||
// add the rods to the list of known variants
|
// add the rods to the list of known variants
|
||||||
populateKnownIndels(metaDataTracker, null);
|
populateKnownIndels(metaDataTracker, null);
|
||||||
|
|
@ -274,6 +273,14 @@ public class IndelRealigner extends ReadWalker<Integer, Integer> {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean doNotTryToClean(SAMRecord read) {
|
||||||
|
return read.getReadUnmappedFlag() ||
|
||||||
|
read.getNotPrimaryAlignmentFlag() ||
|
||||||
|
read.getMappingQuality() == 0 ||
|
||||||
|
read.getAlignmentStart() == SAMRecord.NO_ALIGNMENT_START ||
|
||||||
|
(!REALIGN_BADLY_MATED_READS && read.getReadPairedFlag() && !read.getMateUnmappedFlag() && read.getMateReferenceIndex() != read.getReferenceIndex());
|
||||||
|
}
|
||||||
|
|
||||||
private void cleanAndCallMap(ReferenceContext ref, SAMRecord read, ReadMetaDataTracker metaDataTracker, GenomeLoc readLoc) {
|
private void cleanAndCallMap(ReferenceContext ref, SAMRecord read, ReadMetaDataTracker metaDataTracker, GenomeLoc readLoc) {
|
||||||
clean(readsToClean);
|
clean(readsToClean);
|
||||||
knownIndelsToTry.clear();
|
knownIndelsToTry.clear();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue