SamplesDB no longer has null sample

-- Updated getSamples().size() == 2 test in CallableLociWalker that really ensured there was one sample in the system
This commit is contained in:
Mark DePristo 2011-09-30 09:56:23 -04:00
parent e055a78f6e
commit a69a4dda2f
3 changed files with 26 additions and 3 deletions

View File

@ -35,7 +35,7 @@ public class SampleDataSource {
* Constructor takes both a SAM header and sample files because the two must be integrated.
*/
public SampleDataSource() {
samples.put(null, new Sample(null, this));
}
public SampleDataSource(final SAMFileHeader header, final List<File> sampleFiles) {

View File

@ -227,8 +227,7 @@ public class CallableLociWalker extends LocusWalker<CallableLociWalker.CallableB
@Override
public void initialize() {
if ( getSampleDB().getSamples().size() != 2 ) {
// unbelievably there are actually two samples even when there's just one in the header. God I hate this Samples system
if ( getSampleDB().getSamples().size() != 1 ) {
throw new UserException.BadArgumentValue("-I", "CallableLoci only works for a single sample, but multiple samples were found in the provided BAM files: " + getSampleDB().getSamples());
}

View File

@ -1,3 +1,27 @@
/*
* Copyright (c) 2011, The Broad Institute
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
package org.broadinstitute.sting.gatk.walkers.qc;
import net.sf.samtools.SAMRecord;