use of com.hartwig.hmftools.common.gene.GeneModel in project hmftools by hartwigmedical.
the class PatientReporterTest method canRunOnRunDirectory.
@Test
public void canRunOnRunDirectory() throws IOException {
final GeneModel geneModel = new GeneModel(HmfGenePanelSupplier.hmfPanelGeneMap());
final BaseReporterData baseReporterData = testBaseReporterData();
final HmfReporterData reporterData = testHmfReporterData();
final VariantAnalyzer variantAnalyzer = VariantAnalyzer.of(geneModel, reporterData.microsatelliteAnalyzer());
final StructuralVariantAnalyzer svAnalyzer = new StructuralVariantAnalyzer(new TestAnnotator(), geneModel.regions(), CosmicFusions.readFromCSV(FUSIONS_CSV));
final PatientReporter algo = ImmutablePatientReporter.of(baseReporterData, reporterData, variantAnalyzer, svAnalyzer, mockedCivicAnalyzer());
assertNotNull(algo.run(RUN_DIRECTORY, null));
}
use of com.hartwig.hmftools.common.gene.GeneModel in project hmftools by hartwigmedical.
the class VariantAnalyzerTest method realCaseWorks.
@Test
public void realCaseWorks() {
final GeneModel geneModel = new GeneModel(hmfRegions());
final VariantAnalyzer analyzer = VariantAnalyzer.of(geneModel, testMicrosatelliteAnalyzer());
final VariantAnnotation rightAnnotation = createVariantAnnotationBuilder(VariantConsequence.MISSENSE_VARIANT).featureType(RIGHT_FEATURE_TYPE).featureID(RIGHT_TRANSCRIPT).build();
final VariantAnnotation wrongTranscript = createVariantAnnotationBuilder(VariantConsequence.MISSENSE_VARIANT).featureType(RIGHT_FEATURE_TYPE).featureID(WRONG_TRANSCRIPT).build();
final VariantAnnotation wrongFeatureType = createVariantAnnotationBuilder(VariantConsequence.MISSENSE_VARIANT).featureType(WRONG_FEATURE_TYPE).featureID(RIGHT_TRANSCRIPT).build();
final VariantAnnotation wrongConsequence = createVariantAnnotationBuilder(VariantConsequence.OTHER).featureType(RIGHT_FEATURE_TYPE).featureID(RIGHT_TRANSCRIPT).build();
final List<SomaticVariant> variants = Lists.newArrayList(builder().position(420).annotations(Lists.newArrayList(rightAnnotation, wrongTranscript)).build(), builder().position(430).annotations(Lists.newArrayList(wrongConsequence)).build(), builder().position(440).annotations(Lists.newArrayList(wrongFeatureType)).build(), builder().position(460).annotations(Lists.newArrayList(rightAnnotation)).build());
final VariantAnalysis analysis = analyzer.run(variants);
assertEquals(4, analysis.passedVariants().size());
assertEquals(3, analysis.mutationalLoad());
assertEquals(1, analysis.findings().size());
}
use of com.hartwig.hmftools.common.gene.GeneModel in project hmftools by hartwigmedical.
the class HmfReporterDataLoader method buildFromFiles.
@NotNull
static HmfReporterData buildFromFiles(@NotNull final String cosmicGeneFile, @NotNull final String cosmicFusionFile, @NotNull final String drupFilterFile, @NotNull final String fastaFileLocation) throws IOException {
final GeneModel panelGeneModel = new GeneModel(HmfGenePanelSupplier.hmfPanelGeneMap());
final CosmicGeneModel cosmicGeneModel = CosmicGenes.readFromCSV(cosmicGeneFile);
final CosmicFusionModel cosmicFusionModel = CosmicFusions.readFromCSV(cosmicFusionFile);
final DrupFilter drupFilter = new DrupFilter(drupFilterFile);
final MicrosatelliteAnalyzer microsatelliteAnalyzer = ImmutableMicrosatelliteAnalyzer.of(fastaFileLocation);
return ImmutableHmfReporterData.of(panelGeneModel, cosmicGeneModel, cosmicFusionModel, drupFilter, microsatelliteAnalyzer);
}
use of com.hartwig.hmftools.common.gene.GeneModel in project hmftools by hartwigmedical.
the class PatientReporterTestUtil method testHmfReporterData.
@NotNull
public static HmfReporterData testHmfReporterData() throws IOException {
final String drupFilterPath = Resources.getResource("csv").getPath() + File.separator + "drup_genes.csv";
final String cosmicPath = Resources.getResource("csv").getPath() + File.separator + "cosmic_slice.csv";
final String fusionPath = Resources.getResource("csv").getPath() + File.separator + "cosmic_gene_fusions.csv";
final GeneModel geneModel = new GeneModel(HmfGenePanelSupplier.hmfPanelGeneMap());
final CosmicGeneModel cosmicGeneModel = CosmicGenes.readFromCSV(cosmicPath);
final CosmicFusionModel cosmicFusionModel = CosmicFusions.readFromCSV(fusionPath);
final DrupFilter drupFilter = new DrupFilter(drupFilterPath);
final MicrosatelliteAnalyzer microsatelliteAnalyzer = testMicrosatelliteAnalyzer();
return ImmutableHmfReporterData.of(geneModel, cosmicGeneModel, cosmicFusionModel, drupFilter, microsatelliteAnalyzer);
}
Aggregations