Search in sources :

Example 1 with FindingData

use of io.swagger.model.FindingData in project ImmunogeneticDataTools by nmdp-bioinformatics.

the class GenotypesApiController method populateSwaggerObject.

public SampleData populateSwaggerObject(Sample sample) {
    SampleData sampleData;
    sampleData = new SampleData();
    sampleData.setId(sample.getId());
    sampleData.setGlString(sample.getGlString());
    sampleData.setProcessedGlString(sample.getProcessedGlString());
    for (HaplotypePair pair : sample.getFindings().getLinkedPairs()) {
        HaplotypePairData pairData = new HaplotypePairData();
        pairData.setHaplotype1(pair.getHaplotypes().get(0).getHaplotypeString());
        pairData.setHaplotype2(pair.getHaplotypes().get(1).getHaplotypeString());
        for (RelativeFrequencyByRace freqByRace : pair.getFrequencies()) {
            FindingData finding = new FindingData();
            finding.setRace(freqByRace.getRace());
            finding.setFrequency(new BigDecimal(freqByRace.getFrequency()));
            finding.setRelativeFrequency(new BigDecimal(freqByRace.getRelativeFrequency()));
            finding.setHaplotype1Frequency(new BigDecimal(freqByRace.getHap1Frequency()));
            finding.setHaplotype2Frequency(new BigDecimal(freqByRace.getHap2Frequency()));
            pairData.addFindingItem(finding);
        }
        sampleData.addHaplotypePairItem(pairData);
    }
    return sampleData;
}
Also used : HaplotypePair(org.dash.valid.gl.haplo.HaplotypePair) RelativeFrequencyByRace(org.dash.valid.race.RelativeFrequencyByRace) SampleData(io.swagger.model.SampleData) FindingData(io.swagger.model.FindingData) HaplotypePairData(io.swagger.model.HaplotypePairData) BigDecimal(java.math.BigDecimal)

Aggregations

FindingData (io.swagger.model.FindingData)1 HaplotypePairData (io.swagger.model.HaplotypePairData)1 SampleData (io.swagger.model.SampleData)1 BigDecimal (java.math.BigDecimal)1 HaplotypePair (org.dash.valid.gl.haplo.HaplotypePair)1 RelativeFrequencyByRace (org.dash.valid.race.RelativeFrequencyByRace)1