From dd10a1523b835127b37c7d9e63c75961f04649c9 Mon Sep 17 00:00:00 2001 From: Ino de Bruijn Date: Fri, 21 Jun 2019 17:20:58 -0400 Subject: [PATCH 1/4] Db migration: remove gene length This information is stored in Genome Nexus. We don't need it in cBioPortal anymore. Fix https://github.com/cBioPortal/cbioportal/issues/6308 --- .../persistence/GenePanelMapperLegacy.xml | 14 +- .../org/mskcc/cbio/portal/dao/DaoGene.java | 14 +- .../cbio/portal/model/CanonicalGene.java | 15 +- .../cbio/portal/scripts/ImportGeneData.java | 196 +------------ .../cbio/portal/servlet/MutationsJSON.java | 5 - .../portal/servlet/PfamSequenceServlet.java | 259 ------------------ .../portal/scripts/TestImportGeneData.java | 39 +-- core/src/test/resources/seed_mini.sql | 40 +-- db-scripts/src/main/resources/cgds.sql | 3 +- db-scripts/src/main/resources/migration.sql | 10 +- .../main/java/org/cbioportal/model/Gene.java | 9 - .../persistence/mybatis/GeneMapper.xml | 3 +- ...screteCopyNumberMyBatisRepositoryTest.java | 1 - .../mybatis/GeneMyBatisRepositoryTest.java | 6 - .../MutationMyBatisRepositoryTest.java | 1 - .../src/test/resources/testSql.sql | 46 ++-- pom.xml | 2 +- portal/src/main/webapp/WEB-INF/web.xml | 9 - .../web/DiscreteCopyNumberControllerTest.java | 6 - .../cbioportal/web/GeneControllerTest.java | 8 - .../web/MutationControllerTest.java | 6 - .../weblegacy/ApiControllerTest.java | 3 - .../GenePanelControllerLegacyTest.java | 2 - 23 files changed, 66 insertions(+), 631 deletions(-) delete mode 100644 core/src/main/java/org/mskcc/cbio/portal/servlet/PfamSequenceServlet.java diff --git a/business/src/main/resources/org/mskcc/cbio/portal/persistence/GenePanelMapperLegacy.xml b/business/src/main/resources/org/mskcc/cbio/portal/persistence/GenePanelMapperLegacy.xml index 1c9bf64f1ef..d324789e657 100644 --- a/business/src/main/resources/org/mskcc/cbio/portal/persistence/GenePanelMapperLegacy.xml +++ b/business/src/main/resources/org/mskcc/cbio/portal/persistence/GenePanelMapperLegacy.xml @@ -13,7 +13,6 @@ - @@ -71,7 +70,6 @@ - @@ -131,8 +129,7 @@ gene.ENTREZ_GENE_ID as entrezGeneId, gene.HUGO_GENE_SYMBOL as hugoGeneSymbol, gene.TYPE as type, - gene.CYTOBAND as cytoband, - gene.LENGTH as length + gene.CYTOBAND as cytoband from gene_panel left join gene_panel_list on gene_panel.INTERNAL_ID = gene_panel_list.INTERNAL_ID left join gene on gene_panel_list.GENE_ID = gene.ENTREZ_GENE_ID @@ -153,8 +150,7 @@ gene.ENTREZ_GENE_ID, gene.HUGO_GENE_SYMBOL, gene.TYPE, - gene.CYTOBAND, - gene.LENGTH + gene.CYTOBAND from gene gene.HUGO_GENE_SYMBOL = #{symbol} @@ -167,8 +163,7 @@ gene.ENTREZ_GENE_ID, gene.HUGO_GENE_SYMBOL, gene.TYPE, - gene.CYTOBAND, - gene.LENGTH + gene.CYTOBAND from gene gene.ENTREZ_GENE_ID = #{geneId} @@ -180,8 +175,7 @@ gene.ENTREZ_GENE_ID, gene.HUGO_GENE_SYMBOL, gene.TYPE, - gene.CYTOBAND, - gene.LENGTH + gene.CYTOBAND from gene_alias inner join gene on gene_alias.ENTREZ_GENE_ID = gene.ENTREZ_GENE_ID diff --git a/core/src/main/java/org/mskcc/cbio/portal/dao/DaoGene.java b/core/src/main/java/org/mskcc/cbio/portal/dao/DaoGene.java index a750b4b424f..06df00fed2f 100644 --- a/core/src/main/java/org/mskcc/cbio/portal/dao/DaoGene.java +++ b/core/src/main/java/org/mskcc/cbio/portal/dao/DaoGene.java @@ -91,12 +91,11 @@ public static int updateGene(CanonicalGene gene) throws DaoException { int rows = 0; con = JdbcUtil.getDbConnection(DaoGene.class); pstmt = con.prepareStatement - ("UPDATE gene SET `HUGO_GENE_SYMBOL`=?, `TYPE`=?,`CYTOBAND`=?,`LENGTH`=? WHERE `ENTREZ_GENE_ID`=?"); + ("UPDATE gene SET `HUGO_GENE_SYMBOL`=?, `TYPE`=?,`CYTOBAND`=? WHERE `ENTREZ_GENE_ID`=?"); pstmt.setString(1, gene.getHugoGeneSymbolAllCaps()); pstmt.setString(2, gene.getType()); pstmt.setString(3, gene.getCytoband()); - pstmt.setInt(4, gene.getLength()); - pstmt.setLong(5, gene.getEntrezGeneId()); + pstmt.setLong(4, gene.getEntrezGeneId()); rows += pstmt.executeUpdate(); if (rows != 1) { ProgressMonitor.logWarning("No change for " + gene.getEntrezGeneId() + " " + gene.getHugoGeneSymbolAllCaps() + "? Code " + rows); @@ -144,14 +143,13 @@ public static int addOrUpdateGene(CanonicalGene gene) throws DaoException { //add gene, referring to this genetic entity con = JdbcUtil.getDbConnection(DaoGene.class); pstmt = con.prepareStatement - ("INSERT INTO gene (`GENETIC_ENTITY_ID`, `ENTREZ_GENE_ID`,`HUGO_GENE_SYMBOL`,`TYPE`,`CYTOBAND`,`LENGTH`) " - + "VALUES (?,?,?,?,?,?)"); + ("INSERT INTO gene (`GENETIC_ENTITY_ID`, `ENTREZ_GENE_ID`,`HUGO_GENE_SYMBOL`,`TYPE`,`CYTOBAND`) " + + "VALUES (?,?,?,?,?)"); pstmt.setInt(1, geneticEntityId); pstmt.setLong(2, gene.getEntrezGeneId()); pstmt.setString(3, gene.getHugoGeneSymbolAllCaps()); pstmt.setString(4, gene.getType()); pstmt.setString(5, gene.getCytoband()); - pstmt.setInt(6, gene.getLength()); rows += pstmt.executeUpdate(); } else { @@ -329,7 +327,6 @@ public static ArrayList getAllGenes() throws DaoException { CanonicalGene gene = new CanonicalGene(geneticEntityId, entrezGeneId, rs.getString("HUGO_GENE_SYMBOL"), aliases); gene.setCytoband(rs.getString("CYTOBAND")); - gene.setLength(rs.getInt("LENGTH")); gene.setType(rs.getString("TYPE")); geneList.add(gene); } @@ -378,7 +375,6 @@ private static CanonicalGene extractGene(ResultSet rs) throws SQLException, DaoE CanonicalGene gene = new CanonicalGene(geneticEntityId, entrezGeneId, rs.getString("HUGO_GENE_SYMBOL"), aliases); gene.setCytoband(rs.getString("CYTOBAND")); - gene.setLength(rs.getInt("LENGTH")); gene.setType(rs.getString("TYPE")); return gene; @@ -500,4 +496,4 @@ private static void deleteAllAliasRecords() throws DaoException { } } -} \ No newline at end of file +} diff --git a/core/src/main/java/org/mskcc/cbio/portal/model/CanonicalGene.java b/core/src/main/java/org/mskcc/cbio/portal/model/CanonicalGene.java index c1a50c313aa..ca908b28528 100644 --- a/core/src/main/java/org/mskcc/cbio/portal/model/CanonicalGene.java +++ b/core/src/main/java/org/mskcc/cbio/portal/model/CanonicalGene.java @@ -53,7 +53,6 @@ public class CanonicalGene extends Gene { private Set aliases; private double somaticMutationFrequency; private String cytoband; - private int length; private String type; /** @@ -121,18 +120,6 @@ public void setType(String type) { this.type = type; } - /** - * - * @return gene length; 0 if no available - */ - public int getLength() { - return length; - } - - public void setLength(int length) { - this.length = length; - } - public String getCytoband() { return cytoband; } @@ -236,4 +223,4 @@ public boolean isSangerGene() throws DaoException { public int hashCode() { return (int) entrezGeneId; } -} \ No newline at end of file +} diff --git a/core/src/main/java/org/mskcc/cbio/portal/scripts/ImportGeneData.java b/core/src/main/java/org/mskcc/cbio/portal/scripts/ImportGeneData.java index b684c90d820..8d3636caa39 100644 --- a/core/src/main/java/org/mskcc/cbio/portal/scripts/ImportGeneData.java +++ b/core/src/main/java/org/mskcc/cbio/portal/scripts/ImportGeneData.java @@ -257,187 +257,6 @@ private static void logDuplicateGeneSymbolWarning(String symbol, Set loci = new ArrayList(); - int nrGenesUpdated = 0; - - //Iterate over the file and fill the hash map with the max and min values of each gene (start and end position) - while ((line=buf.readLine()) != null) { - if(line.charAt(0) == '#'){ - continue; - } - parts = line.split("\t"); - currentChrom = parts[0]; - currentStart = Long.parseLong(parts[3]); - currentStop = Long.parseLong(parts[4]) + 1; // We have to add 1 here, because the last base is also included. - - if (parts[2].contains("exon") || parts[2].contains("CDS")) { - String info[] = parts[8].split(";"); - - //Retrieve the ensembl ID - for (String i : info) { - if (i.contains("gene_id")) { - String j[] = i.split(" "); - currentEnsembl = j[1].replaceAll("\"", ""); - } - else if (i.contains("gene_name")) { - String j[] = i.split(" "); - currentSymbol = j[2].replaceAll("\"", ""); - } - } - - /// Only in case of the first line - if (previousEnsembl.equals("")) { - previousEnsembl = currentEnsembl; - previousSymbol = currentSymbol; - previousChrom = currentChrom; - loci.add(new long[]{currentStart, currentStop}); //Add the new positions - } - /// For all other lines - else { - - /// If there is no switch from Ensembl ID - if (previousEnsembl.equals(currentEnsembl)) { - - loci.add(new long[]{currentStart, currentStop}); //Add the new positions - } - /// If there is a switch - else { - geneUpdated = updateLength(previousSymbol, previousChrom, loci); - if (geneUpdated) { - nrGenesUpdated++; - } - /// At the end of writing a new gene, clear the loci and save the new ensemblID. - loci.clear(); - - previousEnsembl = currentEnsembl; - previousSymbol = currentSymbol; - previousChrom = currentChrom; - loci.add(new long[]{currentStart, currentStop}); //Add the new positions - } - } - } - } - - /// Write the last gene - /// First check if the gene exists in the database - geneUpdated = updateLength(previousSymbol, previousChrom, loci); - if (geneUpdated) { - nrGenesUpdated++; - } - - ProgressMonitor.setCurrentMessage("Updated length info for " + nrGenesUpdated + " genes\n"); - - buf.close(); - } - - /** - * This method receives a symbol, a chromosome and a list of loci (should be from the same gene), and with that it retrieves the database gene and it calculates the length - * of all its exons contained in loci. If the symbol is non-ambiguous, or the chromosome reported does not match the cytoband of the database gene, then length is not updated. - * The method reports a boolean stating if the gene length has been updated or not. - * - * @param symbol - * @param chromosome - * @param loci - * @return - * @throws IOException - * @throws DaoException - */ - public static boolean updateLength(String symbol, String chromosome, List loci) throws IOException, DaoException { - DaoGeneOptimized daoGeneOptimized = DaoGeneOptimized.getInstance(); - boolean lengthUpdated = false; - /// Check if the gene is in the database - CanonicalGene gene = daoGeneOptimized.getNonAmbiguousGene(symbol, chromosome, false); //Identify unambiguously the gene (with the symbol and the chromosome) - - /// If it's not in the database, don't add it - if (!(gene==null)) { - /// Calc length - int length = calculateGeneLength(loci); - - /// Obtain cytoband - String cytoband = gene.getCytoband(); - - /// If there is no cytoband in the database, just write it (can also be an overwrite) - if (cytoband == null) { - gene.setLength(length); - daoGeneOptimized.updateGene(gene); - lengthUpdated = true; - } - - /// If there is a cytoband in database, check if cytoband-chr matches input-chr - else { - String cbChr = "chr"+cytoband.split("p|q")[0]; - if (cbChr.equals(chromosome)) { //Update the length only if the chromosome matches - gene.setLength(length); - daoGeneOptimized.updateGene(gene); - lengthUpdated = true; - } - else { - ProgressMonitor.logWarning("Cytoband does not match, gene not saved (likely another version of gene in gtf has correct chr and is saved)"); - } - } - } - return lengthUpdated; - } - - /** - * This method uses a list of exon loci from the same gene and it adds the length of all of them to get the gene length. If some of the exons are - * overlapping, the overlapping part is only counted once in the calculation. For example, if an exon goes from position 3 to 10 and another one from - * position 5 to 11, when calculating the length these exons would be considered as a single exon going from position 3 to 11. - * - * @param loci - * @return - */ - public static int calculateGeneLength(List loci) { - long min = Long.MAX_VALUE, max=-1; - for (long[] l : loci) { - if (l[0]max) { - max = l[1]; - } - } - if (max < min) { - throw new IllegalArgumentException("Found error: max=" + max + ", min=" + min); - } - BitSet bitSet = new BitSet((int)(max-min)); - for (long[] l : loci) { - bitSet.set((int)(l[0]-min), ((int)(l[1]-min))); - } - - return bitSet.cardinality(); - } - static void importSuppGeneData(File suppGeneFile) throws IOException, DaoException { MySQLbulkLoader.bulkLoadOff(); FileReader reader = new FileReader(suppGeneFile); @@ -456,9 +275,6 @@ static void importSuppGeneData(File suppGeneFile) throws IOException, DaoExcepti if (!parts[2].isEmpty()) { gene.setCytoband(parts[2]); } - if (!parts[3].isEmpty()) { - gene.setLength(Integer.parseInt(parts[3])); - } daoGene.addGene(gene); } } @@ -478,7 +294,6 @@ public void run() { parser.accepts( "genes", "ncbi genes file" ).withRequiredArg().describedAs( "ncbi_genes.txt" ).ofType( String.class ); parser.accepts( "supp-genes", "alternative genes file" ).withRequiredArg().describedAs( "supp-genes.txt" ).ofType( String.class ); parser.accepts( "microrna", "microrna file" ).withRequiredArg().describedAs( "microrna.txt" ).ofType( String.class ); - parser.accepts( "gtf", "gtf file for calculating and storing gene lengths" ).withRequiredArg().describedAs( "gencode..annotation.gtf" ).ofType( String.class ); String progName = "importGenes"; OptionSet options = null; @@ -526,15 +341,6 @@ public void run() { ProgressMonitor.setMaxValue(numLines); ImportMicroRNAIDs.importData(miRNAFile); } - - if(options.has("gtf")) { - File lociFile = new File((String) options.valueOf("gtf")); - System.out.println("Reading loci data from: " + lociFile.getAbsolutePath()); - numLines = FileUtil.getNumLines(lociFile); - System.out.println(" --> total number of lines: " + numLines); - ProgressMonitor.setMaxValue(numLines); - ImportGeneData.importGeneLength(lociFile); - } MySQLbulkLoader.flushAll(); System.err.println("Done. Restart tomcat to make sure the cache is replaced with the new data."); @@ -566,4 +372,4 @@ public static void main(String[] args) { runner.runInConsole(); } -} \ No newline at end of file +} diff --git a/core/src/main/java/org/mskcc/cbio/portal/servlet/MutationsJSON.java b/core/src/main/java/org/mskcc/cbio/portal/servlet/MutationsJSON.java index be820d25e14..72900a9de2d 100644 --- a/core/src/main/java/org/mskcc/cbio/portal/servlet/MutationsJSON.java +++ b/core/src/main/java/org/mskcc/cbio/portal/servlet/MutationsJSON.java @@ -228,11 +228,6 @@ private void processGetSmgRequest(HttpServletRequest request, String cytoband = gene.getCytoband(); map.put("cytoband", cytoband); - int length = gene.getLength(); - if (length>0) { - map.put("length", length); - } - Integer count = Integer.parseInt(entry.getValue().get("count")); map.put("num_muts", count); diff --git a/core/src/main/java/org/mskcc/cbio/portal/servlet/PfamSequenceServlet.java b/core/src/main/java/org/mskcc/cbio/portal/servlet/PfamSequenceServlet.java deleted file mode 100644 index c1338f69ef6..00000000000 --- a/core/src/main/java/org/mskcc/cbio/portal/servlet/PfamSequenceServlet.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) 2015 Memorial Sloan-Kettering Cancer Center. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.mskcc.cbio.portal.servlet; - -import org.biojava.nbio.core.sequence.compound.AminoAcidCompound; -import org.biojava.nbio.core.sequence.compound.AminoAcidCompoundSet; -import org.biojava.nbio.core.sequence.loader.UniprotProxySequenceReader; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.json.simple.JSONValue; -import org.mskcc.cbio.portal.dao.DaoException; -import org.mskcc.cbio.portal.dao.DaoGeneOptimized; -import org.mskcc.cbio.portal.dao.DaoPfamGraphics; -import org.mskcc.cbio.portal.model.CanonicalGene; -import org.mskcc.cbio.portal.mut_diagram.IdMappingService; -import org.mskcc.cbio.portal.mut_diagram.impl.CgdsIdMappingService; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.List; - -/** - * Servlet designed to return JSON object of pfam protein sequence features. - * This servlet does NOT query the actual pfam service, it uses an internal - * prebuilt cache. - * - * @author Selcuk Onur Sumer - */ -public class PfamSequenceServlet extends HttpServlet -{ - private IdMappingService idMappingService; - - public PfamSequenceServlet() - { - this.idMappingService = new CgdsIdMappingService( - DaoGeneOptimized.getInstance()); - } - - @Override - protected void doGet(final HttpServletRequest request, - final HttpServletResponse response) - throws ServletException, IOException - { - this.doPost(request, response); - } - - @Override - protected void doPost(final HttpServletRequest request, - final HttpServletResponse response) - throws ServletException, IOException - { - // TODO sanitize geneSymbol & uniprot id if necessary - String hugoGeneSymbol = request.getParameter("geneSymbol"); - String uniprotAcc = request.getParameter("uniprotAcc"); - - // final json string to return - String jsonString = this.getPfamGraphics(uniprotAcc); - - // TODO retrieve data for all uniprotAccs, instead of only one? - - // provided uniprotAcc doesn't work, try the gene symbol - if (hugoGeneSymbol != null && - jsonString == null) - { - uniprotAcc = getUniprotAcc(hugoGeneSymbol, response); - - if (uniprotAcc != null) - { - jsonString = this.getPfamGraphics(uniprotAcc); - } - } - - if (jsonString != null) - { - this.writeOutput(response, JSONValue.parse(jsonString)); - } - else { - // else: no PFAM data available for this gene/uniprotAcc, - // so try to create a dummy sequence data with only length info - JSONArray dummyData = this.generateDummyData(hugoGeneSymbol); - - // write dummy (or empty) output - if (dummyData != null) - { - this.writeOutput(response, dummyData); - } - else - { - // last resort: send empty data - should not occur...but can if gene length is empty - // TODO - throw exception instead? - this.writeOutput(response, JSONValue.parse("")); - } - } - } - - protected String getUniprotAcc(String hugoGeneSymbol, - HttpServletResponse response) throws IOException - { - String uniprotAcc = null; - - List uniProtAccs = - this.idMappingService.mapFromHugoToUniprotAccessions(hugoGeneSymbol); - - // if no uniprot mapping, then try to get only the sequence length - if (uniProtAccs.isEmpty()) - { - return null; - } - else - { - // TODO longest sequence is not always the desired one. - // (ex: BRCA1 returns E9PFC7_HUMAN instead of BRCA1_HUMAN) - - uniprotAcc = this.longestAcc(uniProtAccs); - } - - return uniprotAcc; - } - - protected String getPfamGraphics(String uniprotAcc) - { - String jsonString = null; - - if (uniprotAcc != null && - uniprotAcc.length() > 0) - { - DaoPfamGraphics dao = new DaoPfamGraphics(); - - try - { - jsonString = dao.getPfamGraphics(uniprotAcc); - } - catch (DaoException e) - { - e.printStackTrace(); - } - } - - return jsonString; - } - - /** - * Generate dummy pfam data with "length" attribute being the - * gene length/3. If gene length is not set, then this method returns null. - * - * @param hugoGeneSymbol : the gene symbol to look for (and get its length). - * - * @return returns null if gene length is not filled in DB record. - */ - protected JSONArray generateDummyData(String hugoGeneSymbol) - { - CanonicalGene gene = DaoGeneOptimized.getInstance().getGene(hugoGeneSymbol); - JSONArray data = new JSONArray(); - - if (gene != null && gene.getLength() > 0) - { - int length = gene.getLength() / 3; - - JSONObject dummy = new JSONObject(); - dummy.put("markups", new JSONArray()); - dummy.put("length", length); - dummy.put("regions", new JSONArray()); - dummy.put("motifs", new JSONArray()); - dummy.put("metadata", new JSONObject()); - - data.add(dummy); - return data; - } - else { - return null; - } - - } - - protected void writeOutput(HttpServletResponse response, - Object value) throws IOException - { - response.setContentType("application/json"); - PrintWriter out = response.getWriter(); - - try - { - JSONValue.writeJSONString(value, out); - } - finally - { - out.close(); - } - } - - /** - * Finds the uniprot accession, within the given list, - * corresponding to the longest uniprot sequence. - * - * @param uniProtAccs list of uniprot accessions - * @return uniprot accession corresponding to the longest sequence - */ - protected String longestAcc(List uniProtAccs) - { - String longest = ""; - int max = -1; - - if (uniProtAccs.size() == 1) { - return uniProtAccs.get(0); - } else { - try { - for (String accession : uniProtAccs) { - UniprotProxySequenceReader uniprotSequence - = new UniprotProxySequenceReader( - accession, - AminoAcidCompoundSet.getAminoAcidCompoundSet()); - - if (uniprotSequence.getLength() > max) { - max = uniprotSequence.getLength(); - longest = accession; - } - } - } catch (Exception e) { - e.printStackTrace(); - return null; - } - return longest; - } - } -} diff --git a/core/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java b/core/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java index 41bb900269c..df3f3fcca3e 100644 --- a/core/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java +++ b/core/src/test/java/org/mskcc/cbio/portal/scripts/TestImportGeneData.java @@ -80,41 +80,4 @@ public void testImportGeneData() throws Exception { gene = daoGene.getGene("ABCA3"); assertEquals(21, gene.getEntrezGeneId()); } - - @Test - /* - * Checks that ImportGeneLength works by calculating the length from three genes - * in gene-length_test.txt. The data contained in this file is real, except the transcript - * on line 5: the position has been changed for testing purposes. - * - * The test checks that the function calculates the correct gene length in this scenarios: - * ABCA4: two exons from the same chromosome which do not overlap. - * AACP: contains a transcript that must be skipped, and two overlapping exons. - * AARS: contains an exon in a different chromosome that must be skipped, the rest of exons do not overlap. - * AGER: calculates the gene length using a single exon. - * MED28P8: two exons from different chromosomes. - */ - public void testImportGeneLength() throws Exception { - DaoGeneOptimized daoGene = DaoGeneOptimized.getInstance(); - - //run import gene data (this test depends on it): - testImportGeneData(); - - File file = new File("src/test/resources/gene-length_test.txt"); - ImportGeneData.importGeneLength(file); - CanonicalGene gene = daoGene.getNonAmbiguousGene("ABCA4", "chr1", false); - assertEquals(372,gene.getLength()); - - gene = daoGene.getNonAmbiguousGene("AACP", "chr8", false); - assertEquals(16267,gene.getLength()); - - gene = daoGene.getNonAmbiguousGene("AARS", "chr16", false); - assertEquals(1163,gene.getLength()); - - gene = daoGene.getNonAmbiguousGene("AGER", "chr6", false); - assertEquals(1001,gene.getLength()); - - gene = daoGene.getNonAmbiguousGene("MED28P8", "chr4", false); - assertEquals(201,gene.getLength()); - } -} \ No newline at end of file +} diff --git a/core/src/test/resources/seed_mini.sql b/core/src/test/resources/seed_mini.sql index 6a46cd41822..3159386771c 100644 --- a/core/src/test/resources/seed_mini.sql +++ b/core/src/test/resources/seed_mini.sql @@ -102,65 +102,65 @@ VALUES (1,'study_tcga_pub','brca','Breast Invasive Carcinoma (TCGA, Nature 2012) -- gene as genetic_entity INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id, 207,'AKT1','protein-coding','14q32.32',10838); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id, 207,'AKT1','protein-coding','14q32.32'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,208,'AKT2','protein-coding','19q13.1-q13.2',15035); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,208,'AKT2','protein-coding','19q13.1-q13.2'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,10000,'AKT3','protein-coding','1q44',7499); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,10000,'AKT3','protein-coding','1q44'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,369,'ARAF','protein-coding','Xp11.4-p11.2',3204); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,369,'ARAF','protein-coding','Xp11.4-p11.2'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,472,'ATM','protein-coding','11q22-q23',22317); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,472,'ATM','protein-coding','11q22-q23'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,673,'BRAF','protein-coding','7q34',4564); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,673,'BRAF','protein-coding','7q34'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,672,'BRCA1','protein-coding','17q21',8426); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,672,'BRCA1','protein-coding','17q21'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,675,'BRCA2','protein-coding','13q12.3',11269); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,675,'BRCA2','protein-coding','13q12.3'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,3265,'HRAS','protein-coding','11p15.5',1854); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,3265,'HRAS','protein-coding','11p15.5'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,3845,'KRAS','protein-coding','12p12.1',7302); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,3845,'KRAS','protein-coding','12p12.1'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,4893,'NRAS','protein-coding','1p13.2',4449); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,4893,'NRAS','protein-coding','1p13.2'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,51259,'TMEM216','protein-coding','11q13.1',2364); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,51259,'TMEM216','protein-coding','11q13.1'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,282770,'OR10AG1','protein-coding','11q11',906); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,282770,'OR10AG1','protein-coding','11q11'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,983,'CDK1','protein-coding','10q21.1',3931); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,983,'CDK1','protein-coding','10q21.1'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,8085,'KMT2D','protein-coding','12q13.12',20476); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,8085,'KMT2D','protein-coding','12q13.12'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); -- add genes for structural variant events SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,57670,'KIAA1549','protein-coding','7q34',12427); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,57670,'KIAA1549','protein-coding','7q34'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,27436,'EML4','protein-coding','2p21',8357); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,27436,'EML4','protein-coding','2p21'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,238,'ALK','protein-coding','2p23.2-p23.1',6990); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,238,'ALK','protein-coding','2p23.2-p23.1'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,2115,'ETV1','protein-coding','7p21.2',9616); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,2115,'ETV1','protein-coding','7p21.2'); INSERT INTO "genetic_entity" ("ENTITY_TYPE") VALUES ('GENE'); SET @max_entity_id = (Select MAX(ID) from genetic_entity); -INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND","LENGTH") VALUES (@max_entity_id,7273,'TTN','protein-coding','2q31.2',118976); +INSERT INTO "gene" ("GENETIC_ENTITY_ID","ENTREZ_GENE_ID","HUGO_GENE_SYMBOL","TYPE","CYTOBAND") VALUES (@max_entity_id,7273,'TTN','protein-coding','2q31.2'); -- cna_event INSERT INTO "cna_event" ("CNA_EVENT_ID","ENTREZ_GENE_ID","ALTERATION") VALUES (20093,207,-2); diff --git a/db-scripts/src/main/resources/cgds.sql b/db-scripts/src/main/resources/cgds.sql index 48dc8bbd7f5..deda524ecd9 100644 --- a/db-scripts/src/main/resources/cgds.sql +++ b/db-scripts/src/main/resources/cgds.sql @@ -210,7 +210,6 @@ CREATE TABLE `gene` ( `GENETIC_ENTITY_ID` int(11) NOT NULL, `TYPE` varchar(50), `CYTOBAND` varchar(64), - `LENGTH` int(11), PRIMARY KEY (`ENTREZ_GENE_ID`), UNIQUE KEY `GENETIC_ENTITY_ID_UNIQUE` (`GENETIC_ENTITY_ID`), KEY `HUGO_GENE_SYMBOL` (`HUGO_GENE_SYMBOL`), @@ -847,4 +846,4 @@ CREATE TABLE `info` ( `GENESET_VERSION` varchar(24) ); -- THIS MUST BE KEPT IN SYNC WITH db.version PROPERTY IN pom.xml -INSERT INTO info VALUES ('2.9.2', NULL); +INSERT INTO info VALUES ('2.9.3', NULL); diff --git a/db-scripts/src/main/resources/migration.sql b/db-scripts/src/main/resources/migration.sql index 714ba2732a9..1464a1417c7 100644 --- a/db-scripts/src/main/resources/migration.sql +++ b/db-scripts/src/main/resources/migration.sql @@ -621,7 +621,7 @@ ALTER TABLE `genetic_profile` ADD COLUMN `SORT_ORDER` ENUM('ASC','DESC') DEFAULT UPDATE `info` SET `DB_SCHEMA_VERSION`="2.9.1"; -- ========================== end of treatment related tables ============================================= -###version: 2.9.2 +##version: 2.9.2 -- Previous structural_variant was never used, so recreate it DROP TABLE IF EXISTS structural_variant; CREATE TABLE `structural_variant` ( @@ -672,4 +672,10 @@ CREATE TABLE `structural_variant` ( FOREIGN KEY (`GENETIC_PROFILE_ID`) REFERENCES `genetic_profile` (`GENETIC_PROFILE_ID`) ON DELETE CASCADE ); -UPDATE `info` SET `DB_SCHEMA_VERSION`="2.9.2"; \ No newline at end of file +UPDATE `info` SET `DB_SCHEMA_VERSION`="2.9.2"; + +##version: 2.9.3 +-- remove gene length, this is stored in genome nexus +ALTER TABLE `gene` DROP COLUMN `length`; + +UPDATE `info` SET `DB_SCHEMA_VERSION`="2.9.3"; diff --git a/model/src/main/java/org/cbioportal/model/Gene.java b/model/src/main/java/org/cbioportal/model/Gene.java index f6e1c3ab906..2a589142071 100644 --- a/model/src/main/java/org/cbioportal/model/Gene.java +++ b/model/src/main/java/org/cbioportal/model/Gene.java @@ -11,7 +11,6 @@ public class Gene implements Serializable { private String hugoGeneSymbol; private String type; private String cytoband; - private Integer length; private String chromosome; public Integer getEntrezGeneId() { @@ -46,14 +45,6 @@ public void setCytoband(String cytoband) { this.cytoband = cytoband; } - public Integer getLength() { - return length; - } - - public void setLength(Integer length) { - this.length = length; - } - public String getChromosome() { return chromosome; } diff --git a/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/GeneMapper.xml b/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/GeneMapper.xml index ba4da9a16a9..84bcd124d58 100644 --- a/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/GeneMapper.xml +++ b/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/GeneMapper.xml @@ -10,8 +10,7 @@ , gene.TYPE AS "${prefix}type", - gene.CYTOBAND AS "${prefix}cytoband", - gene.LENGTH AS "${prefix}length" + gene.CYTOBAND AS "${prefix}cytoband" diff --git a/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMyBatisRepositoryTest.java b/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMyBatisRepositoryTest.java index 5938972af12..5b2005df8c9 100644 --- a/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMyBatisRepositoryTest.java +++ b/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMyBatisRepositoryTest.java @@ -74,7 +74,6 @@ public void getDiscreteCopyNumbersInMolecularProfileBySampleListIdDetailedProjec Assert.assertEquals("AKT1", gene.getHugoGeneSymbol()); Assert.assertEquals("protein-coding", gene.getType()); Assert.assertEquals("14q32.32", gene.getCytoband()); - Assert.assertEquals((Integer) 10838, gene.getLength()); } @Test diff --git a/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/GeneMyBatisRepositoryTest.java b/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/GeneMyBatisRepositoryTest.java index 6b7b6394709..e5c7b9e948f 100644 --- a/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/GeneMyBatisRepositoryTest.java +++ b/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/GeneMyBatisRepositoryTest.java @@ -75,7 +75,6 @@ public void getAllGenesSummaryProjection() throws Exception { Assert.assertEquals("AKT1", gene.getHugoGeneSymbol()); Assert.assertEquals("protein-coding", gene.getType()); Assert.assertEquals("14q32.32", gene.getCytoband()); - Assert.assertEquals((Integer) 10838, gene.getLength()); } @Test @@ -89,7 +88,6 @@ public void getAllGenesDetailedProjection() throws Exception { Assert.assertEquals("AKT1", gene.getHugoGeneSymbol()); Assert.assertEquals("protein-coding", gene.getType()); Assert.assertEquals("14q32.32", gene.getCytoband()); - Assert.assertEquals((Integer) 10838, gene.getLength()); } @Test @@ -141,7 +139,6 @@ public void getGeneByEntrezGeneId() throws Exception { Assert.assertEquals("AKT1", result.getHugoGeneSymbol()); Assert.assertEquals("protein-coding", result.getType()); Assert.assertEquals("14q32.32", result.getCytoband()); - Assert.assertEquals((Integer) 10838, result.getLength()); } @Test @@ -161,7 +158,6 @@ public void getGeneByHugoGeneSymbol() throws Exception { Assert.assertEquals("AKT1", result.getHugoGeneSymbol()); Assert.assertEquals("protein-coding", result.getType()); Assert.assertEquals("14q32.32", result.getCytoband()); - Assert.assertEquals((Integer) 10838, result.getLength()); } @Test @@ -215,7 +211,6 @@ public void fetchGenesByEntrezGeneIds() throws Exception { Assert.assertEquals("AKT1", gene.getHugoGeneSymbol()); Assert.assertEquals("protein-coding", gene.getType()); Assert.assertEquals("14q32.32", gene.getCytoband()); - Assert.assertEquals((Integer) 10838, gene.getLength()); } @Test @@ -233,7 +228,6 @@ public void fetchGenesByHugoGeneSymbols() throws Exception { Assert.assertEquals("AKT1", gene.getHugoGeneSymbol()); Assert.assertEquals("protein-coding", gene.getType()); Assert.assertEquals("14q32.32", gene.getCytoband()); - Assert.assertEquals((Integer) 10838, gene.getLength()); } @Test diff --git a/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepositoryTest.java b/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepositoryTest.java index a349a9ddce4..dfcde1dc5c5 100644 --- a/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepositoryTest.java +++ b/persistence/persistence-mybatis/src/test/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepositoryTest.java @@ -158,7 +158,6 @@ public void getMutationsInMolecularProfileBySampleListIdDetailedProjection() thr Assert.assertEquals("AKT1", gene.getHugoGeneSymbol()); Assert.assertEquals("protein-coding", gene.getType()); Assert.assertEquals("14q32.32", gene.getCytoband()); - Assert.assertEquals((Integer) 10838, gene.getLength()); } @Test diff --git a/persistence/persistence-mybatis/src/test/resources/testSql.sql b/persistence/persistence-mybatis/src/test/resources/testSql.sql index b30af93f37d..9d02a6db0ce 100644 --- a/persistence/persistence-mybatis/src/test/resources/testSql.sql +++ b/persistence/persistence-mybatis/src/test/resources/testSql.sql @@ -28,22 +28,22 @@ INSERT INTO genetic_entity (ID,ENTITY_TYPE) VALUES (18,'GENESET'); INSERT INTO genetic_entity (ID,ENTITY_TYPE) VALUES (19,'TREATMENT'); INSERT INTO genetic_entity (ID,ENTITY_TYPE) VALUES (20,'TREATMENT'); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (207,'AKT1',1,'protein-coding','14q32.32',10838); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (208,'AKT2',2,'protein-coding','19q13.1-q13.2',15035); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (10000,'AKT3',3,'protein-coding','1q44',7499); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (369,'ARAF',4,'protein-coding','Xp11.4-p11.2',3204); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (472,'ATM',5,'protein-coding','11q22-q23',22317); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (673,'BRAF',6,'protein-coding','7q34',4564); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (672,'BRCA1',7,'protein-coding','17q21',8426); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (675,'BRCA2',8,'protein-coding','13q12.3',11269); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (3265,'HRAS',9,'protein-coding','11p15.5',1854); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (3845,'KRAS',10,'protein-coding','12p12.1',7302); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (4893,'NRAS',11,'protein-coding','1p13.2',4449); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (79501,'OR4F5',12,'protein-coding','1p36.33',918); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (148398,'SAMD11',13,'protein-coding','1p36.33',3205); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (26155,'NOC2L',14,'protein-coding','1p36.33',5539); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (2064,'ERBB2',15,'protein-coding','17q12',10321); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES (2886,'GRB7',16,'protein-coding','17q12',3597); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (207,'AKT1',1,'protein-coding','14q32.32'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (208,'AKT2',2,'protein-coding','19q13.1-q13.2'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (10000,'AKT3',3,'protein-coding','1q44'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (369,'ARAF',4,'protein-coding','Xp11.4-p11.2'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (472,'ATM',5,'protein-coding','11q22-q23'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (673,'BRAF',6,'protein-coding','7q34'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (672,'BRCA1',7,'protein-coding','17q21'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (675,'BRCA2',8,'protein-coding','13q12.3'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (3265,'HRAS',9,'protein-coding','11p15.5'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (3845,'KRAS',10,'protein-coding','12p12.1'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (4893,'NRAS',11,'protein-coding','1p13.2'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (79501,'OR4F5',12,'protein-coding','1p36.33'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (148398,'SAMD11',13,'protein-coding','1p36.33'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (26155,'NOC2L',14,'protein-coding','1p36.33'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (2064,'ERBB2',15,'protein-coding','17q12'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES (2886,'GRB7',16,'protein-coding','17q12'); INSERT INTO cosmic_mutation (COSMIC_MUTATION_ID,PROTEIN_CHANGE,ENTREZ_GENE_ID,COUNT,KEYWORD) VALUES (3677745,'D45A',79501,1,'OR4F5 D45 missense'); INSERT INTO cosmic_mutation (COSMIC_MUTATION_ID,PROTEIN_CHANGE,ENTREZ_GENE_ID,COUNT,KEYWORD) VALUES (426644,'G145C',79501,1,'OR4F5 G145 missense'); @@ -371,13 +371,13 @@ INSERT INTO genetic_entity (ID,ENTITY_TYPE) VALUES(25,'GENE'); INSERT INTO genetic_entity (ID,ENTITY_TYPE) VALUES(26,'GENE'); INSERT INTO genetic_entity (ID,ENTITY_TYPE) VALUES(27,'GENE'); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES(57670,'KIAA1549',21,'protein-coding','7q34',12427); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES(8031,'NCOA4',22,'protein-coding','10q11.22',4079); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES(5979,'RET',23,'protein-coding','10q11.21',6911); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES(27436,'EML4',24,'protein-coding','2p21',8357); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES(238,'ALK',25,'protein-coding','2p23.2-p23.1',6990); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES(7113,'TMPRSS2',26,'protein-coding','21q22.3',6117); -INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND,LENGTH) VALUES(2078,'ERG',27,'protein-coding','21q22.2',7588); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES(57670,'KIAA1549',21,'protein-coding','7q34'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES(8031,'NCOA4',22,'protein-coding','10q11.22'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES(5979,'RET',23,'protein-coding','10q11.21'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES(27436,'EML4',24,'protein-coding','2p21'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES(238,'ALK',25,'protein-coding','2p23.2-p23.1'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES(7113,'TMPRSS2',26,'protein-coding','21q22.3'); +INSERT INTO gene (ENTREZ_GENE_ID,HUGO_GENE_SYMBOL,GENETIC_ENTITY_ID,TYPE,CYTOBAND) VALUES(2078,'ERG',27,'protein-coding','21q22.2'); INSERT INTO structural_variant (GENETIC_PROFILE_ID, SAMPLE_ID, SITE1_ENTREZ_GENE_ID, SITE1_ENSEMBL_TRANSCRIPT_ID, SITE1_EXON, SITE1_CHROMOSOME, SITE1_POSITION, SITE1_DESCRIPTION, SITE2_ENTREZ_GENE_ID, SITE2_ENSEMBL_TRANSCRIPT_ID, SITE2_EXON, SITE2_CHROMOSOME, SITE2_POSITION, SITE2_DESCRIPTION, NCBI_BUILD, DNA_SUPPORT, RNA_SUPPORT, TUMOR_READ_COUNT, TUMOR_VARIANT_COUNT, ANNOTATION, EVENT_INFO, COMMENTS, EXTERNAL_ANNOTATION) VALUES(7, 1, 57670, 'ENST00000242365', 15, '7', 138536968, 'KIAA1549-BRAF.K16B10.COSF509_1', 673, 'ENST00000288602', 10, '7' , 140482957, 'KIAA1549-BRAF.K16B10.COSF509_2', 'GRCh37', 'no', 'yes', 100000, 90000, 'KIAA1549-BRAF.K16B10.COSF509', 'Fusion', 'Gain-of-Function', 'COSMIC:COSF509'); diff --git a/pom.xml b/pom.xml index 39e5e859441..89f8be100be 100644 --- a/pom.xml +++ b/pom.xml @@ -303,7 +303,7 @@ 720 - 2.9.2 + 2.9.3 diff --git a/portal/src/main/webapp/WEB-INF/web.xml b/portal/src/main/webapp/WEB-INF/web.xml index 89a0d67c5f4..b6778dcd3f0 100755 --- a/portal/src/main/webapp/WEB-INF/web.xml +++ b/portal/src/main/webapp/WEB-INF/web.xml @@ -362,15 +362,6 @@ /omaRedirect.do - - pfam_sequence_json - org.mskcc.cbio.portal.servlet.PfamSequenceServlet - - - pfam_sequence_json - /getPfamSequence.json - - mutation_aligner_json org.mskcc.cbio.portal.servlet.MutationAlignerServlet diff --git a/web/src/test/java/org/cbioportal/web/DiscreteCopyNumberControllerTest.java b/web/src/test/java/org/cbioportal/web/DiscreteCopyNumberControllerTest.java index 6f0956533aa..e4c8ebab09e 100644 --- a/web/src/test/java/org/cbioportal/web/DiscreteCopyNumberControllerTest.java +++ b/web/src/test/java/org/cbioportal/web/DiscreteCopyNumberControllerTest.java @@ -139,7 +139,6 @@ public void getDiscreteCopyNumbersInMolecularProfileBySampleListIdDetailedProjec .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.hugoGeneSymbol").value(TEST_HUGO_GENE_SYMBOL_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.type").value(TEST_TYPE_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.cytoband").value(TEST_CYTOBAND_1)) - .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.length").value(TEST_LENGTH_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.chromosome").value(TEST_CHROMOSOME_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].molecularProfileId") .value(TEST_MOLECULAR_PROFILE_STABLE_ID_2)) @@ -150,7 +149,6 @@ public void getDiscreteCopyNumbersInMolecularProfileBySampleListIdDetailedProjec .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.hugoGeneSymbol").value(TEST_HUGO_GENE_SYMBOL_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.type").value(TEST_TYPE_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.cytoband").value(TEST_CYTOBAND_2)) - .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.length").value(TEST_LENGTH_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.chromosome").value(TEST_CHROMOSOME_2)); } @@ -235,7 +233,6 @@ public void fetchDiscreteCopyNumbersInMolecularProfileDetailedProjection() throw .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.hugoGeneSymbol").value(TEST_HUGO_GENE_SYMBOL_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.type").value(TEST_TYPE_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.cytoband").value(TEST_CYTOBAND_1)) - .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.length").value(TEST_LENGTH_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.chromosome").value(TEST_CHROMOSOME_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].molecularProfileId") .value(TEST_MOLECULAR_PROFILE_STABLE_ID_2)) @@ -246,7 +243,6 @@ public void fetchDiscreteCopyNumbersInMolecularProfileDetailedProjection() throw .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.hugoGeneSymbol").value(TEST_HUGO_GENE_SYMBOL_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.type").value(TEST_TYPE_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.cytoband").value(TEST_CYTOBAND_2)) - .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.length").value(TEST_LENGTH_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.chromosome").value(TEST_CHROMOSOME_2)); } @@ -370,7 +366,6 @@ private List createExampleDiscreteCopyNumberDataWithGene gene1.setHugoGeneSymbol(TEST_HUGO_GENE_SYMBOL_1); gene1.setType(TEST_TYPE_1); gene1.setCytoband(TEST_CYTOBAND_1); - gene1.setLength(TEST_LENGTH_1); gene1.setChromosome(TEST_CHROMOSOME_1); discreteCopyNumberDataList.get(0).setGene(gene1); Gene gene2 = new Gene(); @@ -378,7 +373,6 @@ private List createExampleDiscreteCopyNumberDataWithGene gene2.setHugoGeneSymbol(TEST_HUGO_GENE_SYMBOL_2); gene2.setType(TEST_TYPE_2); gene2.setCytoband(TEST_CYTOBAND_2); - gene2.setLength(TEST_LENGTH_2); gene2.setChromosome(TEST_CHROMOSOME_2); discreteCopyNumberDataList.get(1).setGene(gene2); return discreteCopyNumberDataList; diff --git a/web/src/test/java/org/cbioportal/web/GeneControllerTest.java b/web/src/test/java/org/cbioportal/web/GeneControllerTest.java index 0f4f8b7bd99..f4bf4267c7b 100644 --- a/web/src/test/java/org/cbioportal/web/GeneControllerTest.java +++ b/web/src/test/java/org/cbioportal/web/GeneControllerTest.java @@ -87,13 +87,11 @@ public void getAllGenesDefaultProjection() throws Exception { .andExpect(MockMvcResultMatchers.jsonPath("$[0].hugoGeneSymbol").value(HUGO_GENE_SYMBOL_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].type").value(TYPE_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].cytoband").value(CYTOBAND_1)) - .andExpect(MockMvcResultMatchers.jsonPath("$[0].length").value(LENGTH_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].chromosome").value(CHROMOSOME_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].entrezGeneId").value(ENTREZ_GENE_ID_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].hugoGeneSymbol").value(HUGO_GENE_SYMBOL_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].type").value(TYPE_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].cytoband").value(CYTOBAND_2)) - .andExpect(MockMvcResultMatchers.jsonPath("$[1].length").value(LENGTH_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].chromosome").value(CHROMOSOME_2)); } @@ -132,7 +130,6 @@ public void getGene() throws Exception { gene.setHugoGeneSymbol(HUGO_GENE_SYMBOL_1); gene.setType(TYPE_1); gene.setCytoband(CYTOBAND_1); - gene.setLength(LENGTH_1); gene.setChromosome(CHROMOSOME_1); geneList.add(gene); @@ -146,7 +143,6 @@ public void getGene() throws Exception { .andExpect(MockMvcResultMatchers.jsonPath("$.hugoGeneSymbol").value(HUGO_GENE_SYMBOL_1)) .andExpect(MockMvcResultMatchers.jsonPath("$.type").value(TYPE_1)) .andExpect(MockMvcResultMatchers.jsonPath("$.cytoband").value(CYTOBAND_1)) - .andExpect(MockMvcResultMatchers.jsonPath("$.length").value(LENGTH_1)) .andExpect(MockMvcResultMatchers.jsonPath("$.chromosome").value(CHROMOSOME_1)); } @@ -191,13 +187,11 @@ public void fetchGenesDefaultProjection() throws Exception { .andExpect(MockMvcResultMatchers.jsonPath("$[0].hugoGeneSymbol").value(HUGO_GENE_SYMBOL_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].type").value(TYPE_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].cytoband").value(CYTOBAND_1)) - .andExpect(MockMvcResultMatchers.jsonPath("$[0].length").value(LENGTH_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].chromosome").value(CHROMOSOME_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].entrezGeneId").value(ENTREZ_GENE_ID_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].hugoGeneSymbol").value(HUGO_GENE_SYMBOL_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].type").value(TYPE_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].cytoband").value(CYTOBAND_2)) - .andExpect(MockMvcResultMatchers.jsonPath("$[1].length").value(LENGTH_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].chromosome").value(CHROMOSOME_2)); } @@ -229,7 +223,6 @@ private List createGeneList() { gene1.setHugoGeneSymbol(HUGO_GENE_SYMBOL_1); gene1.setType(TYPE_1); gene1.setCytoband(CYTOBAND_1); - gene1.setLength(LENGTH_1); gene1.setChromosome(CHROMOSOME_1); geneList.add(gene1); Gene gene2 = new Gene(); @@ -237,7 +230,6 @@ private List createGeneList() { gene2.setHugoGeneSymbol(HUGO_GENE_SYMBOL_2); gene2.setType(TYPE_2); gene2.setCytoband(CYTOBAND_2); - gene2.setLength(LENGTH_2); gene2.setChromosome(CHROMOSOME_2); geneList.add(gene2); return geneList; diff --git a/web/src/test/java/org/cbioportal/web/MutationControllerTest.java b/web/src/test/java/org/cbioportal/web/MutationControllerTest.java index 9bd3620df12..952645bb73c 100644 --- a/web/src/test/java/org/cbioportal/web/MutationControllerTest.java +++ b/web/src/test/java/org/cbioportal/web/MutationControllerTest.java @@ -283,7 +283,6 @@ public void getMutationsInMolecularProfileBySampleListIdDetailedProjection() thr .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.hugoGeneSymbol").value(TEST_HUGO_GENE_SYMBOL_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.type").value(TEST_TYPE_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.cytoband").value(TEST_CYTOBAND_1)) - .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.length").value(TEST_LENGTH_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.chromosome").value(TEST_CHROMOSOME_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].molecularProfileId").value(TEST_MOLECULAR_PROFILE_STABLE_ID_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].sampleId").value(TEST_SAMPLE_STABLE_ID_2)) @@ -322,7 +321,6 @@ public void getMutationsInMolecularProfileBySampleListIdDetailedProjection() thr .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.hugoGeneSymbol").value(TEST_HUGO_GENE_SYMBOL_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.type").value(TEST_TYPE_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.cytoband").value(TEST_CYTOBAND_2)) - .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.length").value(TEST_LENGTH_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.chromosome").value(TEST_CHROMOSOME_2)); } @@ -601,7 +599,6 @@ public void fetchMutationsInMolecularProfileDetailedProjection() throws Exceptio .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.hugoGeneSymbol").value(TEST_HUGO_GENE_SYMBOL_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.type").value(TEST_TYPE_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.cytoband").value(TEST_CYTOBAND_1)) - .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.length").value(TEST_LENGTH_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[0].gene.chromosome").value(TEST_CHROMOSOME_1)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].molecularProfileId") .value(TEST_MOLECULAR_PROFILE_STABLE_ID_2)) @@ -641,7 +638,6 @@ public void fetchMutationsInMolecularProfileDetailedProjection() throws Exceptio .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.hugoGeneSymbol").value(TEST_HUGO_GENE_SYMBOL_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.type").value(TEST_TYPE_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.cytoband").value(TEST_CYTOBAND_2)) - .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.length").value(TEST_LENGTH_2)) .andExpect(MockMvcResultMatchers.jsonPath("$[1].gene.chromosome").value(TEST_CHROMOSOME_2)); } @@ -803,7 +799,6 @@ private List createExampleMutationsWithGene() { gene1.setHugoGeneSymbol(TEST_HUGO_GENE_SYMBOL_1); gene1.setType(TEST_TYPE_1); gene1.setCytoband(TEST_CYTOBAND_1); - gene1.setLength(TEST_LENGTH_1); gene1.setChromosome(TEST_CHROMOSOME_1); mutationList.get(0).setGene(gene1); Gene gene2 = new Gene(); @@ -811,7 +806,6 @@ private List createExampleMutationsWithGene() { gene2.setHugoGeneSymbol(TEST_HUGO_GENE_SYMBOL_2); gene2.setType(TEST_TYPE_2); gene2.setCytoband(TEST_CYTOBAND_2); - gene2.setLength(TEST_LENGTH_2); gene2.setChromosome(TEST_CHROMOSOME_2); mutationList.get(1).setGene(gene2); diff --git a/web/src/test/java/org/cbioportal/weblegacy/ApiControllerTest.java b/web/src/test/java/org/cbioportal/weblegacy/ApiControllerTest.java index aeb9c484612..1372ea0a5b6 100644 --- a/web/src/test/java/org/cbioportal/weblegacy/ApiControllerTest.java +++ b/web/src/test/java/org/cbioportal/weblegacy/ApiControllerTest.java @@ -550,13 +550,11 @@ private List getGeneticprofiledataQuery1PersistenceFullMock() { gene_AKT1.setEntrezGeneId(207); gene_AKT1.setType("protein-coding"); gene_AKT1.setCytoband("14q32.32"); - gene_AKT1.setLength(10838); Gene gene_TGFBR1 = new Gene(); gene_TGFBR1.setHugoGeneSymbol("TGFBR1"); gene_TGFBR1.setEntrezGeneId(7046); gene_TGFBR1.setType("protein-coding"); gene_TGFBR1.setCytoband("9q22"); - gene_TGFBR1.setLength(6844); TypeOfCancer typeOfCancer_brca = new TypeOfCancer(); typeOfCancer_brca.setTypeOfCancerId("brca"); typeOfCancer_brca.setName("Invasive Breast Carcinoma"); @@ -1082,7 +1080,6 @@ private void applyNullMaskToMutationModel(Mutation mutation) { mutation.setSample(null); //class object mutation.getGene().setType(null); mutation.getGene().setCytoband(null); - mutation.getGene().setLength(null); } private List getGeneticprofiledataQuery1ServiceMock() { diff --git a/web/src/test/java/org/cbioportal/weblegacy/GenePanelControllerLegacyTest.java b/web/src/test/java/org/cbioportal/weblegacy/GenePanelControllerLegacyTest.java index bf9614a1e2e..536e4af9f60 100644 --- a/web/src/test/java/org/cbioportal/weblegacy/GenePanelControllerLegacyTest.java +++ b/web/src/test/java/org/cbioportal/weblegacy/GenePanelControllerLegacyTest.java @@ -94,13 +94,11 @@ public void setup() { braf.setHugoGeneSymbol("BRAF"); braf.setType("protein-coding"); braf.setCytoband("7q34"); - braf.setLength(4564); egfr = new Gene(); egfr.setEntrezGeneId(1956); egfr.setHugoGeneSymbol("EGFR"); egfr.setType("protein-coding"); egfr.setCytoband("7p12"); - egfr.setLength(12961); genes.add(braf); genes.add(egfr); From a6346582318ca1315fbc6c6f880dc5b3fb1a0a2a Mon Sep 17 00:00:00 2001 From: Ino de Bruijn Date: Wed, 26 Jun 2019 10:47:15 -0400 Subject: [PATCH 2/4] Remove gene length import from docs --- docs/Updating-gene-and-gene_alias-tables.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/docs/Updating-gene-and-gene_alias-tables.md b/docs/Updating-gene-and-gene_alias-tables.md index 923312072b3..102aa2d7584 100644 --- a/docs/Updating-gene-and-gene_alias-tables.md +++ b/docs/Updating-gene-and-gene_alias-tables.md @@ -39,27 +39,23 @@ ALTER TABLE `geneset` AUTO_INCREMENT = 1; 4- Restart cBioPortal (restart webserver) to clean-up any cached gene lists. -5- You probably also want to update the gene lengths. To do so, download .annotation.gtf.gz of the [latest GENCODE release for hg19 / GRCh37](http://www.gencodegenes.org/releases/26lift37.html) for human and [mm10 / GRCm38](http://www.gencodegenes.org/mouse_releases/current.html) for mouse. - -After downloading, go to your downloads directory, decompress the file and add it as an argument (--gtf) in the next step. - -6- To import gene data type the following commands when in the folder `/core/src/main/scripts`: +5- To import gene data type the following commands when in the folder `/core/src/main/scripts`: ``` export PORTAL_HOME= ./importGenes.pl --genes --gtf ``` -7- :warning: Check the `gene` and `gene_alias` tables to verify that they are filled correctly. +6- :warning: Check the `gene` and `gene_alias` tables to verify that they are filled correctly. ```sql SELECT count(*) FROM cbioportal.gene; SELECT count(*) FROM cbioportal.gene_alias; ``` -8- Additionally, there are other tables you may want to update now (only in human). +7- Additionally, there are other tables you may want to update now (only in human). * Updating the COSMIC coding mutations, can be downloaded from [here](http://cancer.sanger.ac.uk/cosmic/download) and require the script `importCosmicData.pl` -9- Clean-up old data: +8- Clean-up old data: ```sql SET SQL_SAFE_UPDATES = 0; DELETE FROM cosmic_mutation where ENTREZ_GENE_ID not in (SELECT ENTREZ_GENE_ID from gene); @@ -71,7 +67,7 @@ SET SQL_SAFE_UPDATES = 1; commit; ``` -10- If DB engine supports FK constraints, e.g. InnoDB, restore constraints: +9- If DB engine supports FK constraints, e.g. InnoDB, restore constraints: ```sql ALTER TABLE cosmic_mutation ADD CONSTRAINT cosmic_mutation_ibfk_1 FOREIGN KEY (`ENTREZ_GENE_ID`) REFERENCES `gene` (`ENTREZ_GENE_ID`); @@ -80,7 +76,7 @@ ALTER TABLE uniprot_id_mapping ADD CONSTRAINT uniprot_id_mapping_ibfk_1 FOREIGN KEY (`ENTREZ_GENE_ID`) REFERENCES `gene` (`ENTREZ_GENE_ID`); ``` -11- You can import new gene sets using the gene set importer. These gene sets are currently only used for gene set scoring. See [Import-Gene-Sets.md](Import-Gene-Sets.md) and [File-Formats.md#gene-set-data]. +10- You can import new gene sets using the gene set importer. These gene sets are currently only used for gene set scoring. See [Import-Gene-Sets.md](Import-Gene-Sets.md) and [File-Formats.md#gene-set-data]. For example, run in folder `/core/src/main/scripts`: ```bash From 781dede88246a897c3dc47930f0d576f44a86b3f Mon Sep 17 00:00:00 2001 From: Ino de Bruijn Date: Wed, 26 Jun 2019 13:44:00 -0400 Subject: [PATCH 3/4] Change db version to 2.10.0 (remove gene length) Removing gene length is a pretty substantial change --- db-scripts/src/main/resources/cgds.sql | 2 +- db-scripts/src/main/resources/migration.sql | 4 ++-- pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db-scripts/src/main/resources/cgds.sql b/db-scripts/src/main/resources/cgds.sql index deda524ecd9..f5fc2c2bc4d 100644 --- a/db-scripts/src/main/resources/cgds.sql +++ b/db-scripts/src/main/resources/cgds.sql @@ -846,4 +846,4 @@ CREATE TABLE `info` ( `GENESET_VERSION` varchar(24) ); -- THIS MUST BE KEPT IN SYNC WITH db.version PROPERTY IN pom.xml -INSERT INTO info VALUES ('2.9.3', NULL); +INSERT INTO info VALUES ('2.10.0', NULL); diff --git a/db-scripts/src/main/resources/migration.sql b/db-scripts/src/main/resources/migration.sql index 1464a1417c7..6c06384956b 100644 --- a/db-scripts/src/main/resources/migration.sql +++ b/db-scripts/src/main/resources/migration.sql @@ -674,8 +674,8 @@ CREATE TABLE `structural_variant` ( UPDATE `info` SET `DB_SCHEMA_VERSION`="2.9.2"; -##version: 2.9.3 +##version: 2.10.0 -- remove gene length, this is stored in genome nexus ALTER TABLE `gene` DROP COLUMN `length`; -UPDATE `info` SET `DB_SCHEMA_VERSION`="2.9.3"; +UPDATE `info` SET `DB_SCHEMA_VERSION`="2.10.0"; diff --git a/pom.xml b/pom.xml index 89f8be100be..dd7c60acda3 100644 --- a/pom.xml +++ b/pom.xml @@ -303,7 +303,7 @@ 720 - 2.9.3 + 2.10.0 From a4fcc642d7115aa62ee41a07584bfaa22476f7f0 Mon Sep 17 00:00:00 2001 From: Ino de Bruijn Date: Wed, 26 Jun 2019 15:19:16 -0400 Subject: [PATCH 4/4] Remove TEST_LENGTH vars and --gtf option --- docs/Updating-gene-and-gene_alias-tables.md | 2 +- .../org/cbioportal/web/DiscreteCopyNumberControllerTest.java | 2 -- web/src/test/java/org/cbioportal/web/GeneControllerTest.java | 2 -- .../test/java/org/cbioportal/web/MutationControllerTest.java | 2 -- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/Updating-gene-and-gene_alias-tables.md b/docs/Updating-gene-and-gene_alias-tables.md index 102aa2d7584..f0aabcd3361 100644 --- a/docs/Updating-gene-and-gene_alias-tables.md +++ b/docs/Updating-gene-and-gene_alias-tables.md @@ -42,7 +42,7 @@ ALTER TABLE `geneset` AUTO_INCREMENT = 1; 5- To import gene data type the following commands when in the folder `/core/src/main/scripts`: ``` export PORTAL_HOME= -./importGenes.pl --genes --gtf +./importGenes.pl --genes ``` 6- :warning: Check the `gene` and `gene_alias` tables to verify that they are filled correctly. diff --git a/web/src/test/java/org/cbioportal/web/DiscreteCopyNumberControllerTest.java b/web/src/test/java/org/cbioportal/web/DiscreteCopyNumberControllerTest.java index e4c8ebab09e..a5b69c3b656 100644 --- a/web/src/test/java/org/cbioportal/web/DiscreteCopyNumberControllerTest.java +++ b/web/src/test/java/org/cbioportal/web/DiscreteCopyNumberControllerTest.java @@ -44,7 +44,6 @@ public class DiscreteCopyNumberControllerTest { private static final String TEST_HUGO_GENE_SYMBOL_1 = "test_hugo_gene_symbol_1"; private static final String TEST_TYPE_1 = "test_type_1"; private static final String TEST_CYTOBAND_1 = "test_cytoband_1"; - private static final int TEST_LENGTH_1 = 100; private static final String TEST_CHROMOSOME_1 = "test_chromosome_1"; private static final String TEST_MOLECULAR_PROFILE_STABLE_ID_2 = "test_molecular_profile_stable_id_2"; private static final String TEST_SAMPLE_STABLE_ID_2 = "test_sample_stable_id_2"; @@ -53,7 +52,6 @@ public class DiscreteCopyNumberControllerTest { private static final String TEST_HUGO_GENE_SYMBOL_2 = "test_hugo_gene_symbol_2"; private static final String TEST_TYPE_2 = "test_type_2"; private static final String TEST_CYTOBAND_2 = "test_cytoband_2"; - private static final int TEST_LENGTH_2 = 200; private static final String TEST_CHROMOSOME_2 = "test_chromosome_2"; private static final String TEST_SAMPLE_LIST_ID = "test_sample_list_id"; private static final int TEST_NUMBER_OF_SAMPLES_1 = 6; diff --git a/web/src/test/java/org/cbioportal/web/GeneControllerTest.java b/web/src/test/java/org/cbioportal/web/GeneControllerTest.java index f4bf4267c7b..e201be37365 100644 --- a/web/src/test/java/org/cbioportal/web/GeneControllerTest.java +++ b/web/src/test/java/org/cbioportal/web/GeneControllerTest.java @@ -37,13 +37,11 @@ public class GeneControllerTest { public static final String HUGO_GENE_SYMBOL_1 = "hugo_gene_symbol_1"; public static final String TYPE_1 = "type_1"; public static final String CYTOBAND_1 = "cytoband_1"; - public static final int LENGTH_1 = 100; public static final String CHROMOSOME_1 = "chromosome_1"; public static final int ENTREZ_GENE_ID_2 = 2; public static final String HUGO_GENE_SYMBOL_2 = "hugo_gene_symbol_2"; public static final String TYPE_2 = "type_2"; public static final String CYTOBAND_2 = "cytoband_2"; - public static final int LENGTH_2 = 200; public static final String CHROMOSOME_2 = "chromosome_2"; public static final String ALIAS_1 = "alias_1"; public static final String ALIAS_2 = "alias_2"; diff --git a/web/src/test/java/org/cbioportal/web/MutationControllerTest.java b/web/src/test/java/org/cbioportal/web/MutationControllerTest.java index 952645bb73c..3512ebd71d8 100644 --- a/web/src/test/java/org/cbioportal/web/MutationControllerTest.java +++ b/web/src/test/java/org/cbioportal/web/MutationControllerTest.java @@ -71,7 +71,6 @@ public class MutationControllerTest { private static final String TEST_HUGO_GENE_SYMBOL_1 = "test_hugo_gene_symbol_1"; private static final String TEST_TYPE_1 = "test_type_1"; private static final String TEST_CYTOBAND_1 = "test_cytoband_1"; - private static final int TEST_LENGTH_1 = 100; private static final String TEST_CHROMOSOME_1 = "test_chromosome_1"; private static final int TEST_MOLECULAR_PROFILE_ID_2 = 2; private static final String TEST_MOLECULAR_PROFILE_STABLE_ID_2 = "test_molecular_profile_stable_id_2"; @@ -106,7 +105,6 @@ public class MutationControllerTest { private static final String TEST_HUGO_GENE_SYMBOL_2 = "test_hugo_gene_symbol_2"; private static final String TEST_TYPE_2 = "test_type_2"; private static final String TEST_CYTOBAND_2 = "test_cytoband_2"; - private static final int TEST_LENGTH_2 = 200; private static final String TEST_CHROMOSOME_2 = "test_chromosome_2"; private static final int TEST_MUTATION_COUNT_1 = 100; private static final int TEST_MUTATION_COUNT_2 = 200;