Search in sources :

Example 1 with CivicVariantWithEvidence

use of com.hartwig.hmftools.apiclients.civic.data.CivicVariantWithEvidence in project hmftools by hartwigmedical.

the class CivicAnalyzer method civicWildTypeAlterations.

@NotNull
private static List<Alteration> civicWildTypeAlterations(@NotNull final List<HmfGenomeRegion> nonWildTypeGenes, @NotNull final Set<String> relevantDoids) {
    LOGGER.info("  Fetching civic wild type alterations...");
    final CivicApiWrapper civicApi = new CivicApiWrapper();
    final Set<String> nonWildTypeEntrezIds = nonWildTypeGenes.stream().flatMap(hmfGenomeRegion -> hmfGenomeRegion.entrezId().stream().map(Object::toString)).collect(Collectors.toSet());
    final List<Alteration> wildTypeAlterations = civicApi.getAllWildTypeVariants().filter(civicVariant -> !nonWildTypeEntrezIds.contains(civicVariant.entrezId())).groupBy(CivicVariantWithEvidence::gene).flatMap(pair -> pair.toList().map(variantList -> Alteration.fromWildType(pair.getKey(), variantList, relevantDoids)).filter(alteration -> !alteration.getMatches().isEmpty()).toObservable()).toList().blockingGet();
    civicApi.releaseResources();
    return wildTypeAlterations;
}
Also used : GeneDisruptionData(com.hartwig.hmftools.patientreporter.report.data.GeneDisruptionData) VariantReport(com.hartwig.hmftools.patientreporter.variants.VariantReport) GeneModel(com.hartwig.hmftools.common.gene.GeneModel) Predicate(java.util.function.Predicate) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) HmfGenomeRegion(com.hartwig.hmftools.common.region.hmfslicer.HmfGenomeRegion) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) GeneFusionData(com.hartwig.hmftools.patientreporter.report.data.GeneFusionData) CivicApiWrapper(com.hartwig.hmftools.apiclients.civic.api.CivicApiWrapper) List(java.util.List) Lists(com.google.common.collect.Lists) Logger(org.apache.logging.log4j.Logger) CivicVariantWithEvidence(com.hartwig.hmftools.apiclients.civic.data.CivicVariantWithEvidence) Alteration(com.hartwig.hmftools.patientreporter.report.data.Alteration) Observable(io.reactivex.Observable) GeneCopyNumber(com.hartwig.hmftools.common.gene.GeneCopyNumber) NotNull(org.jetbrains.annotations.NotNull) LogManager(org.apache.logging.log4j.LogManager) DiseaseOntologyApiWrapper(com.hartwig.hmftools.apiclients.diseaseontology.api.DiseaseOntologyApiWrapper) CivicApiWrapper(com.hartwig.hmftools.apiclients.civic.api.CivicApiWrapper) Alteration(com.hartwig.hmftools.patientreporter.report.data.Alteration) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Lists (com.google.common.collect.Lists)1 Sets (com.google.common.collect.Sets)1 CivicApiWrapper (com.hartwig.hmftools.apiclients.civic.api.CivicApiWrapper)1 CivicVariantWithEvidence (com.hartwig.hmftools.apiclients.civic.data.CivicVariantWithEvidence)1 DiseaseOntologyApiWrapper (com.hartwig.hmftools.apiclients.diseaseontology.api.DiseaseOntologyApiWrapper)1 GeneCopyNumber (com.hartwig.hmftools.common.gene.GeneCopyNumber)1 GeneModel (com.hartwig.hmftools.common.gene.GeneModel)1 HmfGenomeRegion (com.hartwig.hmftools.common.region.hmfslicer.HmfGenomeRegion)1 Alteration (com.hartwig.hmftools.patientreporter.report.data.Alteration)1 GeneDisruptionData (com.hartwig.hmftools.patientreporter.report.data.GeneDisruptionData)1 GeneFusionData (com.hartwig.hmftools.patientreporter.report.data.GeneFusionData)1 VariantReport (com.hartwig.hmftools.patientreporter.variants.VariantReport)1 Observable (io.reactivex.Observable)1 Collection (java.util.Collection)1 List (java.util.List)1 Set (java.util.Set)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Predicate (java.util.function.Predicate)1 Collectors (java.util.stream.Collectors)1 LogManager (org.apache.logging.log4j.LogManager)1