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;
}
Aggregations