Let's make artificial reads that actually adhere to the specs...

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3022 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-03-17 16:51:42 +00:00
parent 5b34bb9ab0
commit ded4ba8966
2 changed files with 7 additions and 4 deletions

View File

@ -155,12 +155,14 @@ public class ArtificialSAMUtils {
record.setCigar(new Cigar(elements));
record.setProperPairFlag(false);
// our reads are all 'A's by default
// our reads and quals are all 'A's by default
byte[] c = new byte[length];
byte[] q = new byte[length];
for (int x = 0; x < length; x++)
c[x] = 'A';
c[x] = q[x] = 'A';
record.setReadBases(c);
record.setBaseQualities(q);
if (refIndex == SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX) {
record.setReadUmappedFlag(true);
}

View File

@ -55,7 +55,8 @@ public class GATKSAMRecord extends SAMRecord {
setAttribute(attribute.tag, attribute.value);
// if we are using original quals, set them now if t hey are present in the record
if ( GenomeAnalysisEngine.instance.getArguments().useOriginalBaseQualities ) {
if ( GenomeAnalysisEngine.instance != null &&
GenomeAnalysisEngine.instance.getArguments().useOriginalBaseQualities ) {
byte[] originalQuals = mRecord.getOriginalBaseQualities();
if ( originalQuals != null )
mRecord.setBaseQualities(originalQuals);