use of com.hartwig.hmftools.patientreporter.report.data.Alteration in project hmftools by hartwigmedical.
the class CivicAnalyzer method civicFusionAlterations.
@NotNull
private static List<Alteration> civicFusionAlterations(@NotNull final List<GeneFusionData> fusions, @NotNull final Set<String> relevantDoids) {
LOGGER.info(" Fetching civic fusion alterations...");
final List<Alteration> alterations = Lists.newArrayList();
for (final GeneFusionData fusion : fusions) {
alterations.addAll(queryCivicAlteration(fusion.geneStartEntrezIds(), variantList -> Alteration.from(fusion, variantList, relevantDoids), " Failed to get civic variants for fusion: " + fusion.geneStart() + " - " + fusion.geneEnd()));
alterations.addAll(queryCivicAlteration(fusion.geneEndEntrezIds(), variantList -> Alteration.from(fusion, variantList, relevantDoids), " Failed to get civic variants for fusion: " + fusion.geneStart() + " - " + fusion.geneEnd()));
}
return alterations;
}
use of com.hartwig.hmftools.patientreporter.report.data.Alteration in project hmftools by hartwigmedical.
the class CivicAnalyzer method queryCivicAlteration.
@NotNull
private static List<Alteration> queryCivicAlteration(@NotNull final List<Integer> entrezIds, io.reactivex.functions.Function<List<CivicVariantWithEvidence>, Alteration> alterationBuilder, @NotNull final String error) {
final CivicApiWrapper civicApi = new CivicApiWrapper();
final List<Alteration> result = Lists.newArrayList();
try {
result.addAll(Observable.fromIterable(entrezIds).flatMap(civicApi::getVariantsForGene).toList().map(alterationBuilder).filter(alteration -> !alteration.getMatches().isEmpty()).toObservable().toList().blockingGet());
} catch (final Throwable throwable) {
LOGGER.error("{}. Error message: {}", error, throwable.getMessage());
}
civicApi.releaseResources();
return result;
}
Aggregations