Search in sources :

Example 1 with EnrichedStructuralVariantLeg

use of com.hartwig.hmftools.common.variant.structural.EnrichedStructuralVariantLeg in project hmftools by hartwigmedical.

the class StructuralVariantDAO method readEnrichedData.

@NotNull
List<EnrichedStructuralVariant> readEnrichedData(@NotNull final String sample) {
    final List<EnrichedStructuralVariant> regions = Lists.newArrayList();
    final Result<Record> result = context.select().from(STRUCTURALVARIANT).where(STRUCTURALVARIANT.SAMPLEID.eq(sample)).fetch();
    for (Record record : result) {
        final EnrichedStructuralVariantLeg start = ImmutableEnrichedStructuralVariantLeg.builder().chromosome(record.getValue(STRUCTURALVARIANT.STARTCHROMOSOME)).position(record.getValue(STRUCTURALVARIANT.STARTPOSITION)).orientation(record.getValue(STRUCTURALVARIANT.STARTORIENTATION)).homology(record.getValue(STRUCTURALVARIANT.STARTHOMOLOGYSEQUENCE)).alleleFrequency(record.getValue(STRUCTURALVARIANT.STARTAF)).adjustedAlleleFrequency(record.getValue(STRUCTURALVARIANT.ADJUSTEDSTARTAF)).adjustedCopyNumber(record.getValue(STRUCTURALVARIANT.ADJUSTEDSTARTCOPYNUMBER)).adjustedCopyNumberChange(record.getValue(STRUCTURALVARIANT.ADJUSTEDSTARTCOPYNUMBERCHANGE)).build();
        final EnrichedStructuralVariantLeg end = ImmutableEnrichedStructuralVariantLeg.builder().chromosome(record.getValue(STRUCTURALVARIANT.ENDCHROMOSOME)).position(record.getValue(STRUCTURALVARIANT.ENDPOSITION)).orientation(record.getValue(STRUCTURALVARIANT.ENDORIENTATION)).homology(record.getValue(STRUCTURALVARIANT.ENDHOMOLOGYSEQUENCE)).alleleFrequency(record.getValue(STRUCTURALVARIANT.ENDAF)).adjustedAlleleFrequency(record.getValue(STRUCTURALVARIANT.ADJUSTEDENDAF)).adjustedCopyNumber(record.getValue(STRUCTURALVARIANT.ADJUSTEDENDCOPYNUMBER)).adjustedCopyNumberChange(record.getValue(STRUCTURALVARIANT.ADJUSTEDENDCOPYNUMBERCHANGE)).build();
        final EnrichedStructuralVariant variant = ImmutableEnrichedStructuralVariant.builder().primaryKey(record.getValue(STRUCTURALVARIANT.ID)).id(record.getValue(STRUCTURALVARIANT.ID).toString()).start(start).end(end).insertSequence(record.getValue(STRUCTURALVARIANT.INSERTSEQUENCE)).type(StructuralVariantType.fromAttribute(record.getValue(STRUCTURALVARIANT.TYPE))).ploidy(record.getValue(STRUCTURALVARIANT.PLOIDY)).build();
        regions.add(variant);
    }
    return regions;
}
Also used : ImmutableEnrichedStructuralVariantLeg(com.hartwig.hmftools.common.variant.structural.ImmutableEnrichedStructuralVariantLeg) EnrichedStructuralVariantLeg(com.hartwig.hmftools.common.variant.structural.EnrichedStructuralVariantLeg) EnrichedStructuralVariant(com.hartwig.hmftools.common.variant.structural.EnrichedStructuralVariant) ImmutableEnrichedStructuralVariant(com.hartwig.hmftools.common.variant.structural.ImmutableEnrichedStructuralVariant) Record(org.jooq.Record) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

EnrichedStructuralVariant (com.hartwig.hmftools.common.variant.structural.EnrichedStructuralVariant)1 EnrichedStructuralVariantLeg (com.hartwig.hmftools.common.variant.structural.EnrichedStructuralVariantLeg)1 ImmutableEnrichedStructuralVariant (com.hartwig.hmftools.common.variant.structural.ImmutableEnrichedStructuralVariant)1 ImmutableEnrichedStructuralVariantLeg (com.hartwig.hmftools.common.variant.structural.ImmutableEnrichedStructuralVariantLeg)1 NotNull (org.jetbrains.annotations.NotNull)1 Record (org.jooq.Record)1