In TableRecalibrationWalker, update UQ tag if it was present in the original SAMRecord. This required a new sam.jar, which caused some other files to need to be changed.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2435 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
87ff2b15d4
commit
159778416c
|
|
@ -58,6 +58,10 @@ public class SAMFileWriterStorage implements SAMFileWriter, Storage<SAMFileWrite
|
||||||
writer.addAlignment(read);
|
writer.addAlignment(read);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SAMFileHeader getFileHeader() {
|
||||||
|
return writer.getFileHeader();
|
||||||
|
}
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
writer.close();
|
writer.close();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,10 @@ public class SAMFileWriterStub implements Stub<SAMFileWriter>, SAMFileWriter {
|
||||||
return engine.getSAMFileHeader();
|
return engine.getSAMFileHeader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SAMFileHeader getFileHeader() {
|
||||||
|
return getSAMFileHeader();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the desired compression level for
|
* Retrieves the desired compression level for
|
||||||
* @return The current compression level. Could be null if the user doesn't care.
|
* @return The current compression level. Could be null if the user doesn't care.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package org.broadinstitute.sting.gatk.walkers.recalibration;
|
package org.broadinstitute.sting.gatk.walkers.recalibration;
|
||||||
|
|
||||||
import net.sf.samtools.*;
|
import net.sf.samtools.*;
|
||||||
|
import net.sf.samtools.util.SequenceUtil;
|
||||||
import org.broadinstitute.sting.gatk.walkers.ReadWalker;
|
import org.broadinstitute.sting.gatk.walkers.ReadWalker;
|
||||||
import org.broadinstitute.sting.gatk.walkers.WalkerName;
|
import org.broadinstitute.sting.gatk.walkers.WalkerName;
|
||||||
import org.broadinstitute.sting.gatk.walkers.Requires;
|
import org.broadinstitute.sting.gatk.walkers.Requires;
|
||||||
|
|
@ -336,6 +337,10 @@ public class TableRecalibrationWalker extends ReadWalker<SAMRecord, SAMFileWrite
|
||||||
if ( read.getAttribute(RecalDataManager.ORIGINAL_QUAL_ATTRIBUTE_TAG) == null ) { // Save the old qualities if the tag isn't already taken in the read
|
if ( read.getAttribute(RecalDataManager.ORIGINAL_QUAL_ATTRIBUTE_TAG) == null ) { // Save the old qualities if the tag isn't already taken in the read
|
||||||
read.setAttribute(RecalDataManager.ORIGINAL_QUAL_ATTRIBUTE_TAG, QualityUtils.phredToFastq(originalQuals));
|
read.setAttribute(RecalDataManager.ORIGINAL_QUAL_ATTRIBUTE_TAG, QualityUtils.phredToFastq(originalQuals));
|
||||||
}
|
}
|
||||||
|
if (read.getAttribute(SAMTag.UQ.name()) != null) {
|
||||||
|
// TODO - When refBases is switches to byte[], call the appropriate overload in SAM-JDK, and remove char[] overload from SAM-JDK.
|
||||||
|
read.setAttribute(SAMTag.UQ.name(), SequenceUtil.sumQualitiesOfMismatches(read, refBases, read.getAlignmentStart() - 1));
|
||||||
|
}
|
||||||
|
|
||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package org.broadinstitute.sting.utils.sam;
|
package org.broadinstitute.sting.utils.sam;
|
||||||
|
|
||||||
|
import net.sf.samtools.SAMFileHeader;
|
||||||
import net.sf.samtools.SAMFileWriter;
|
import net.sf.samtools.SAMFileWriter;
|
||||||
import net.sf.samtools.SAMRecord;
|
import net.sf.samtools.SAMRecord;
|
||||||
|
|
||||||
|
|
@ -52,6 +53,13 @@ public class ArtificialSAMFileWriter implements SAMFileWriter {
|
||||||
records.add(alignment);
|
records.add(alignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SAMFileHeader getFileHeader() {
|
||||||
|
if (records.size() > 0) {
|
||||||
|
return records.get(0).getHeader();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/** not much to do when we're fake */
|
/** not much to do when we're fake */
|
||||||
public void close() {
|
public void close() {
|
||||||
closed = true;
|
closed = true;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<ivy-module version="1.0">
|
|
||||||
<info organisation="net.sf" module="sam" revision="1.07.168" status="release" />
|
|
||||||
</ivy-module>
|
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,3 @@
|
||||||
|
<ivy-module version="1.0">
|
||||||
|
<info organisation="net.sf" module="sam" revision="1.11.221" status="release" />
|
||||||
|
</ivy-module>
|
||||||
Loading…
Reference in New Issue