Move getSamplesForSamFile to SampleUtils

-- A nearly identical piece of code already lived in SampleUtils.  Now there are two functions, one taking a regular header and another grabbing the merged header from the GATK engine itself.  Much cleaner
This commit is contained in:
Mark DePristo 2011-09-30 10:28:18 -04:00
parent 30d23942b1
commit 178ba24c27
2 changed files with 12 additions and 7 deletions

View File

@ -1041,13 +1041,6 @@ public class GenomeAnalysisEngine {
return this.sampleDataSource;
}
/**
* Returns all samples that were referenced in the SAM file
*/
public Set<Sample> getSAMFileSamples() {
return sampleDataSource.getSamples(SampleUtils.getSAMFileSamples(getSAMFileHeader()));
}
public Map<String,String> getApproximateCommandLineArguments(Object... argumentProviders) {
return CommandLineUtils.getApproximateCommandLineArguments(parsingEngine,argumentProviders);
}

View File

@ -69,6 +69,18 @@ public class SampleUtils {
return samples;
}
/**
* Same as @link getSAMFileSamples but gets all of the samples
* in the SAM files loaded by the engine
*
* @param engine
* @return
*/
public final static Set<String> getSAMFileSamples(GenomeAnalysisEngine engine) {
return SampleUtils.getSAMFileSamples(engine.getSAMFileHeader());
}
/**
* Gets all of the unique sample names from all VCF rods input by the user
*