Search in sources :

Example 6 with SnpFormColumn

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";
}
Also used : SnpFormColumn(uk.ac.ebi.spot.goci.curation.model.SnpFormColumn) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 7 with SnpFormColumn

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));
}
Also used : SnpAssociationInteractionForm(uk.ac.ebi.spot.goci.curation.model.SnpAssociationInteractionForm) SnpFormColumn(uk.ac.ebi.spot.goci.curation.model.SnpFormColumn) Test(org.junit.Test)

Aggregations

SnpFormColumn (uk.ac.ebi.spot.goci.curation.model.SnpFormColumn)7 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 ArrayList (java.util.ArrayList)2 SnpAssociationInteractionForm (uk.ac.ebi.spot.goci.curation.model.SnpAssociationInteractionForm)2 Gene (uk.ac.ebi.spot.goci.model.Gene)2 Locus (uk.ac.ebi.spot.goci.model.Locus)2 RiskAllele (uk.ac.ebi.spot.goci.model.RiskAllele)2 SingleNucleotidePolymorphism (uk.ac.ebi.spot.goci.model.SingleNucleotidePolymorphism)2 Test (org.junit.Test)1 LastViewedAssociation (uk.ac.ebi.spot.goci.curation.model.LastViewedAssociation)1 MappingDetails (uk.ac.ebi.spot.goci.curation.model.MappingDetails)1 SnpMappingForm (uk.ac.ebi.spot.goci.curation.model.SnpMappingForm)1 Association (uk.ac.ebi.spot.goci.model.Association)1 GenomicContext (uk.ac.ebi.spot.goci.model.GenomicContext)1 Location (uk.ac.ebi.spot.goci.model.Location)1