Bugfixes for the case when no read groups / no samples are available.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3523 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
adc4c4e577
commit
dbee21a50f
|
|
@ -279,7 +279,7 @@ public class DownsamplingLocusIteratorByState extends LocusIterator {
|
|||
public DownsamplingLocusIteratorByState(final Iterator<SAMRecord> samIterator, Reads readInformation, List<LocusIteratorFilter> filters ) {
|
||||
// Aggregate all sample names.
|
||||
// TODO: Push in header via constructor
|
||||
if(GenomeAnalysisEngine.instance.getDataSource() != null)
|
||||
if(GenomeAnalysisEngine.instance != null && GenomeAnalysisEngine.instance.getDataSource() != null)
|
||||
sampleNames.addAll(SampleUtils.getSAMFileSamples(GenomeAnalysisEngine.instance.getSAMFileHeader()));
|
||||
readStates = new ReadStateManager(samIterator,readInformation.getDownsamplingMethod(),readInformation.getMaxReadsAtLocus(),sampleNames);
|
||||
this.readInfo = readInformation;
|
||||
|
|
@ -657,7 +657,8 @@ public class DownsamplingLocusIteratorByState extends LocusIterator {
|
|||
int firstAlignmentStart = iterator.peek().getAlignmentStart();
|
||||
while(iterator.hasNext() && iterator.peek().getReferenceIndex() == firstContigIndex && iterator.peek().getAlignmentStart() == firstAlignmentStart) {
|
||||
SAMRecord read = iterator.next();
|
||||
getAggregator(read.getReadGroup().getSample()).add(read);
|
||||
Collection<SAMRecord> aggregator = getAggregator(read.getReadGroup()!=null ? read.getReadGroup().getSample() : null);
|
||||
aggregator.add(read);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -667,7 +668,8 @@ public class DownsamplingLocusIteratorByState extends LocusIterator {
|
|||
|
||||
while (iterator.hasNext() && !readIsPastCurrentPosition(iterator.peek())) {
|
||||
SAMRecord read = iterator.next();
|
||||
getAggregator(read.getReadGroup().getSample()).add(read);
|
||||
Collection<SAMRecord> aggregator = getAggregator(read.getReadGroup()!=null ? read.getReadGroup().getSample() : null);
|
||||
aggregator.add(read);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue