use of com.hartwig.hmftools.common.region.hmfslicer.HmfGenomeRegion in project hmftools by hartwigmedical.
the class GenePanelDataSource method fromHmfReporterData.
@NotNull
public static JRDataSource fromHmfReporterData(@NotNull final HmfReporterData reporterData) {
final DRDataSource genePanelDataSource = new DRDataSource(GENE_FIELD.getName(), TRANSCRIPT_FIELD.getName(), TYPE_FIELD.getName());
final List<HmfGenomeRegion> regions = Lists.newArrayList(reporterData.panelGeneModel().regions());
regions.sort(Comparator.comparing(HmfGenomeRegion::gene));
for (final HmfGenomeRegion region : regions) {
final String role = reporterData.cosmicGeneModel().getRoleForGene(region.gene());
genePanelDataSource.add(region.gene(), region.transcript(), role);
}
return genePanelDataSource;
}
use of com.hartwig.hmftools.common.region.hmfslicer.HmfGenomeRegion in project hmftools by hartwigmedical.
the class ConsequenceDeterminer method toVariantReport.
@NotNull
private List<VariantReport> toVariantReport(@NotNull final List<SomaticVariant> variants) {
final List<VariantReport> reports = Lists.newArrayList();
for (final SomaticVariant variant : variants) {
final ImmutableVariantReport.Builder builder = ImmutableVariantReport.builder();
final VariantAnnotation variantAnnotation = findPrimaryRelevantAnnotation(variant, relevantTranscriptMap.keySet());
// KODU: Variants with no relevant annotations should be filtered out by now.
assert variantAnnotation != null;
final HmfGenomeRegion hmfGenomeRegion = relevantTranscriptMap.get(variantAnnotation.featureID());
assert hmfGenomeRegion != null;
if (!variantAnnotation.gene().equals(hmfGenomeRegion.gene())) {
LOGGER.warn("Annotated gene does not match gene expected from slicing annotation for " + variant);
}
if (!variantAnnotation.allele().equals(variant.alt())) {
LOGGER.warn("Annotated allele does not match alt from variant for " + variant);
}
builder.variant(variant);
builder.gene(variantAnnotation.gene());
builder.transcript(hmfGenomeRegion.transcript());
builder.hgvsCoding(variantAnnotation.hgvsCoding());
builder.hgvsProtein(variantAnnotation.hgvsProtein());
builder.consequence(variantAnnotation.consequenceString());
final String cosmicID = variant.cosmicID();
if (cosmicID != null) {
builder.cosmicID(cosmicID);
}
builder.totalReadCount(variant.totalReadCount());
builder.alleleReadCount(variant.alleleReadCount());
reports.add(builder.build());
}
return reports;
}
use of com.hartwig.hmftools.common.region.hmfslicer.HmfGenomeRegion in project hmftools by hartwigmedical.
the class CanonicalTranscriptFactoryTest method testWASH7P.
@Test
public void testWASH7P() {
final HmfGenomeRegion region = select("WASH7P.tsv");
final CanonicalTranscript transcript = CanonicalTranscriptFactory.create(region);
assertTranscript(transcript, 12, 0, 1783, 0);
}
use of com.hartwig.hmftools.common.region.hmfslicer.HmfGenomeRegion in project hmftools by hartwigmedical.
the class CanonicalTranscriptFactoryTest method testKRAS.
@Test
public void testKRAS() {
final HmfGenomeRegion kras = select("KRAS.tsv");
final CanonicalTranscript transcript = CanonicalTranscriptFactory.create(kras);
assertTranscript(transcript, 6, 4, 1119, 189);
assertEquals(25368375, transcript.codingStart());
assertEquals(25398318, transcript.codingEnd());
}
use of com.hartwig.hmftools.common.region.hmfslicer.HmfGenomeRegion in project hmftools by hartwigmedical.
the class BachelorEligibility method processVCF.
@NotNull
Collection<EligibilityReport> processVCF(final String patient, final String sample, final EligibilityReport.ReportType type, final VCFFileReader reader) {
final List<EligibilityReport> results = Lists.newArrayList();
for (final HmfGenomeRegion region : variantLocationsToQuery) {
LOGGER.debug("chromosome({} start={} end={})", region.chromosome(), (int) region.geneStart(), (int) region.geneEnd());
final CloseableIterator<VariantContext> query = reader.query(region.chromosome(), (int) region.geneStart(), (int) region.geneEnd());
while (query.hasNext()) {
final VariantContext variant = query.next();
LOGGER.debug("variant({}) patient({}) sample({})", variant, patient, sample);
results.addAll(processVariant(variant, patient, sample, type));
}
query.close();
}
return results;
}
Aggregations