Search in sources :

Example 1 with SOMATIC_DELETION

use of com.hartwig.hmftools.bachelor.EligibilityReport.ReportType.SOMATIC_DELETION in project hmftools by hartwigmedical.

the class BachelorEligibility method processCopyNumbers.

@NotNull
Collection<EligibilityReport> processCopyNumbers(final String patient, final List<GeneCopyNumber> copyNumbers) {
    final List<EligibilityReport> results = Lists.newArrayList();
    for (final GeneCopyNumber copyNumber : copyNumbers) {
        // TODO: verify the germline check
        final boolean isGermline = copyNumber.germlineHet2HomRegions() + copyNumber.germlineHomRegions() > 0;
        final List<String> matchingPrograms = programs.stream().filter(program -> program.copyNumberProcessor().test(copyNumber)).map(BachelorProgram::name).collect(Collectors.toList());
        final List<EligibilityReport> interimResults = matchingPrograms.stream().map(p -> ImmutableEligibilityReport.builder().patient(patient).source(isGermline ? GERMLINE_DELETION : SOMATIC_DELETION).program(p).id("").genes(copyNumber.gene()).chrom(copyNumber.chromosome()).pos(copyNumber.start()).ref("").alts("").effects("").build()).collect(Collectors.toList());
        results.addAll(interimResults);
    }
    return results;
}
Also used : ProgramPanel(nl.hartwigmedicalfoundation.bachelor.ProgramPanel) Genotype(htsjdk.variant.variantcontext.Genotype) CloseableIterator(htsjdk.samtools.util.CloseableIterator) SOMATIC_DELETION(com.hartwig.hmftools.bachelor.EligibilityReport.ReportType.SOMATIC_DELETION) SOMATIC_DISRUPTION(com.hartwig.hmftools.bachelor.EligibilityReport.ReportType.SOMATIC_DISRUPTION) VCFFileReader(htsjdk.variant.vcf.VCFFileReader) HmfGenomeRegion(com.hartwig.hmftools.common.region.hmfslicer.HmfGenomeRegion) Multimap(com.google.common.collect.Multimap) StructuralVariant(com.hartwig.hmftools.common.variant.structural.StructuralVariant) HmfGenePanelSupplier(com.hartwig.hmftools.genepanel.HmfGenePanelSupplier) HashMultimap(com.google.common.collect.HashMultimap) Lists(com.google.common.collect.Lists) GenomePosition(com.hartwig.hmftools.common.position.GenomePosition) VariantAnnotation(com.hartwig.hmftools.common.variant.snpeff.VariantAnnotation) Map(java.util.Map) StructuralVariantType(com.hartwig.hmftools.common.variant.structural.StructuralVariantType) GenomePositions(com.hartwig.hmftools.common.position.GenomePositions) SnpEffect(nl.hartwigmedicalfoundation.bachelor.SnpEffect) GERMLINE_DELETION(com.hartwig.hmftools.bachelor.EligibilityReport.ReportType.GERMLINE_DELETION) SortedSetMultimap(com.google.common.collect.SortedSetMultimap) OtherEffect(nl.hartwigmedicalfoundation.bachelor.OtherEffect) Predicate(java.util.function.Predicate) Collection(java.util.Collection) Program(nl.hartwigmedicalfoundation.bachelor.Program) Set(java.util.Set) WhitelistPredicate(com.hartwig.hmftools.bachelor.predicates.WhitelistPredicate) Collectors(java.util.stream.Collectors) Maps(com.google.common.collect.Maps) Sets(com.google.common.collect.Sets) GeneIdentifier(nl.hartwigmedicalfoundation.bachelor.GeneIdentifier) List(java.util.List) Stream(java.util.stream.Stream) Logger(org.apache.logging.log4j.Logger) VariantContext(htsjdk.variant.variantcontext.VariantContext) HmfExonRegion(com.hartwig.hmftools.common.region.hmfslicer.HmfExonRegion) GeneCopyNumber(com.hartwig.hmftools.common.gene.GeneCopyNumber) NotNull(org.jetbrains.annotations.NotNull) Collections(java.util.Collections) LogManager(org.apache.logging.log4j.LogManager) BlacklistPredicate(com.hartwig.hmftools.bachelor.predicates.BlacklistPredicate) GeneCopyNumber(com.hartwig.hmftools.common.gene.GeneCopyNumber) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

HashMultimap (com.google.common.collect.HashMultimap)1 Lists (com.google.common.collect.Lists)1 Maps (com.google.common.collect.Maps)1 Multimap (com.google.common.collect.Multimap)1 Sets (com.google.common.collect.Sets)1 SortedSetMultimap (com.google.common.collect.SortedSetMultimap)1 GERMLINE_DELETION (com.hartwig.hmftools.bachelor.EligibilityReport.ReportType.GERMLINE_DELETION)1 SOMATIC_DELETION (com.hartwig.hmftools.bachelor.EligibilityReport.ReportType.SOMATIC_DELETION)1 SOMATIC_DISRUPTION (com.hartwig.hmftools.bachelor.EligibilityReport.ReportType.SOMATIC_DISRUPTION)1 BlacklistPredicate (com.hartwig.hmftools.bachelor.predicates.BlacklistPredicate)1 WhitelistPredicate (com.hartwig.hmftools.bachelor.predicates.WhitelistPredicate)1 GeneCopyNumber (com.hartwig.hmftools.common.gene.GeneCopyNumber)1 GenomePosition (com.hartwig.hmftools.common.position.GenomePosition)1 GenomePositions (com.hartwig.hmftools.common.position.GenomePositions)1 HmfExonRegion (com.hartwig.hmftools.common.region.hmfslicer.HmfExonRegion)1 HmfGenomeRegion (com.hartwig.hmftools.common.region.hmfslicer.HmfGenomeRegion)1 VariantAnnotation (com.hartwig.hmftools.common.variant.snpeff.VariantAnnotation)1 StructuralVariant (com.hartwig.hmftools.common.variant.structural.StructuralVariant)1 StructuralVariantType (com.hartwig.hmftools.common.variant.structural.StructuralVariantType)1 HmfGenePanelSupplier (com.hartwig.hmftools.genepanel.HmfGenePanelSupplier)1