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;
}
Aggregations