Minor function renaming
This commit is contained in:
parent
dd71884b0c
commit
2e3dc52088
|
|
@ -44,6 +44,7 @@ import org.broadinstitute.sting.gatk.io.stubs.Stub;
|
|||
import org.broadinstitute.sting.gatk.refdata.tracks.RMDTrackBuilder;
|
||||
import org.broadinstitute.sting.gatk.refdata.utils.RMDIntervalGenerator;
|
||||
import org.broadinstitute.sting.gatk.refdata.utils.RMDTriplet;
|
||||
import org.broadinstitute.sting.gatk.samples.SampleDBBuilder;
|
||||
import org.broadinstitute.sting.gatk.walkers.*;
|
||||
import org.broadinstitute.sting.utils.*;
|
||||
import org.broadinstitute.sting.utils.baq.BAQ;
|
||||
|
|
@ -686,10 +687,22 @@ public class GenomeAnalysisEngine {
|
|||
for (ReadFilter filter : filters)
|
||||
filter.initialize(this);
|
||||
|
||||
sampleDB = new SampleDB(getSAMFileHeader(), argCollection.sampleFiles);
|
||||
|
||||
// set the sequence dictionary of all of Tribble tracks to the sequence dictionary of our reference
|
||||
rodDataSources = getReferenceOrderedDataSources(referenceMetaDataFiles,referenceDataSource.getReference().getSequenceDictionary(),genomeLocParser,argCollection.unsafe);
|
||||
|
||||
// set up sample db
|
||||
initializeSampleDB();
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry-point function to initialize the samples database from input data and pedigree arguments
|
||||
*/
|
||||
private void initializeSampleDB() {
|
||||
SampleDBBuilder sampleDBBuilder = new SampleDBBuilder(this, argCollection.pedigreeValidationType);
|
||||
sampleDBBuilder.addSamplesFromSAMHeader(getSAMFileHeader());
|
||||
sampleDBBuilder.addSamplesFromSampleNames(SampleUtils.getUniqueSamplesFromRods(this));
|
||||
sampleDBBuilder.addSamplesFromPedigreeArgument(argCollection.pedigreeData);
|
||||
sampleDB = sampleDBBuilder.getFinalSampleDB();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,8 +56,12 @@ public class SampleDBBuilder {
|
|||
/**
|
||||
* Hallucinates sample objects for all the samples in the SAM file and stores them
|
||||
*/
|
||||
public SampleDBBuilder addSamples(SAMFileHeader header) {
|
||||
for (String sampleName : SampleUtils.getSAMFileSamples(header)) {
|
||||
public SampleDBBuilder addSamplesFromSAMHeader(final SAMFileHeader header) {
|
||||
return addSamplesFromSampleNames(SampleUtils.getSAMFileSamples(header));
|
||||
}
|
||||
|
||||
public SampleDBBuilder addSamplesFromSampleNames(final Collection<String> sampleNames) {
|
||||
for (final String sampleName : sampleNames) {
|
||||
if (sampleDB.getSample(sampleName) == null) {
|
||||
final Sample newSample = new Sample(sampleName, sampleDB);
|
||||
addSample(newSample);
|
||||
|
|
@ -66,7 +70,7 @@ public class SampleDBBuilder {
|
|||
return this;
|
||||
}
|
||||
|
||||
public SampleDBBuilder addSamples(final List<String> pedigreeArguments) {
|
||||
public SampleDBBuilder addSamplesFromPedigreeArgument(final List<String> pedigreeArguments) {
|
||||
for (final String ped : pedigreeArguments) {
|
||||
final File pedFile = new File(ped);
|
||||
if ( pedFile.exists() )
|
||||
|
|
@ -105,6 +109,7 @@ public class SampleDBBuilder {
|
|||
* @param sample to be added
|
||||
*/
|
||||
protected SampleDBBuilder addSample(Sample sample) {
|
||||
// todo -- merge with existing record if we have one
|
||||
sampleDB.addSample(sample);
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -299,7 +299,6 @@ public class PedReaderUnitTest extends BaseTest {
|
|||
super(PedReaderTestTagParsing.class);
|
||||
this.tags = tags;
|
||||
this.expected = missingDesc;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue