Skip to content

Commit

Permalink
fix 9461 - mutations api endpoint
Browse files Browse the repository at this point in the history
fix cBioPortal#9461 - mutations api endpoint - modified java files to remove unused properties and changes to tests
  • Loading branch information
jagnathan committed May 26, 2022
1 parent 8092871 commit e4d1a98
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 328 deletions.
12 changes: 0 additions & 12 deletions core/src/main/java/org/mskcc/cbio/portal/dao/DaoMutation.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,12 @@ public static int addMutationEvent(ExtendedMutation.MutationEvent event) throws
event.getTumorSeqAllele(),
event.getProteinChange(),
event.getMutationType(),
event.getFunctionalImpactScore(),
Float.toString(event.getFisValue()),
event.getLinkXVar(),
event.getLinkPdb(),
event.getLinkMsa(),
event.getNcbiBuild(),
event.getStrand(),
event.getVariantType(),
event.getDbSnpRs(),
event.getDbSnpValStatus(),
event.getOncotatorDbSnpRs(),
event.getOncotatorRefseqMrnaId(),
event.getOncotatorCodonChange(),
event.getOncotatorUniprotName(),
event.getOncotatorUniprotAccession(),
Expand Down Expand Up @@ -802,19 +796,13 @@ private static ExtendedMutation.MutationEvent extractMutationEvent(ResultSet rs)
event.setEndPosition(rs.getLong("END_POSITION"));
event.setProteinChange(rs.getString("PROTEIN_CHANGE"));
event.setMutationType(rs.getString("MUTATION_TYPE"));
event.setFunctionalImpactScore(rs.getString("FUNCTIONAL_IMPACT_SCORE"));
event.setFisValue(rs.getFloat("FIS_VALUE"));
event.setLinkXVar(rs.getString("LINK_XVAR"));
event.setLinkPdb(rs.getString("LINK_PDB"));
event.setLinkMsa(rs.getString("LINK_MSA"));
event.setNcbiBuild(rs.getString("NCBI_BUILD"));
event.setStrand(rs.getString("STRAND"));
event.setVariantType(rs.getString("VARIANT_TYPE"));
event.setDbSnpRs(rs.getString("DB_SNP_RS"));
event.setDbSnpValStatus(rs.getString("DB_SNP_VAL_STATUS"));
event.setReferenceAllele(rs.getString("REFERENCE_ALLELE"));
event.setOncotatorDbSnpRs(rs.getString("ONCOTATOR_DBSNP_RS"));
event.setOncotatorRefseqMrnaId(rs.getString("ONCOTATOR_REFSEQ_MRNA_ID"));
event.setOncotatorCodonChange(rs.getString("ONCOTATOR_CODON_CHANGE"));
event.setOncotatorUniprotName(rs.getString("ONCOTATOR_UNIPROT_ENTRY_NAME"));
event.setOncotatorUniprotAccession(rs.getString("ONCOTATOR_UNIPROT_ACCESSION"));
Expand Down
107 changes: 2 additions & 105 deletions core/src/main/java/org/mskcc/cbio/portal/model/ExtendedMutation.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@ public final static class MutationEvent {
private long endPosition;
private String proteinChange; // amino acid change
private String mutationType; // variant classification
private String functionalImpactScore;
private float fisValue;
private String linkXVar;
private String linkPdb;
private String linkMsa;
private String keyword;
private String keyword;
private String ncbiBuild;
private String strand;
private String variantType;
Expand Down Expand Up @@ -132,46 +127,6 @@ public void setMutationType(String mutationType) {
this.mutationType = mutationType;
}

public String getFunctionalImpactScore() {
return functionalImpactScore;
}

public void setFunctionalImpactScore(String functionalImpactScore) {
this.functionalImpactScore = functionalImpactScore;
}

public float getFisValue() {
return fisValue;
}

public void setFisValue(float fisValue) {
this.fisValue = fisValue;
}

public String getLinkXVar() {
return linkXVar;
}

public void setLinkXVar(String linkXVar) {
this.linkXVar = linkXVar;
}

public String getLinkPdb() {
return linkPdb;
}

public void setLinkPdb(String linkPdb) {
this.linkPdb = linkPdb;
}

public String getLinkMsa() {
return linkMsa;
}

public void setLinkMsa(String linkMsa) {
this.linkMsa = linkMsa;
}

public String getKeyword() {
return keyword;
}
Expand Down Expand Up @@ -244,14 +199,6 @@ public void setOncotatorDbSnpRs(String oncotatorDbSnpRs) {
this.oncotatorDbSnpRs = oncotatorDbSnpRs;
}

public String getOncotatorRefseqMrnaId() {
return oncotatorRefseqMrnaId;
}

public void setOncotatorRefseqMrnaId(String oncotatorRefseqMrnaId) {
this.oncotatorRefseqMrnaId = oncotatorRefseqMrnaId;
}

public String getOncotatorUniprotName() {
return oncotatorUniprotName;
}
Expand Down Expand Up @@ -543,47 +490,7 @@ public void setAminoAcidChange(String aminoAcidChange)
{
this.aminoAcidChange = aminoAcidChange;
}

public String getFunctionalImpactScore() {
return event.getFunctionalImpactScore();
}

public void setFunctionalImpactScore(String fImpact) {
event.setFunctionalImpactScore(fImpact);
}

public float getFisValue() {
return event.getFisValue();
}

public void setFisValue(Float fisValue) {
event.setFisValue(fisValue);
}

public String getLinkXVar() {
return event.getLinkXVar();
}

public void setLinkXVar(String linkXVar) {
event.setLinkXVar(linkXVar);
}

public String getLinkPdb() {
return event.getLinkPdb();
}

public void setLinkPdb(String linkPdb) {
event.setLinkPdb(linkPdb);
}

public String getLinkMsa() {
return event.getLinkMsa();
}

public void setLinkMsa(String linkMsa) {
event.setLinkMsa(linkMsa);
}


public String getSequencer() {
return sequencer;
}
Expand Down Expand Up @@ -828,16 +735,6 @@ public void setOncotatorDbSnpRs(String oncotatorDbSnpRs) {
event.setOncotatorDbSnpRs(oncotatorDbSnpRs);
}

public String getOncotatorRefseqMrnaId()
{
return event.getOncotatorRefseqMrnaId();
}

public void setOncotatorRefseqMrnaId(String oncotatorRefseqMrnaId)
{
event.setOncotatorRefseqMrnaId(oncotatorRefseqMrnaId);
}

public String getOncotatorUniprotName()
{
return event.getOncotatorUniprotName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,36 +206,10 @@ public void importData() throws IOException, DaoException {
if (record.getEndPosition() < 0)
record.setEndPosition(0);

String functionalImpactScore = "";
// using -1 is not safe, FIS can be a negative value
Float fisValue = Float.MIN_VALUE;
String linkXVar = "";
String linkMsa = "";
String linkPdb = "";

if (fileHasOMAData)
{
// functionalImpactScore = getField(parts, "MA:FImpact" );
// fisValue = getField(parts, "MA:FIS");
// linkXVar = getField(parts, "MA:link.var" );
// linkMsa = getField(parts, "MA:link.MSA" );
// linkPdb = getField(parts, "MA:link.PDB" );

functionalImpactScore = record.getMaFuncImpact();
fisValue = record.getMaFIS();
linkXVar = record.getMaLinkVar();
linkMsa = record.getMaLinkMsa();
linkPdb = record.getMaLinkPdb();

functionalImpactScore = transformOMAScore(functionalImpactScore);
linkXVar = linkXVar.replace("\"", "");
}

String mutationType,
proteinChange,
aaChange,
codonChange,
refseqMrnaId,
uniprotAccession;

int proteinPosStart,
Expand Down Expand Up @@ -266,7 +240,6 @@ public void importData() throws IOException, DaoException {
//proteinChange = record.getProteinChange();
aaChange = record.getAminoAcidChange();
codonChange = record.getCodons();
refseqMrnaId = record.getRefSeq();
//always uniprot accession
uniprotAccession = record.getSwissprot();

Expand Down Expand Up @@ -361,11 +334,6 @@ public void importData() throws IOException, DaoException {
mutation.setEndPosition(record.getEndPosition());
mutation.setValidationStatus(record.getValidationStatus());
mutation.setMutationStatus(record.getMutationStatus());
mutation.setFunctionalImpactScore(functionalImpactScore);
mutation.setFisValue(fisValue);
mutation.setLinkXVar(linkXVar);
mutation.setLinkPdb(linkPdb);
mutation.setLinkMsa(linkMsa);
mutation.setNcbiBuild(record.getNcbiBuild());
mutation.setStrand(record.getStrand());
mutation.setVariantType(record.getVariantType());
Expand Down Expand Up @@ -399,7 +367,6 @@ public void importData() throws IOException, DaoException {

// TODO rename the oncotator column names (remove "oncotator")
mutation.setOncotatorCodonChange(codonChange);
mutation.setOncotatorRefseqMrnaId(refseqMrnaId);
mutation.setOncotatorUniprotAccession(uniprotAccession);
mutation.setOncotatorProteinPosStart(proteinPosStart);
mutation.setOncotatorProteinPosEnd(proteinPosEnd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,6 @@ public static ExtendedMutation newMutation() {
mutation.setEndPosition(defaultLong);
mutation.setValidationStatus(defaultStr);
mutation.setMutationStatus(defaultStr);
mutation.setFunctionalImpactScore(defaultStr);
mutation.setFisValue(defaultFloat);
mutation.setLinkXVar(defaultStr);
mutation.setLinkPdb(defaultStr);
mutation.setLinkMsa(defaultStr);
mutation.setNcbiBuild(defaultStr);
mutation.setStrand(defaultStr);
mutation.setVariantType(defaultStr);
Expand All @@ -328,7 +323,6 @@ public static ExtendedMutation newMutation() {
mutation.setNormalRefCount(defaultInt);
mutation.setOncotatorDbSnpRs(defaultStr);
mutation.setOncotatorCodonChange(defaultStr);
mutation.setOncotatorRefseqMrnaId(defaultStr);
mutation.setOncotatorUniprotName(defaultStr);
mutation.setOncotatorUniprotAccession(defaultStr);
mutation.setOncotatorProteinPosStart(defaultInt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,6 @@ public static String getProfileData(String geneticProfileId,
buf.append(mutation.getMutationType()).append(TAB);
buf.append(mutation.getValidationStatus()).append(TAB);
buf.append(mutation.getProteinChange()).append(TAB);
buf.append(mutation.getFunctionalImpactScore()).append(TAB);
buf.append(mutation.getLinkXVar()).append(TAB);
buf.append(mutation.getLinkPdb()).append(TAB);
buf.append(mutation.getLinkMsa()).append(TAB);
buf.append(mutation.getChr()).append(TAB);
buf.append(mutation.getStartPosition()).append(TAB);
buf.append(mutation.getEndPosition()).append(TAB);
Expand Down
12 changes: 0 additions & 12 deletions core/src/test/java/org/mskcc/cbio/portal/dao/TestDaoMutation.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ private void runTheTest() throws DaoException{
mutation.setSequencingCenter("Broad");
mutation.setSequencer("SOLiD");
mutation.setProteinChange("BRCA1_123");
mutation.setFunctionalImpactScore("H");
mutation.setFisValue(Float.MIN_VALUE);
mutation.setLinkXVar("link1");
mutation.setLinkPdb("link2");
mutation.setLinkMsa("link3");
mutation.setNcbiBuild("37/hg19");
mutation.setStrand("+");
mutation.setVariantType("Consolidated");
Expand Down Expand Up @@ -134,7 +129,6 @@ private void runTheTest() throws DaoException{
mutation.setNormalRefCount(18);
mutation.setOncotatorDbSnpRs("rs149680468");
mutation.setOncotatorCodonChange("c.(133-135)TCT>TTT");
mutation.setOncotatorRefseqMrnaId("NM_001904");
mutation.setOncotatorUniprotName("CTNB1_HUMAN");
mutation.setOncotatorUniprotAccession("P35222");
mutation.setOncotatorProteinPosStart(666);
Expand Down Expand Up @@ -174,11 +168,6 @@ private void validateMutation(ExtendedMutation mutation) {
assertEquals("Broad", mutation.getSequencingCenter());
assertEquals("SOLiD", mutation.getSequencer());
assertEquals("BRCA1_123", mutation.getProteinChange());
assertEquals("H", mutation.getFunctionalImpactScore());
assertEquals(Float.MIN_VALUE, mutation.getFisValue(), 1E-30);
assertEquals("link1", mutation.getLinkXVar());
assertEquals("link2", mutation.getLinkPdb());
assertEquals("link3", mutation.getLinkMsa());
assertEquals("37/hg19", mutation.getNcbiBuild());
assertEquals("+", mutation.getStrand());
assertEquals("Consolidated", mutation.getVariantType());
Expand Down Expand Up @@ -206,7 +195,6 @@ private void validateMutation(ExtendedMutation mutation) {
assertEquals(Integer.valueOf(18), mutation.getNormalRefCount());
assertEquals("rs149680468", mutation.getOncotatorDbSnpRs());
assertEquals("c.(133-135)TCT>TTT", mutation.getOncotatorCodonChange());
assertEquals("NM_001904", mutation.getOncotatorRefseqMrnaId());
assertEquals("CTNB1_HUMAN", mutation.getOncotatorUniprotName());
assertEquals("P35222", mutation.getOncotatorUniprotAccession());
assertEquals(666, mutation.getOncotatorProteinPosStart());
Expand Down
54 changes: 0 additions & 54 deletions model/src/main/java/org/cbioportal/model/Mutation.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ public class Mutation extends Alteration implements Serializable {
private String tumorSeqAllele;
private String proteinChange;
private String mutationType;
private String functionalImpactScore;
private BigDecimal fisValue;
private String linkXvar;
private String linkPdb;
private String linkMsa;
private String ncbiBuild;
private String variantType;
private String oncotatorRefseqMrnaId;
private Integer oncotatorProteinPosStart;
private Integer oncotatorProteinPosEnd;
private String keyword;
Expand Down Expand Up @@ -155,46 +149,6 @@ public void setMutationType(String mutationType) {
this.mutationType = mutationType;
}

public String getFunctionalImpactScore() {
return functionalImpactScore;
}

public void setFunctionalImpactScore(String functionalImpactScore) {
this.functionalImpactScore = functionalImpactScore;
}

public BigDecimal getFisValue() {
return fisValue;
}

public void setFisValue(BigDecimal fisValue) {
this.fisValue = fisValue;
}

public String getLinkXvar() {
return linkXvar;
}

public void setLinkXvar(String linkXvar) {
this.linkXvar = linkXvar;
}

public String getLinkPdb() {
return linkPdb;
}

public void setLinkPdb(String linkPdb) {
this.linkPdb = linkPdb;
}

public String getLinkMsa() {
return linkMsa;
}

public void setLinkMsa(String linkMsa) {
this.linkMsa = linkMsa;
}

public String getNcbiBuild() {
return ncbiBuild;
}
Expand All @@ -211,14 +165,6 @@ public void setVariantType(String variantType) {
this.variantType = variantType;
}

public String getOncotatorRefseqMrnaId() {
return oncotatorRefseqMrnaId;
}

public void setOncotatorRefseqMrnaId(String oncotatorRefseqMrnaId) {
this.oncotatorRefseqMrnaId = oncotatorRefseqMrnaId;
}

public Integer getOncotatorProteinPosStart() {
return oncotatorProteinPosStart;
}
Expand Down
Loading

0 comments on commit e4d1a98

Please sign in to comment.