use of com.hartwig.hmftools.common.variant.structural.StructuralVariantFactory in project hmftools by hartwigmedical.
the class SvVCFAnnotator method readFromVcf.
private List<VariantContext> readFromVcf(String vcfFilename) {
List<VariantContext> variants = Lists.newArrayList();
final StructuralVariantFactory factory = new StructuralVariantFactory(false);
try (final AbstractFeatureReader<VariantContext, LineIterator> reader = AbstractFeatureReader.getFeatureReader(vcfFilename, new VCFCodec(), false)) {
while (reader.iterator().hasNext()) variants.add(reader.iterator().next());
} catch (Exception e) {
}
return variants;
}
use of com.hartwig.hmftools.common.variant.structural.StructuralVariantFactory in project hmftools by hartwigmedical.
the class BachelorApplication method processSV.
private static Collection<EligibilityReport> processSV(final String patient, final File vcf, final BachelorEligibility eligibility) {
LOGGER.info("processing sv: {}", vcf.getPath());
final StructuralVariantFactory factory = new StructuralVariantFactory(true);
try {
try (final AbstractFeatureReader<VariantContext, LineIterator> reader = AbstractFeatureReader.getFeatureReader(vcf.getPath(), new VCFCodec(), false)) {
reader.iterator().forEach(factory::addVariantContext);
}
} catch (IOException e) {
LOGGER.error("error with SV file {}: {}", vcf.getPath(), e.getMessage());
return Collections.emptyList();
}
return eligibility.processStructuralVariants(patient, factory.results());
}
Aggregations