Search in sources :

Example 1 with GeneModel

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));
}
Also used : StructuralVariantAnalyzer(com.hartwig.hmftools.svannotation.analysis.StructuralVariantAnalyzer) VariantAnalyzer(com.hartwig.hmftools.patientreporter.variants.VariantAnalyzer) BaseReporterData(com.hartwig.hmftools.patientreporter.BaseReporterData) PatientReporterTestUtil.testBaseReporterData(com.hartwig.hmftools.patientreporter.PatientReporterTestUtil.testBaseReporterData) StructuralVariantAnalyzer(com.hartwig.hmftools.svannotation.analysis.StructuralVariantAnalyzer) GeneModel(com.hartwig.hmftools.common.gene.GeneModel) HmfReporterData(com.hartwig.hmftools.patientreporter.HmfReporterData) PatientReporterTestUtil.testHmfReporterData(com.hartwig.hmftools.patientreporter.PatientReporterTestUtil.testHmfReporterData) Test(org.junit.Test)

Example 2 with GeneModel

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());
}
Also used : SomaticVariant(com.hartwig.hmftools.common.variant.SomaticVariant) VariantAnnotation(com.hartwig.hmftools.common.variant.snpeff.VariantAnnotation) GeneModel(com.hartwig.hmftools.common.gene.GeneModel) Test(org.junit.Test)

Example 3 with GeneModel

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);
}
Also used : CosmicGeneModel(com.hartwig.hmftools.common.cosmic.genes.CosmicGeneModel) CosmicFusionModel(com.hartwig.hmftools.common.cosmic.fusions.CosmicFusionModel) ImmutableMicrosatelliteAnalyzer(com.hartwig.hmftools.patientreporter.variants.ImmutableMicrosatelliteAnalyzer) MicrosatelliteAnalyzer(com.hartwig.hmftools.patientreporter.variants.MicrosatelliteAnalyzer) CosmicGeneModel(com.hartwig.hmftools.common.cosmic.genes.CosmicGeneModel) GeneModel(com.hartwig.hmftools.common.gene.GeneModel) DrupFilter(com.hartwig.hmftools.patientreporter.filters.DrupFilter) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with GeneModel

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);
}
Also used : CosmicGeneModel(com.hartwig.hmftools.common.cosmic.genes.CosmicGeneModel) CosmicFusionModel(com.hartwig.hmftools.common.cosmic.fusions.CosmicFusionModel) MicrosatelliteAnalyzer(com.hartwig.hmftools.patientreporter.variants.MicrosatelliteAnalyzer) GeneModel(com.hartwig.hmftools.common.gene.GeneModel) CosmicGeneModel(com.hartwig.hmftools.common.cosmic.genes.CosmicGeneModel) DrupFilter(com.hartwig.hmftools.patientreporter.filters.DrupFilter) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

GeneModel (com.hartwig.hmftools.common.gene.GeneModel)4 CosmicFusionModel (com.hartwig.hmftools.common.cosmic.fusions.CosmicFusionModel)2 CosmicGeneModel (com.hartwig.hmftools.common.cosmic.genes.CosmicGeneModel)2 DrupFilter (com.hartwig.hmftools.patientreporter.filters.DrupFilter)2 MicrosatelliteAnalyzer (com.hartwig.hmftools.patientreporter.variants.MicrosatelliteAnalyzer)2 NotNull (org.jetbrains.annotations.NotNull)2 Test (org.junit.Test)2 SomaticVariant (com.hartwig.hmftools.common.variant.SomaticVariant)1 VariantAnnotation (com.hartwig.hmftools.common.variant.snpeff.VariantAnnotation)1 BaseReporterData (com.hartwig.hmftools.patientreporter.BaseReporterData)1 HmfReporterData (com.hartwig.hmftools.patientreporter.HmfReporterData)1 PatientReporterTestUtil.testBaseReporterData (com.hartwig.hmftools.patientreporter.PatientReporterTestUtil.testBaseReporterData)1 PatientReporterTestUtil.testHmfReporterData (com.hartwig.hmftools.patientreporter.PatientReporterTestUtil.testHmfReporterData)1 ImmutableMicrosatelliteAnalyzer (com.hartwig.hmftools.patientreporter.variants.ImmutableMicrosatelliteAnalyzer)1 VariantAnalyzer (com.hartwig.hmftools.patientreporter.variants.VariantAnalyzer)1 StructuralVariantAnalyzer (com.hartwig.hmftools.svannotation.analysis.StructuralVariantAnalyzer)1