use of uk.ac.ebi.spot.goci.curation.model.SnpFormColumn in project goci by EBISPOT.
the class AssociationController method addCol.
// Add single column to table
@RequestMapping(value = "/studies/{studyId}/associations/add_interaction", params = { "addCol" })
public String addCol(SnpAssociationInteractionForm snpAssociationInteractionForm, Model model, @PathVariable Long studyId, @RequestParam(required = true) String measurementType) {
snpAssociationInteractionForm.getSnpFormColumns().add(new SnpFormColumn());
// Pass back required attributes
model.addAttribute("form", snpAssociationInteractionForm);
model.addAttribute("measurementType", measurementType);
model.addAttribute("study", studyRepository.findOne(studyId));
return "add_snp_interaction_association";
}
use of uk.ac.ebi.spot.goci.curation.model.SnpFormColumn in project goci by EBISPOT.
the class SnpInteractionAssociationServiceTest method testCreateInteractionForm.
@Test
public void testCreateInteractionForm() throws Exception {
assertThat(snpAssociationFormService.createForm(OR_INTERACTION_ASSOCIATION)).isInstanceOf(SnpAssociationInteractionForm.class);
SnpAssociationInteractionForm form = (SnpAssociationInteractionForm) snpAssociationFormService.createForm(OR_INTERACTION_ASSOCIATION);
// Check values we would expect in form
assertThat(form.getAssociationId()).as("Check form ID").isEqualTo(OR_INTERACTION_ASSOCIATION.getId());
assertThat(form.getSnpType()).as("Check form SNP TYPE").isEqualTo(OR_INTERACTION_ASSOCIATION.getSnpType());
assertThat(form.getSnpApproved()).as("Check form SNP APPROVED").isEqualTo(OR_INTERACTION_ASSOCIATION.getSnpApproved());
assertThat(form.getPvalueExponent()).as("Check form PVALUE EXPONENT").isEqualTo(OR_INTERACTION_ASSOCIATION.getPvalueExponent());
assertThat(form.getPvalueMantissa()).as("Check form PVALUE MANTISSA").isEqualTo(OR_INTERACTION_ASSOCIATION.getPvalueMantissa());
assertThat(form.getStandardError()).as("Check form STANDARD ERROR").isEqualTo(OR_INTERACTION_ASSOCIATION.getStandardError());
assertThat(form.getRange()).as("Check form RANGE").isEqualTo(OR_INTERACTION_ASSOCIATION.getRange());
assertThat(form.getPvalueDescription()).as("Check form PVALUE DESCRIPTION").isEqualTo(OR_INTERACTION_ASSOCIATION.getPvalueDescription());
assertThat(form.getRiskFrequency()).as("Check form RISK FREQUENCY").isEqualTo(OR_INTERACTION_ASSOCIATION.getRiskFrequency());
assertThat(form.getDescription()).as("Check form DESCRIPTION").isEqualTo(OR_INTERACTION_ASSOCIATION.getDescription());
// Check EFO traits
assertThat(form.getEfoTraits()).extracting("id", "trait", "uri").contains(tuple(1001L, "atrophic rhinitis", "http://www.ebi.ac.uk/efo/EFO_0007159"), tuple(1002L, "HeLa", "http://www.ebi.ac.uk/efo/EFO_0001185"));
// Check null values
assertNull(form.getBetaNum());
assertNull(form.getBetaUnit());
assertNull(form.getBetaDirection());
// Test locus attributes
assertThat(form.getNumOfInteractions()).as("Check form NUMBER OF INTERACTIONS").isEqualTo(2);
// Test the column values
Collection<SnpFormColumn> columns = form.getSnpFormColumns();
assertThat(columns).hasSize(2);
assertThat(columns).extracting("snp", "strongestRiskAllele", "riskFrequency", "authorReportedGenes", "proxySnps", "genomeWide", "limitedList").contains(tuple("rs9788721", "rs9788721-?", "0.6", Collections.singletonList("WBP4"), Collections.emptyList(), true, false), tuple("rs8042374", "rs8042374-?", "0.4", Collections.singletonList("SLC25A15"), Collections.emptyList(), true, false));
}
Aggregations