Skip to content

Commit

Permalink
Addressed code review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonn-smith committed May 29, 2018
1 parent 87b6ce8 commit 3691eec
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,25 +174,6 @@ public class GencodeFuncotationFactory extends DataSourceFuncotationFactory {
//==================================================================================================================
// Constructors:

public GencodeFuncotationFactory(final Path gencodeTranscriptFastaFile, final String version) {
this(gencodeTranscriptFastaFile, version, DEFAULT_NAME, FuncotatorArgumentDefinitions.TRANSCRIPT_SELECTION_MODE_DEFAULT_VALUE, new HashSet<>(), new LinkedHashMap<>());
}

public GencodeFuncotationFactory(final Path gencodeTranscriptFastaFile, final String version, final Set<String> userRequestedTranscripts) {
this(gencodeTranscriptFastaFile, version, DEFAULT_NAME, FuncotatorArgumentDefinitions.TRANSCRIPT_SELECTION_MODE_DEFAULT_VALUE, userRequestedTranscripts, new LinkedHashMap<>());
}

public GencodeFuncotationFactory(final Path gencodeTranscriptFastaFile, final String version,final TranscriptSelectionMode transcriptSelectionMode) {
this(gencodeTranscriptFastaFile, version, DEFAULT_NAME, transcriptSelectionMode, new HashSet<>(), new LinkedHashMap<>());
}

public GencodeFuncotationFactory(final Path gencodeTranscriptFastaFile,
final String version,
final TranscriptSelectionMode transcriptSelectionMode,
final Set<String> userRequestedTranscripts) {
this(gencodeTranscriptFastaFile, version, DEFAULT_NAME, transcriptSelectionMode, userRequestedTranscripts, new LinkedHashMap<>());
}

public GencodeFuncotationFactory(final Path gencodeTranscriptFastaFile,
final String version,
final String name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,24 +203,24 @@ public Object[][] provideForLargeDataValidationTest() {
true,
FuncotatorTestConstants.REFERENCE_VERSION_HG19,
},
// {
// "C828.TCGA-D3-A2JP-06A-11D-A19A-08.3-filtered.PASS.vcf",
// "Homo_sapiens_assembly19.fasta",
// true,
// FuncotatorTestConstants.REFERENCE_VERSION_HG19
// },
// {
// "hg38_test_variants.vcf",
// "Homo_sapiens_assembly38.fasta",
// false,
// FuncotatorTestConstants.REFERENCE_VERSION_HG38
// },
// {
// "sample21.trimmed.vcf",
// "Homo_sapiens_assembly38.fasta",
// false,
// FuncotatorTestConstants.REFERENCE_VERSION_HG38
// }
{
"C828.TCGA-D3-A2JP-06A-11D-A19A-08.3-filtered.PASS.vcf",
"Homo_sapiens_assembly19.fasta",
true,
FuncotatorTestConstants.REFERENCE_VERSION_HG19
},
{
"hg38_test_variants.vcf",
"Homo_sapiens_assembly38.fasta",
false,
FuncotatorTestConstants.REFERENCE_VERSION_HG38
},
{
"sample21.trimmed.vcf",
"Homo_sapiens_assembly38.fasta",
false,
FuncotatorTestConstants.REFERENCE_VERSION_HG38
}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
import org.broadinstitute.hellbender.engine.ReferenceDataSource;
import org.broadinstitute.hellbender.engine.ReferenceMemorySource;
import org.broadinstitute.hellbender.exceptions.GATKException;
import org.broadinstitute.hellbender.tools.funcotator.Funcotation;
import org.broadinstitute.hellbender.tools.funcotator.FuncotatorTestConstants;
import org.broadinstitute.hellbender.tools.funcotator.SequenceComparison;
import org.broadinstitute.hellbender.tools.funcotator.TranscriptSelectionMode;
import org.broadinstitute.hellbender.tools.funcotator.*;
import org.broadinstitute.hellbender.utils.SimpleInterval;
import org.broadinstitute.hellbender.utils.codecs.gencode.*;
import org.broadinstitute.hellbender.utils.io.IOUtils;
Expand Down Expand Up @@ -65,7 +62,13 @@ public class GencodeFuncotationFactoryUnitTest extends GATKBaseTest {

// Gets cleaned up in `cleanupAfterTests()`
// NOTE: This is initialized here to save time in testing.
testMuc16SnpCreateFuncotationsFuncotationFactory = new GencodeFuncotationFactory(IOUtils.getPath(FuncotatorTestConstants.MUC16_GENCODE_TRANSCRIPT_FASTA_FILE), "VERSION");
testMuc16SnpCreateFuncotationsFuncotationFactory = new GencodeFuncotationFactory(
IOUtils.getPath(FuncotatorTestConstants.MUC16_GENCODE_TRANSCRIPT_FASTA_FILE),
"VERSION",
GencodeFuncotationFactory.DEFAULT_NAME,
FuncotatorArgumentDefinitions.TRANSCRIPT_SELECTION_MODE_DEFAULT_VALUE,
new HashSet<>(),
new LinkedHashMap<>());
}

//==================================================================================================================
Expand Down Expand Up @@ -1147,7 +1150,13 @@ void testMuc16SnpCreateFuncotations(final int chromosomeNumber,
final Set<String> requestedTranscriptIds = getValidTranscriptsForGene("MUC16");

// Create a factory for our funcotations:
try (final GencodeFuncotationFactory funcotationFactory = new GencodeFuncotationFactory(new File(FuncotatorTestConstants.MUC16_GENCODE_TRANSCRIPT_FASTA_FILE).toPath(), "VERSION", requestedTranscriptIds)) {
try (final GencodeFuncotationFactory funcotationFactory = new GencodeFuncotationFactory(
IOUtils.getPath(FuncotatorTestConstants.MUC16_GENCODE_TRANSCRIPT_FASTA_FILE),
"VERSION",
GencodeFuncotationFactory.DEFAULT_NAME,
FuncotatorArgumentDefinitions.TRANSCRIPT_SELECTION_MODE_DEFAULT_VALUE,
requestedTranscriptIds,
new LinkedHashMap<>())) {

// Generate our funcotations:
final List<Feature> featureList = new ArrayList<>();
Expand Down Expand Up @@ -1198,7 +1207,13 @@ void createNonBasicFuncotations(final int start, final int end) {
final ReferenceContext referenceContext = new ReferenceContext(refDataSourceHg19Ch19, variantInterval );

// Create a factory for our funcotations:
try (final GencodeFuncotationFactory funcotationFactory = new GencodeFuncotationFactory(new File(FuncotatorTestConstants.MUC16_GENCODE_TRANSCRIPT_FASTA_FILE).toPath(), "VERSION")) {
try (final GencodeFuncotationFactory funcotationFactory = new GencodeFuncotationFactory(
IOUtils.getPath(FuncotatorTestConstants.MUC16_GENCODE_TRANSCRIPT_FASTA_FILE),
"VERSION",
GencodeFuncotationFactory.DEFAULT_NAME,
FuncotatorArgumentDefinitions.TRANSCRIPT_SELECTION_MODE_DEFAULT_VALUE,
new HashSet<>(),
new LinkedHashMap<>())) {

// Generate our funcotations:
final List<Feature> featureList = new ArrayList<>();
Expand Down Expand Up @@ -1262,7 +1277,13 @@ void testCreateFuncotations(final String expectedGeneName,
final Set<String> requestedTranscriptIds = getValidTranscriptsForGene(expectedGeneName);

// Create a factory for our funcotations:
try (final GencodeFuncotationFactory funcotationFactory = new GencodeFuncotationFactory(IOUtils.getPath(transcriptFastaFile), "VERSION", requestedTranscriptIds)) {
try (final GencodeFuncotationFactory funcotationFactory = new GencodeFuncotationFactory(
IOUtils.getPath(transcriptFastaFile),
"VERSION",
GencodeFuncotationFactory.DEFAULT_NAME,
FuncotatorArgumentDefinitions.TRANSCRIPT_SELECTION_MODE_DEFAULT_VALUE,
requestedTranscriptIds,
new LinkedHashMap<>())) {

final List<Feature> featureList = new ArrayList<>();
featureList.add( gene );
Expand Down

0 comments on commit 3691eec

Please sign in to comment.