From 999a8998ae4d007847f9c2fdd99b4ef3217cc9fe Mon Sep 17 00:00:00 2001 From: Mark DePristo Date: Wed, 19 Oct 2011 17:51:48 -0400 Subject: [PATCH] Constructor for GATKSamRecord with header only, for unit testing --- .../sting/utils/sam/GATKSAMRecord.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMRecord.java b/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMRecord.java index 56e6e74be..7956ac388 100755 --- a/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMRecord.java +++ b/public/java/src/org/broadinstitute/sting/utils/sam/GATKSAMRecord.java @@ -36,6 +36,16 @@ public class GATKSamRecord extends BAMRecord { // These attributes exist in memory only, and are never written to disk. private Map temporaryAttributes; + /** + * HACK TO CREATE GATKSAMRECORD WITH ONLY A HEADER FOR TESTING PURPOSES ONLY + * @param header + */ + public GATKSamRecord(final SAMFileHeader header) { + super(header, SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX, SAMRecord.NO_ALIGNMENT_START, + (short)0, (short)255, 0, 1, 0, 1, 0, 0, 0, null); + } + + public GATKSamRecord(final SAMFileHeader header, final int referenceSequenceIndex, final int alignmentStart, @@ -57,17 +67,20 @@ public class GATKSamRecord extends BAMRecord { // *** The following methods are overloaded to cache the appropriate data ***// /////////////////////////////////////////////////////////////////////////////// + @Override public String getReadString() { if ( mReadString == null ) mReadString = super.getReadString(); return mReadString; } + @Override public void setReadString(String s) { super.setReadString(s); mReadString = s; } + @Override public SAMReadGroupRecord getReadGroup() { if ( !retrievedReadGroup ) { SAMReadGroupRecord tempReadGroup = super.getReadGroup();