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:
alecw 2009-12-23 21:42:36 +00:00
parent 87ff2b15d4
commit 159778416c
7 changed files with 24 additions and 3 deletions

View File

@ -58,6 +58,10 @@ public class SAMFileWriterStorage implements SAMFileWriter, Storage<SAMFileWrite
writer.addAlignment(read);
}
public SAMFileHeader getFileHeader() {
return writer.getFileHeader();
}
public void close() {
writer.close();
}

View File

@ -89,6 +89,10 @@ public class SAMFileWriterStub implements Stub<SAMFileWriter>, SAMFileWriter {
return engine.getSAMFileHeader();
}
public SAMFileHeader getFileHeader() {
return getSAMFileHeader();
}
/**
* Retrieves the desired compression level for
* @return The current compression level. Could be null if the user doesn't care.

View File

@ -1,6 +1,7 @@
package org.broadinstitute.sting.gatk.walkers.recalibration;
import net.sf.samtools.*;
import net.sf.samtools.util.SequenceUtil;
import org.broadinstitute.sting.gatk.walkers.ReadWalker;
import org.broadinstitute.sting.gatk.walkers.WalkerName;
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
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;
}

View File

@ -1,5 +1,6 @@
package org.broadinstitute.sting.utils.sam;
import net.sf.samtools.SAMFileHeader;
import net.sf.samtools.SAMFileWriter;
import net.sf.samtools.SAMRecord;
@ -52,6 +53,13 @@ public class ArtificialSAMFileWriter implements SAMFileWriter {
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 */
public void close() {
closed = true;

View File

@ -1,3 +0,0 @@
<ivy-module version="1.0">
<info organisation="net.sf" module="sam" revision="1.07.168" status="release" />
</ivy-module>

View File

@ -0,0 +1,3 @@
<ivy-module version="1.0">
<info organisation="net.sf" module="sam" revision="1.11.221" status="release" />
</ivy-module>