Search in sources :

Example 6 with Program

use of nl.hartwigmedicalfoundation.bachelor.Program in project hmftools by hartwigmedical.

the class BachelorSchema method processXML.

@Nullable
public Program processXML(final Path path) {
    LOGGER.info("loading input file: {}", path);
    try {
        final JAXBContext context = JAXBContext.newInstance(Program.class);
        final Unmarshaller unmarshaller = context.createUnmarshaller();
        unmarshaller.setSchema(schema);
        return (Program) unmarshaller.unmarshal(path.toFile());
    } catch (final JAXBException e) {
        LOGGER.error("failed to process: {}", path);
        LOGGER.error(e);
        return null;
    }
}
Also used : Program(nl.hartwigmedicalfoundation.bachelor.Program) JAXBException(javax.xml.bind.JAXBException) JAXBContext(javax.xml.bind.JAXBContext) Unmarshaller(javax.xml.bind.Unmarshaller) Nullable(org.jetbrains.annotations.Nullable)

Example 7 with Program

use of nl.hartwigmedicalfoundation.bachelor.Program in project hmftools by hartwigmedical.

the class BlacklistPredicateTest method setup.

@Before
public void setup() throws SAXException {
    BachelorSchema schema = BachelorSchema.make();
    final Program program = schema.processXML(Paths.get(BLACKLIST_XML));
    assertNotNull(program);
    blacklistPredicate = new BlacklistPredicate(Sets.newHashSet("ENST00000380152"), program.getBlacklist());
    VCFHeader header = new VCFHeader(Sets.newHashSet(), Sets.newHashSet(SAMPLE));
    codec = new VCFCodec();
    codec.setVCFHeader(header, VCFHeaderVersion.VCF4_2);
}
Also used : VCFCodec(htsjdk.variant.vcf.VCFCodec) Program(nl.hartwigmedicalfoundation.bachelor.Program) BachelorSchema(com.hartwig.hmftools.bachelor.BachelorSchema) VCFHeader(htsjdk.variant.vcf.VCFHeader) Before(org.junit.Before)

Aggregations

Program (nl.hartwigmedicalfoundation.bachelor.Program)7 List (java.util.List)5 Map (java.util.Map)5 Collectors (java.util.stream.Collectors)5 LogManager (org.apache.logging.log4j.LogManager)5 Logger (org.apache.logging.log4j.Logger)5 NotNull (org.jetbrains.annotations.NotNull)5 Lists (com.google.common.collect.Lists)4 Maps (com.google.common.collect.Maps)4 GeneCopyNumber (com.hartwig.hmftools.common.gene.GeneCopyNumber)4 VariantContext (htsjdk.variant.variantcontext.VariantContext)4 VCFFileReader (htsjdk.variant.vcf.VCFFileReader)4 Collection (java.util.Collection)4 Collections (java.util.Collections)4 Stream (java.util.stream.Stream)4 HashMultimap (com.google.common.collect.HashMultimap)3 Multimap (com.google.common.collect.Multimap)3 Sets (com.google.common.collect.Sets)3 SortedSetMultimap (com.google.common.collect.SortedSetMultimap)3 GERMLINE_DELETION (com.hartwig.hmftools.bachelor.EligibilityReport.ReportType.GERMLINE_DELETION)3