Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 9461 mutations api endpoint final #9914

Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -116,7 +115,7 @@ private static Set<CosmicMutationFrequency> filterTruncatingCosmicByPosition(

Set<CosmicMutationFrequency> ret = new HashSet<CosmicMutationFrequency>();
Pattern p = Pattern.compile("[0-9]+");
int mutPos = mut.getOncotatorProteinPosStart();
int mutPos = mut.getMutationProteinPosStart();
for (CosmicMutationFrequency cmf : cmfs) {
String aa = cmf.getAminoAcidChange();
Matcher m = p.matcher(aa);
Expand Down
40 changes: 13 additions & 27 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,23 +145,16 @@ 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(),
Integer.toString(event.getOncotatorProteinPosStart()),
Integer.toString(event.getOncotatorProteinPosEnd()),
event.getMutationRefseqMrnaId(),
event.getMutationCodonChange(),
event.getMutationUniprotAccession(),
Integer.toString(event.getMutationProteinPosStart()),
Integer.toString(event.getMutationProteinPosEnd()),
boolToStr(event.isCanonicalTranscript()),
keyword==null ? "\\N":(event.getGene().getHugoGeneSymbolAllCaps()+" "+keyword));
return 1;
Expand Down Expand Up @@ -800,24 +793,17 @@ 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"));
event.setOncotatorProteinPosStart(rs.getInt("ONCOTATOR_PROTEIN_POS_START"));
event.setOncotatorProteinPosEnd(rs.getInt("ONCOTATOR_PROTEIN_POS_END"));
event.setMutationRefseqMrnaId(rs.getString("MUTATION_REFSEQ_MRNA_ID"));
event.setMutationCodonChange(rs.getString("MUTATION_CODON_CHANGE"));
event.setMutationUniprotAccession(rs.getString("MUTATION_UNIPROT_ACCESSION"));
event.setMutationProteinPosStart(rs.getInt("MUTATION_PROTEIN_POS_START"));
event.setMutationProteinPosEnd(rs.getInt("MUTATION_PROTEIN_POS_END"));
event.setCanonicalTranscript(rs.getBoolean("CANONICAL_TRANSCRIPT"));
event.setTumorSeqAllele(rs.getString("TUMOR_SEQ_ALLELE"));
event.setKeyword(rs.getString("KEYWORD"));
Expand Down Expand Up @@ -1391,12 +1377,12 @@ public static Collection<Map<String, Object>> countSamplesWithProteinPosStarts(
if (geneIdSet.size() == 0 || internalProfileIds.size() == 0) return new ArrayList<Map<String, Object>>(); //empty IN() clause would be a SQL error below
try {
con = JdbcUtil.getDbConnection(DaoMutation.class);
String sql = "SELECT ONCOTATOR_PROTEIN_POS_START, GENETIC_PROFILE_ID, mutation.ENTREZ_GENE_ID, count(DISTINCT SAMPLE_ID) " +
String sql = "SELECT MUTATION_PROTEIN_POS_START, GENETIC_PROFILE_ID, mutation.ENTREZ_GENE_ID, count(DISTINCT SAMPLE_ID) " +
"FROM mutation INNER JOIN mutation_event ON mutation.MUTATION_EVENT_ID=mutation_event.MUTATION_EVENT_ID " +
"WHERE mutation.ENTREZ_GENE_ID IN (" + StringUtils.join(geneIdSet, ",") + ") " +
"AND GENETIC_PROFILE_ID IN (" + StringUtils.join(internalProfileIds, ",") + ") " +
"AND (mutation.ENTREZ_GENE_ID, ONCOTATOR_PROTEIN_POS_START) IN (" + StringUtils.join(proteinPosStarts, ",") + ") " +
"GROUP BY ONCOTATOR_PROTEIN_POS_START, GENETIC_PROFILE_ID, mutation.ENTREZ_GENE_ID";
"AND (mutation.ENTREZ_GENE_ID, MUTATION_PROTEIN_POS_START) IN (" + StringUtils.join(proteinPosStarts, ",") + ") " +
"GROUP BY MUTATION_PROTEIN_POS_START, GENETIC_PROFILE_ID, mutation.ENTREZ_GENE_ID";
pstmt = con.prepareStatement(sql);
rs = pstmt.executeQuery();
Collection<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
Expand Down
Loading