diff --git a/business/pom.xml b/business/pom.xml
index f9e8a7936ff..efe733900f1 100644
--- a/business/pom.xml
+++ b/business/pom.xml
@@ -4,7 +4,7 @@
masterorg.mskcc.cbio
- 1.5.2
+ 1.6.04.0.0business
diff --git a/core/pom.xml b/core/pom.xml
index 109e16e8fcb..a690df1db82 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -4,7 +4,7 @@
masterorg.mskcc.cbio
- 1.5.2
+ 1.6.04.0.0core
diff --git a/core/src/main/java/org/mskcc/cbio/portal/dao/DaoCancerStudy.java b/core/src/main/java/org/mskcc/cbio/portal/dao/DaoCancerStudy.java
index 7ef19c6f0b3..aadc23d1539 100644
--- a/core/src/main/java/org/mskcc/cbio/portal/dao/DaoCancerStudy.java
+++ b/core/src/main/java/org/mskcc/cbio/portal/dao/DaoCancerStudy.java
@@ -519,6 +519,7 @@ public static void deleteCancerStudy(int internalCancerStudyId) throws DaoExcept
"DELETE FROM sample_profile WHERE GENETIC_PROFILE_ID IN (SELECT GENETIC_PROFILE_ID FROM genetic_profile WHERE CANCER_STUDY_ID=?)",
"DELETE FROM mutation WHERE GENETIC_PROFILE_ID IN (SELECT GENETIC_PROFILE_ID FROM genetic_profile WHERE CANCER_STUDY_ID=?)",
"DELETE FROM mutation_count WHERE GENETIC_PROFILE_ID IN (SELECT GENETIC_PROFILE_ID FROM genetic_profile WHERE CANCER_STUDY_ID=?)",
+ "DELETE FROM mutation_count_by_keyword WHERE GENETIC_PROFILE_ID IN (SELECT GENETIC_PROFILE_ID FROM genetic_profile WHERE CANCER_STUDY_ID=?)",
"DELETE FROM clinical_attribute_meta WHERE CANCER_STUDY_ID=?",
"DELETE FROM clinical_event_data WHERE CLINICAL_EVENT_ID IN (SELECT CLINICAL_EVENT_ID FROM clinical_event WHERE PATIENT_ID IN (SELECT INTERNAL_ID FROM patient WHERE CANCER_STUDY_ID=?))",
"DELETE FROM clinical_event WHERE PATIENT_ID IN (SELECT INTERNAL_ID FROM patient WHERE CANCER_STUDY_ID=?)",
diff --git a/core/src/main/java/org/mskcc/cbio/portal/dao/DaoMutation.java b/core/src/main/java/org/mskcc/cbio/portal/dao/DaoMutation.java
index 4db718e6161..2a948718425 100644
--- a/core/src/main/java/org/mskcc/cbio/portal/dao/DaoMutation.java
+++ b/core/src/main/java/org/mskcc/cbio/portal/dao/DaoMutation.java
@@ -145,6 +145,34 @@ public static int calculateMutationCount (int profileId) throws DaoException {
JdbcUtil.closeAll(DaoMutation.class, con, pstmt, rs);
}
}
+
+ public static int calculateMutationCountByKeyword(int profileId) throws DaoException {
+ Connection con = null;
+ PreparedStatement pstmt = null;
+ ResultSet rs = null;
+ try {
+ con = JdbcUtil.getDbConnection(DaoMutation.class);
+ pstmt = con.prepareStatement(
+ "INSERT INTO mutation_count_by_keyword " +
+ "SELECT g2.`GENETIC_PROFILE_ID`, mutation_event.`KEYWORD`, m2.`ENTREZ_GENE_ID`, " +
+ "IF(mutation_event.`KEYWORD` IS NULL, 0, COUNT(*)) AS KEYWORD_COUNT, (SELECT COUNT(*) " +
+ "FROM `mutation` AS m1 , `genetic_profile` AS g1 " +
+ "WHERE m1.`GENETIC_PROFILE_ID` = g1.`GENETIC_PROFILE_ID` " +
+ "AND g1.`GENETIC_PROFILE_ID`= g2.`GENETIC_PROFILE_ID` AND m1.`ENTREZ_GENE_ID` = m2.`ENTREZ_GENE_ID` " +
+ "GROUP BY g1.`GENETIC_PROFILE_ID` , m1.`ENTREZ_GENE_ID`) AS GENE_COUNT " +
+ "FROM `mutation` AS m2 , `genetic_profile` AS g2 , `mutation_event` " +
+ "WHERE m2.`GENETIC_PROFILE_ID` = g2.`GENETIC_PROFILE_ID` " +
+ "AND m2.`MUTATION_EVENT_ID` = mutation_event.`MUTATION_EVENT_ID` " +
+ "AND g2.`GENETIC_PROFILE_ID`=? " +
+ "GROUP BY g2.`GENETIC_PROFILE_ID` , mutation_event.`KEYWORD` , m2.`ENTREZ_GENE_ID`;");
+ pstmt.setInt(1, profileId);
+ return pstmt.executeUpdate();
+ } catch (SQLException e) {
+ throw new DaoException(e);
+ } finally {
+ JdbcUtil.closeAll(DaoMutation.class, con, pstmt, rs);
+ }
+ }
/**
* @deprecated We believe that this method is no longer called by any part of the codebase, and it will soon be deleted.
diff --git a/core/src/main/java/org/mskcc/cbio/portal/dao/JdbcUtil.java b/core/src/main/java/org/mskcc/cbio/portal/dao/JdbcUtil.java
index e985ea5769f..847e342b57e 100644
--- a/core/src/main/java/org/mskcc/cbio/portal/dao/JdbcUtil.java
+++ b/core/src/main/java/org/mskcc/cbio/portal/dao/JdbcUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Memorial Sloan-Kettering Cancer Center.
+ * Copyright (c) 2015 - 2017 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
@@ -32,14 +32,12 @@
package org.mskcc.cbio.portal.dao;
-import org.mskcc.cbio.portal.util.*;
-
-import org.apache.commons.logging.*;
-
import java.sql.*;
import java.util.*;
import javax.sql.DataSource;
import org.apache.commons.dbcp.BasicDataSource;
+import org.apache.commons.logging.*;
+import org.mskcc.cbio.portal.util.*;
/**
* Connection Utility for JDBC.
@@ -48,57 +46,54 @@
* @author Ersin Ciftci
*/
public class JdbcUtil {
- private static DataSource ds;
+ private static DataSource dataSource;
private static Map activeConnectionCount = new HashMap(); // keep track of the number of active connection per class/requester
private static final Log LOG = LogFactory.getLog(JdbcUtil.class);
-
+
/**
* Gets the data source
* @return the data source
*/
public static DataSource getDataSource() {
- if (ds==null) ds = initDataSource();
- return ds;
+ if (dataSource == null) {
+ dataSource = initDataSource();
+ }
+ return dataSource;
}
-
+
/**
* Sets the data source
* @param value the data source
*/
public static void setDataSource(DataSource value) {
- ds = value;
+ dataSource = value;
}
-
+
private static DataSource initDataSource() {
DatabaseProperties dbProperties = DatabaseProperties.getInstance();
String host = dbProperties.getDbHost();
String userName = dbProperties.getDbUser();
String password = dbProperties.getDbPassword();
String database = dbProperties.getDbName();
-
String url ="jdbc:mysql://" + host + "/" + database +
"?user=" + userName + "&password=" + password +
"&zeroDateTimeBehavior=convertToNull";
-
// Set up poolable data source
- BasicDataSource ds = new BasicDataSource();
- ds.setDriverClassName("com.mysql.jdbc.Driver");
- ds.setUsername(userName);
- ds.setPassword(password);
- ds.setUrl(url);
-
+ BasicDataSource dataSource = new BasicDataSource();
+ dataSource.setDriverClassName("com.mysql.jdbc.Driver");
+ dataSource.setUsername(userName);
+ dataSource.setPassword(password);
+ dataSource.setUrl(url);
// By pooling/reusing PreparedStatements, we get a major performance gain
- ds.setPoolPreparedStatements(true);
- ds.setMaxActive(100);
-
+ dataSource.setPoolPreparedStatements(true);
+ dataSource.setMaxActive(100);
activeConnectionCount = new HashMap();
-
- return ds;
+ return dataSource;
}
/**
* Gets Connection to the Database.
- *
+ *
* @param clazz class
* @return Live Connection to Database.
* @throws java.sql.SQLException Error Connecting to Database.
@@ -106,10 +101,10 @@ private static DataSource initDataSource() {
public static Connection getDbConnection(Class clazz) throws SQLException {
return getDbConnection(clazz.getName());
}
-
+
/**
* Gets Connection to the Database.
- *
+ *
* @param requester name
* @return Live Connection to Database.
* @throws java.sql.SQLException Error Connecting to Database.
@@ -117,21 +112,17 @@ public static Connection getDbConnection(Class clazz) throws SQLException {
private static Connection getDbConnection(String requester) throws SQLException {
// this method should be syncronized
// but may slow the speed?
-
Connection con;
try {
con = getDataSource().getConnection();
- }
- catch (Exception e) {
+ } catch (Exception e) {
logMessage(e.getMessage());
throw new SQLException(e);
}
-
- if (requester!=null) {
+ if (requester != null) {
Integer count = activeConnectionCount.get(requester);
- activeConnectionCount.put(requester, count==null ? 1 : (count+1));
+ activeConnectionCount.put(requester, count == null ? 1 : (count + 1));
}
-
return con;
}
@@ -143,19 +134,17 @@ private static Connection getDbConnection(String requester) throws SQLException
public static void closeConnection(Class clazz, Connection con) {
closeConnection(clazz.getName(), con);
}
-
+
private static void closeConnection(String requester, Connection con) {
try {
if (con != null && !con.isClosed()) {
con.close();
-
if (requester!=null) {
- int count = activeConnectionCount.get(requester)-1;
- if (count<0) {
+ int count = activeConnectionCount.get(requester) - 1;
+ if (count < 0) {
// since adding connection is not synchronized, the count may not be the real one
count = 0;
}
-
activeConnectionCount.put(requester, count);
}
}
@@ -171,8 +160,8 @@ private static void closeConnection(String requester, Connection con) {
* @param rs ResultSet Object.
*/
public static void closeAll(ResultSet rs) {
- JdbcUtil.closeAll((String)null, null, null, rs);
- }
+ JdbcUtil.closeAll((String)null, null, null, rs);
+ }
/**
* Frees Database Connection.
@@ -181,8 +170,7 @@ public static void closeAll(ResultSet rs) {
* @param ps Prepared Statement Object.
* @param rs ResultSet Object.
*/
- public static void closeAll(Class clazz, Connection con, PreparedStatement ps,
- ResultSet rs) {
+ public static void closeAll(Class clazz, Connection con, PreparedStatement ps, ResultSet rs) {
closeAll(clazz.getName(), con, ps, rs);
}
@@ -192,23 +180,26 @@ public static void closeAll(Class clazz, Connection con, PreparedStatement ps,
* @param con Connection Object.
* @param rs ResultSet Object.
*/
- private static void closeAll(String requester, Connection con, PreparedStatement ps,
- ResultSet rs) {
+ private static void closeAll(String requester, Connection con, PreparedStatement ps, ResultSet rs) {
if (rs != null) {
try {
- rs.close();
+ if (!rs.isClosed()) {
+ rs.close();
+ }
} catch (SQLException e) {
e.printStackTrace();
}
}
if (ps != null) {
try {
- ps.close();
+ if (!ps.isClosed()) {
+ ps.close();
+ }
} catch (SQLException e) {
e.printStackTrace();
}
}
- closeConnection(requester, con);
+ closeConnection(requester, con);
}
/**
@@ -223,7 +214,9 @@ public static void closeAll(Class clazz, Connection con, ResultSet rs) {
closeConnection(requester, con);
if (rs != null) {
try {
- rs.close();
+ if (!rs.isClosed()) {
+ rs.close();
+ }
} catch (SQLException e) {
e.printStackTrace();
}
@@ -236,18 +229,18 @@ private static void logMessage(String message) {
}
System.err.println(message);
}
-
+
// is it good to put the two methods below here?
static Integer readIntegerFromResultSet(ResultSet rs, String column) throws SQLException {
int i = rs.getInt(column);
return rs.wasNull() ? null : i;
}
-
+
static Long readLongFromResultSet(ResultSet rs, String column) throws SQLException {
long l = rs.getInt(column);
return rs.wasNull() ? null : l;
}
-
+
static Double readDoubleFromResultSet(ResultSet rs, String column) throws SQLException {
double d = rs.getDouble(column);
return rs.wasNull() ? null : d;
@@ -261,7 +254,6 @@ static Double readDoubleFromResultSet(ResultSet rs, String column) throws SQLExc
* @throws SQLException
*/
public static void disableForeignKeyCheck(Connection con) throws SQLException {
-
Statement stmt = con.createStatement();
stmt.execute("SET FOREIGN_KEY_CHECKS=0");
stmt.close();
@@ -273,7 +265,6 @@ public static void disableForeignKeyCheck(Connection con) throws SQLException {
* @throws SQLException
*/
public static void enableForeignKeyCheck(Connection con) throws SQLException {
-
Statement stmt = con.createStatement();
stmt.execute("SET FOREIGN_KEY_CHECKS=1");
stmt.close();
diff --git a/core/src/main/java/org/mskcc/cbio/portal/scripts/ImportExtendedMutationData.java b/core/src/main/java/org/mskcc/cbio/portal/scripts/ImportExtendedMutationData.java
index a200d8fb441..f38da4bd378 100644
--- a/core/src/main/java/org/mskcc/cbio/portal/scripts/ImportExtendedMutationData.java
+++ b/core/src/main/java/org/mskcc/cbio/portal/scripts/ImportExtendedMutationData.java
@@ -453,6 +453,7 @@ public void importData() throws IOException, DaoException {
// calculate mutation count for every sample
DaoMutation.calculateMutationCount(geneticProfileId);
+ DaoMutation.calculateMutationCountByKeyword(geneticProfileId);
if (entriesSkipped > 0) {
ProgressMonitor.setCurrentMessage(" --> total number of data entries skipped (see table below): " + entriesSkipped);
diff --git a/core/src/main/java/org/mskcc/cbio/portal/util/CheckDarwinAccessMain.java b/core/src/main/java/org/mskcc/cbio/portal/servlet/CheckDarwinAccessServlet.java
similarity index 72%
rename from core/src/main/java/org/mskcc/cbio/portal/util/CheckDarwinAccessMain.java
rename to core/src/main/java/org/mskcc/cbio/portal/servlet/CheckDarwinAccessServlet.java
index 6d0da203a8f..36a5af2a7cf 100644
--- a/core/src/main/java/org/mskcc/cbio/portal/util/CheckDarwinAccessMain.java
+++ b/core/src/main/java/org/mskcc/cbio/portal/servlet/CheckDarwinAccessServlet.java
@@ -30,23 +30,30 @@
* along with this program. If not, see .
*/
-package org.mskcc.cbio.portal.util;
+package org.mskcc.cbio.portal.servlet;
-import org.mskcc.cbio.portal.servlet.PatientView;
+import org.mskcc.cbio.portal.util.SpringUtil;
+import org.mskcc.cbio.portal.util.GlobalProperties;
+import org.apache.log4j.Logger;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import org.apache.commons.cli.*;
import org.apache.commons.lang.builder.ToStringBuilder;
+import java.io.*;
import java.util.*;
import javax.annotation.Generated;
import com.fasterxml.jackson.annotation.*;
import java.util.regex.Pattern;
-import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.*;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
/**
*
@@ -59,7 +66,15 @@
"p_userName",
"p_dmp_pid"
})
-public class CheckDarwinAccessMain {
+public class CheckDarwinAccessServlet extends HttpServlet {
+ private static Logger logger = Logger.getLogger(CheckDarwinAccessServlet.class);
+
+ @Override
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,
+ config.getServletContext());
+ }
public static class CheckDarwinAccess {
private static String darwinAuthUrl = GlobalProperties.getDarwinAuthCheckUrl();
@@ -70,18 +85,18 @@ public static class CheckDarwinAccess {
public static String checkAccess(HttpServletRequest request) {
if (!existsDarwinProperties()) return "";
// if sample id does not match regex or username matches cis username then return empty string
- String userName = GlobalProperties.getAuthenticatedUserName().split("@")[0];
- String darwinResponse = "";
+ String userName = GlobalProperties.getAuthenticatedUserName().split("@")[0];
+ String darwinResponse = "";
try {
- List sampleIds = (List)request.getAttribute(PatientView.SAMPLE_ID);
- if (sampleIdRegex.matcher(sampleIds.get(0)).find() && !cisUser.equals(userName)) {
- String patientId = (String)request.getAttribute(PatientView.PATIENT_ID);
+ String[] sampleIds = request.getParameter(PatientView.SAMPLE_ID).split(",");
+ if (sampleIdRegex.matcher(sampleIds[0]).find() && !cisUser.equals(userName)) {
+ String patientId = request.getParameter(PatientView.PATIENT_ID);
darwinResponse = getResponse(userName, patientId);
}
}
catch (NullPointerException ex) {}
- return darwinResponse;
+ return darwinResponse;
}
public static String getResponse(String userName, String patientId){
@@ -101,7 +116,7 @@ private static HttpEntity> getRequestEntity(
return new HttpEntity>(map, headers);
}
- private static boolean existsDarwinProperties() {
+ public static boolean existsDarwinProperties() {
return (!darwinAuthUrl.isEmpty() && !darwinResponseUrl.isEmpty() && !cisUser.isEmpty() && !GlobalProperties.getDarwinRegex().isEmpty());
}
}
@@ -253,25 +268,60 @@ private static void help(Options gnuOptions, int exitStatus) {
System.exit(exitStatus);
}
- public static void main(String[] args) throws Exception {
- Options gnuOptions = CheckDarwinAccessMain.getOptions(args);
- CommandLineParser parser = new DefaultParser();
- CommandLine commandLine = parser.parse(gnuOptions, args);
- if (commandLine.hasOption("h") ||
- !commandLine.hasOption("user_name") ||
- !commandLine.hasOption("patient_id") ||
- !commandLine.hasOption("sample_id")) {
- help(gnuOptions, 0);
- }
- if (!CheckDarwinAccess.sampleIdRegex.matcher(commandLine.getOptionValue("sample_id")).find()) {
- System.out.println("Sample ID doesn't match pattern");
- }
- else {
- System.out.println("Sample ID valid - checking if user has access");
- String darwinAccessUrl = CheckDarwinAccess.getResponse(
- commandLine.getOptionValue("user_name").split("@")[0],
- commandLine.getOptionValue("patient_id"));
- System.out.println(!darwinAccessUrl.isEmpty()?darwinAccessUrl:"Invalid request!");
- }
+ /**
+ * Processes requests for both HTTP GET and POST methods.
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+
+ String darwinResponse = CheckDarwinAccess.checkAccess(request);
+
+ response.setContentType("text/plain");
+ PrintWriter out = response.getWriter();
+ try {
+ out.write(darwinResponse);
+ } finally {
+ out.close();
+ }
+ }
+
+ //
+ /**
+ * Handles the HTTP GET method.
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
}
-}
\ No newline at end of file
+
+ /**
+ * Handles the HTTP POST method.
+ * @param request servlet request
+ * @param response servlet response
+ * @throws ServletException if a servlet-specific error occurs
+ * @throws IOException if an I/O error occurs
+ */
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+ processRequest(request, response);
+ }
+
+ /**
+ * Returns a short description of the servlet.
+ * @return a String containing servlet description
+ */
+ @Override
+ public String getServletInfo() {
+ return "Short description";
+ }//
+}
diff --git a/core/src/main/java/org/mskcc/cbio/portal/servlet/PatientView.java b/core/src/main/java/org/mskcc/cbio/portal/servlet/PatientView.java
index 4e6d6752acf..35bf68ccf1a 100644
--- a/core/src/main/java/org/mskcc/cbio/portal/servlet/PatientView.java
+++ b/core/src/main/java/org/mskcc/cbio/portal/servlet/PatientView.java
@@ -33,44 +33,17 @@
package org.mskcc.cbio.portal.servlet;
-import java.io.BufferedReader;
import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpStatus;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
-import org.mskcc.cbio.portal.repository.MutationRepositoryLegacy;
-import org.mskcc.cbio.portal.dao.*;
-import org.mskcc.cbio.portal.model.*;
-import org.mskcc.cbio.portal.util.AccessControl;
-import org.mskcc.cbio.portal.web_api.ConnectionManager;
-import org.mskcc.cbio.portal.web_api.ProtocolException;
import org.mskcc.cbio.portal.util.*;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
-import java.net.URL;
-import java.util.*;
import javax.servlet.*;
/**
@@ -78,43 +51,18 @@
* @author jj
*/
public class PatientView extends HttpServlet {
- private static Logger logger = Logger.getLogger(PatientView.class);
- public static final String ERROR = "user_error_message";
- public static final String VIEW_TYPE = "view_type";
public static final String SAMPLE_ID = "sample_id";
public static final String PATIENT_ID = "case_id";
- public static final String PATIENT_ID_ATTR_NAME = "PATIENT_ID";
- public static final String PATIENT_CASE_OBJ = "case_obj";
- public static final String CANCER_STUDY = "cancer_study";
- public static final String HAS_SEGMENT_DATA = "has_segment_data";
public static final String HAS_ALLELE_FREQUENCY_DATA = "has_allele_frequency_data";
public static final String MUTATION_PROFILE = "mutation_profile";
- public static final String CANCER_STUDY_META_DATA_KEY_STRING = "cancer_study_meta_data";
public static final String CNA_PROFILE = "cna_profile";
public static final String MRNA_PROFILE = "mrna_profile";
- public static final String NUM_CASES_IN_SAME_STUDY = "num_cases";
- public static final String NUM_CASES_IN_SAME_MUTATION_PROFILE = "num_cases_mut";
- public static final String NUM_CASES_IN_SAME_CNA_PROFILE = "num_cases_cna";
- public static final String NUM_CASES_IN_SAME_MRNA_PROFILE = "num_cases_mrna";
- public static final String PATIENT_INFO = "patient_info";
- public static final String DISEASE_INFO = "disease_info";
- public static final String PATIENT_STATUS = "patient_status";
- public static final String CLINICAL_DATA = "clinical_data";
- public static final String CLINICAL_ATTRIBUTES = "clinical_attributes";
- public static final String TISSUE_IMAGES = "tissue_images";
- public static final String PATH_REPORT_URL = "path_report_url";
- public static final String CLINICAL_ATTRIBUTE_OTHER_PAPTEINT_ID = "OTHER_PATIENT_ID";
- public static final String CLINICAL_ATTRIBUTE_OTHER_SAMPLE_ID = "OTHER_SAMPLE_ID";
-
+
public static final String DRUG_TYPE = "drug_type";
public static final String DRUG_TYPE_CANCER_DRUG = "cancer_drug";
public static final String DRUG_TYPE_FDA_ONLY = "fda_approved";
-
- // class which process access control to cancer studies
- private AccessControl accessControl;
- @Autowired
- private MutationRepositoryLegacy mutationRepositoryLegacy;
+ private static Logger logger = Logger.getLogger(PatientView.class);
@Override
public void init(ServletConfig config) throws ServletException {
@@ -122,17 +70,6 @@ public void init(ServletConfig config) throws ServletException {
SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this,
config.getServletContext());
}
-
- /**
- * Initializes the servlet.
- *
- * @throws ServletException Serlvet Init Error.
- */
- @Override
- public void init() throws ServletException {
- super.init();
- accessControl = SpringUtil.getAccessControl();
- }
/**
* Processes requests for both HTTP GET and POST methods.
@@ -145,444 +82,25 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
throws ServletException, IOException {
XDebug xdebug = new XDebug( request );
request.setAttribute(QueryBuilder.XDEBUG_OBJECT, xdebug);
-
- String cancerStudyId = request.getParameter(QueryBuilder.CANCER_STUDY_ID);
- request.setAttribute(QueryBuilder.CANCER_STUDY_ID, cancerStudyId);
-
- try {
- if (validate(request)) {
- setGeneticProfiles(request);
- setClinicalInfo(request);
- setNumCases(request);
- setCancerStudyMetaData(request);
- }
-
- if (request.getAttribute(ERROR)!=null) {
- String msg = (String)request.getAttribute(ERROR);
- xdebug.logMsg(this, msg);
- forwardToErrorPage(request, response, msg, xdebug);
- } else {
- RequestDispatcher dispatcher =
- getServletContext().getRequestDispatcher("/WEB-INF/jsp/patient_view/patient_view.jsp");
- dispatcher.forward(request, response);
- }
-
- } catch (DaoException e) {
- e.printStackTrace();
- xdebug.logMsg(this, "Got Database Exception: " + e.getMessage());
- forwardToErrorPage(request, response,
- "An error occurred while trying to connect to the database.", xdebug);
- } catch (ProtocolException e) {
- e.printStackTrace();
- xdebug.logMsg(this, "Got Protocol Exception " + e.getMessage());
- forwardToErrorPage(request, response,
- "An error occurred while trying to authenticate.", xdebug);
- }
- }
-
- /**
- *
- * Tests whether there is allele frequency data for a patient in a cancer study.
- * It gets all the mutations and then checks the values for allele frequency.
- *
- * If mutationProfile is null then returns false
- *
- * @return Boolean
- *
- * @author Gideon Dresdner
- */
- public boolean hasAlleleFrequencyData(int sampleId, GeneticProfile mutationProfile) throws DaoException {
-
- if (mutationProfile == null) {
- // fail quietly
- return false;
- }
-
- return mutationRepositoryLegacy.hasAlleleFrequencyData(mutationProfile.getGeneticProfileId(), sampleId);
- }
-
- private boolean validate(HttpServletRequest request) throws DaoException {
-
- // by default; in case return false;
- request.setAttribute(HAS_SEGMENT_DATA, Boolean.FALSE);
- request.setAttribute(HAS_ALLELE_FREQUENCY_DATA, Boolean.FALSE);
-
- String sampleIdsStr = request.getParameter(SAMPLE_ID);
- String patientIdsStr = request.getParameter(PATIENT_ID);
- if ((sampleIdsStr == null || sampleIdsStr.isEmpty())
- && (patientIdsStr == null || patientIdsStr.isEmpty())) {
- request.setAttribute(ERROR, "Please specify at least one case ID or patient ID. ");
- return false;
- }
-
- String cancerStudyId = (String) request.getAttribute(QueryBuilder.CANCER_STUDY_ID);
- if (cancerStudyId==null) {
- request.setAttribute(ERROR, "Please specify cancer study ID. ");
- return false;
- }
-
- CancerStudy cancerStudy = DaoCancerStudy.getCancerStudyByStableId(cancerStudyId);
- if (cancerStudy==null) {
- request.setAttribute(ERROR, "We have no information about cancer study "+cancerStudyId);
- return false;
- }
-
- Set samples = new HashSet();
- Set sampleIdSet = new HashSet();
- if (sampleIdsStr!=null) {
- for (String sampleId : sampleIdsStr.split(" +")) {
- Sample _sample = DaoSample.getSampleByCancerStudyAndSampleId(cancerStudy.getInternalId(), sampleId);
- if (_sample == null) {
- List ss = DaoClinicalData.getSamplesByAttribute(cancerStudy.getInternalId(), CLINICAL_ATTRIBUTE_OTHER_SAMPLE_ID, sampleId);
- if (!ss.isEmpty()) { //TODO: what if there are more than 1 samples with the same other id
- _sample = ss.get(0);
- }
- }
- if (_sample != null) {
- samples.add(_sample);
- sampleIdSet.add(_sample.getStableId());
- }
- }
- }
-
- request.setAttribute(VIEW_TYPE, "sample");
- if (patientIdsStr!=null) {
- request.setAttribute(VIEW_TYPE, "patient");
- for (String patientId : patientIdsStr.split(" +")) {
- Patient patient = DaoPatient.getPatientByCancerStudyAndPatientId(cancerStudy.getInternalId(), patientId);
- if (patient == null) {
- List ps = DaoClinicalData.getPatientsByAttribute(cancerStudy.getInternalId(), CLINICAL_ATTRIBUTE_OTHER_PAPTEINT_ID, patientId);
- if (!ps.isEmpty()) { //TODO: what if there are more than 1 patients with the same other id
- patient = ps.get(0);
- }
- }
- if (patient != null) {
- for (Sample sample : DaoSample.getSamplesByPatientId(patient.getInternalId())) {
- if (sample != null) {
- samples.add(sample);
- sampleIdSet.add(sample.getStableId());
- }
- }
- }
- }
- }
-
- if (samples.isEmpty()) {
- request.setAttribute(ERROR, "We have no information about the patient.");
- return false;
- }
-
-
- int patientId = samples.iterator().next().getInternalPatientId();
-
- List sampleIds = new ArrayList(sampleIdSet);
- sortSampleIds(cancerStudy.getInternalId(), patientId, sampleIds);
-
- request.setAttribute(SAMPLE_ID, sampleIds);
-
- request.setAttribute(QueryBuilder.HTML_TITLE, "Patient: "+StringUtils.join(sampleIds,","));
+ request.setAttribute(QueryBuilder.HTML_TITLE, "Patient");
- String cancerStudyIdentifier = cancerStudy.getCancerStudyStableId();
-
- if (accessControl.isAccessibleCancerStudy(cancerStudyIdentifier).size() != 1) {
- request.setAttribute(ERROR,
- "You are not authorized to view the cancer study with id: '" +
- cancerStudyIdentifier + "'. ");
- return false;
- }
- else {
- UserDetails ud = accessControl.getUserDetails();
- if (ud != null) {
- logger.info("PatientView.validate: Query initiated by user: " + ud.getUsername());
- }
- }
-
- request.setAttribute(PATIENT_CASE_OBJ, samples);
- request.setAttribute(CANCER_STUDY, cancerStudy);
-
- request.setAttribute(HAS_SEGMENT_DATA, DaoCopyNumberSegment
- .segmentDataExistForCancerStudy(cancerStudy.getInternalId()));
- String firstSampleId = sampleIds.get(0);
- Sample firstSample = DaoSample.getSampleByCancerStudyAndSampleId(cancerStudy.getInternalId(), firstSampleId);
- request.setAttribute(HAS_ALLELE_FREQUENCY_DATA,
- hasAlleleFrequencyData(firstSample.getInternalId(), cancerStudy.getMutationProfile(firstSampleId)));
-
- return true;
- }
-
- private void sortSampleIds(int cancerStudyId, int patientId, List sampleIds) {
- if (sampleIds.size()==1) {
- return;
- }
- try {
- Collections.sort(sampleIds, new NaturalOrderComparator());
-
- if (DaoClinicalEvent.timeEventsExistForPatient(patientId)) {
- List events = DaoClinicalEvent.getClinicalEvent(patientId, "SPECIMEN");
- if (events!=null) {
- final Map sampleTimes = new HashMap();
- // TODO: event data should only use SAMPLE_ID, this allows
- // all variations currently in the db while transitioning
- String[] sampleIdsInEventData = {"SpecimenReferenceNumber",
- "SPECIMEN_REFERENCE_NUMBER",
- "SAMPLE_ID"};
- for (ClinicalEvent event : events) {
- String specRefNum = null;
- for (String s: sampleIdsInEventData) {
- specRefNum = event.getEventData().get(s);
- if (specRefNum != null) {
- break;
- }
- }
- sampleTimes.put(specRefNum, event.getStartDate());
- }
-
- Collections.sort(sampleIds, new Comparator() {
- @Override
- public int compare(String s1, String s2) {
- Long l1 = sampleTimes.get(s1);
- if (l1==null) l1 = Long.MAX_VALUE;
- Long l2 = sampleTimes.get(s2);
- if (l2==null) l2 = Long.MAX_VALUE;
-
- return l1.compareTo(l2);
- }
- });
- }
- }
-
- ClinicalAttribute attr = DaoClinicalAttributeMeta.getDatum("SAMPLE_TYPE", cancerStudyId);
- if (attr!=null) {
-
- List data = DaoClinicalData.getSampleData(cancerStudyId, sampleIds, attr);
- if (!data.isEmpty()) {
- final Map sampleTypes = new HashMap();
- for (ClinicalData datum : data) {
- sampleTypes.put(datum.getStableId(), datum.getAttrVal().toLowerCase());
- }
- Collections.sort(sampleIds, new Comparator() {
- @Override
- public int compare(String s1, String s2) {
- int t1 = getOrderOfType(sampleTypes.get(s1));
- int t2 = getOrderOfType(sampleTypes.get(s2));
- return t1 - t2;
- }
- });
- }
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private int getOrderOfType(String sampleType) {
- switch (sampleType) {
- case "primary": return 1;
- case "progressed": return 3;
- case "metastasis": return 4;
- default: return 2; // null is primary
- }
- }
-
- private void setGeneticProfiles(HttpServletRequest request) throws DaoException {
- CancerStudy cancerStudy = (CancerStudy)request.getAttribute(CANCER_STUDY);
- GeneticProfile mutProfile = cancerStudy.getMutationProfile();
- if (mutProfile!=null) {
- request.setAttribute(MUTATION_PROFILE, mutProfile);
- request.setAttribute(NUM_CASES_IN_SAME_MUTATION_PROFILE,
- DaoSampleProfile.countSamplesInProfile(mutProfile.getGeneticProfileId()));
- }
-
- GeneticProfile cnaProfile = cancerStudy.getCopyNumberAlterationProfile(true);
- if (cnaProfile!=null) {
- request.setAttribute(CNA_PROFILE, cnaProfile);
- request.setAttribute(NUM_CASES_IN_SAME_CNA_PROFILE,
- DaoSampleProfile.countSamplesInProfile(cnaProfile.getGeneticProfileId()));
- }
-
- GeneticProfile mrnaProfile = cancerStudy.getMRnaZscoresProfile();
- if (mrnaProfile!=null) {
- request.setAttribute(MRNA_PROFILE, mrnaProfile);
- request.setAttribute(NUM_CASES_IN_SAME_MRNA_PROFILE,
- DaoSampleProfile.countSamplesInProfile(mrnaProfile.getGeneticProfileId()));
- }
+ RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/jsp/patient_view/patient_view.jsp");
+ dispatcher.forward(request, response);
}
- private void setCancerStudyMetaData(HttpServletRequest request) throws DaoException, ProtocolException {
- request.setAttribute(CANCER_STUDY_META_DATA_KEY_STRING, DaoSampleProfile.metaData(accessControl.getCancerStudies()));
- }
-
- private void setNumCases(HttpServletRequest request) throws DaoException {
- CancerStudy cancerStudy = (CancerStudy)request.getAttribute(CANCER_STUDY);
- request.setAttribute(NUM_CASES_IN_SAME_STUDY,DaoPatient.getPatientsByCancerStudyId(cancerStudy.getInternalId()).size());
- }
+ private static String getFullURL(HttpServletRequest request) {
+ StringBuffer requestURL = request.getRequestURL();
+ String queryString = request.getQueryString();
- private void setClinicalInfo(HttpServletRequest request) throws DaoException {
- List samples = (List)request.getAttribute(SAMPLE_ID);
- boolean isPatientView = request.getAttribute(VIEW_TYPE) == "patient";
-
- CancerStudy cancerStudy = (CancerStudy)request.getAttribute(CANCER_STUDY);
- int cancerStudyId = cancerStudy.getInternalId();
- List cds = DaoClinicalData.getSampleData(cancerStudyId, samples);
- Map> clinicalData = new LinkedHashMap>();
- for (ClinicalData cd : cds) {
- String caseId = cd.getStableId();
- String attrId = cd.getAttrId();
- String attrValue = cd.getAttrVal();
- Map attrMap = clinicalData.get(caseId);
- if (attrMap==null) {
- attrMap = new HashMap();
- clinicalData.put(caseId, attrMap);
- }
- attrMap.put(attrId, attrValue);
- }
- request.setAttribute(CLINICAL_DATA, clinicalData);
-
- // Add attribute name to display name mapping
- List cas = DaoClinicalAttributeMeta.getDataByStudy(cancerStudyId);
-
- String sampleId = samples.get(0);
- Map> clinicalAttributes = new LinkedHashMap>();
- for (ClinicalAttribute ca : cas) {
- String attrId = ca.getAttrId();
- String displayName = ca.getDisplayName();
- String description = ca.getDescription();
- Map attrMap = new HashMap();
- clinicalAttributes.put(attrId, attrMap);
- attrMap.put("displayName", displayName);
- attrMap.put("description", description);
- }
- request.setAttribute(CLINICAL_ATTRIBUTES, clinicalAttributes);
-
- request.setAttribute("num_tumors", 1);
-
- // other cases with the same patient id
- Patient patient = DaoPatient.getPatientById(DaoSample.getSampleByCancerStudyAndSampleId(cancerStudyId, sampleId).getInternalPatientId());
- String patientId = patient.getStableId();
-
- // Add patient info to request
- List patientData = DaoClinicalData.getDataByPatientId(cancerStudyId, patientId);
- Map patientMap = new HashMap();
- for (ClinicalData cd: patientData) {
- patientMap.put(cd.getAttrId(), cd.getAttrVal());
- }
- request.setAttribute(PATIENT_INFO, patientMap);
-
- int numOfSamplesInPatient = DaoSample.getSamplesByPatientId(patient.getInternalId()).size();
- request.setAttribute("num_tumors", numOfSamplesInPatient);
-
- if (numOfSamplesInPatient>1) {
- request.setAttribute(PATIENT_ID_ATTR_NAME, patientId);
- }
-
- request.setAttribute("has_timeline_data", Boolean.FALSE);
- if (patientId!=null) {
- request.setAttribute("has_timeline_data", DaoClinicalEvent.timeEventsExistForPatient(patient.getInternalId()));
- }
-
- request.setAttribute(PATIENT_ID, patientId);
-
- // images
- String tisImageUrl = getTissueImageIframeUrl(cancerStudy.getCancerStudyStableId(), samples.size()>1?patientId:sampleId);
- if (tisImageUrl!=null) {
- request.setAttribute(TISSUE_IMAGES, tisImageUrl);
- }
-
- // path report
- String typeOfCancer = cancerStudy.getTypeOfCancerId();
- if (patientId!=null && patientId.startsWith("TCGA-")) {
- String pathReport = getTCGAPathReport(patientId);
- if (pathReport!=null) {
- request.setAttribute(PATH_REPORT_URL, pathReport);
- }
+ if (queryString == null) {
+ return requestURL.toString();
+ } else {
+ return requestURL.append('?').append(queryString).toString();
}
}
-
- private String getTissueImageIframeUrl(String cancerStudyId, String caseId) {
- if (!caseId.toUpperCase().startsWith("TCGA-")) {
- return null;
- }
-
- // test if images exist for the case
- String metaUrl = GlobalProperties.getDigitalSlideArchiveMetaUrl(caseId);
-
- HttpClient client = ConnectionManager.getHttpClient(5000);
- GetMethod method = new GetMethod(metaUrl);
- Pattern p = Pattern.compile("");
- try {
- int statusCode = client.executeMethod(method);
- if (statusCode == HttpStatus.SC_OK) {
- BufferedReader bufReader = new BufferedReader(
- new InputStreamReader(method.getResponseBodyAsStream()));
- for (String line=bufReader.readLine(); line!=null; line=bufReader.readLine()) {
- Matcher m = p.matcher(line);
- if (m.find()) {
- int count = Integer.parseInt(m.group(1));
- return count>0 ? GlobalProperties.getDigitalSlideArchiveIframeUrl(caseId) : null;
- }
- }
-
- } else {
- // Otherwise, throw HTTP Exception Object
- logger.error(statusCode + ": " + HttpStatus.getStatusText(statusCode)
- + " Base URL: " + metaUrl);
- }
- } catch (Exception ex) {
- logger.error(ex.getMessage());
- } finally {
- // Must release connection back to Apache Commons Connection Pool
- method.releaseConnection();
- }
-
- return null;
- }
-
- // Map>>
- private static Map pathologyReports = new HashMap();
-
- private synchronized String getTCGAPathReport(String caseId) {
- String pathologyReportUrl = pathologyReports.get(caseId);
- if (pathologyReportUrl==null) {
-
- String pathReportUrl = GlobalProperties.getTCGAPathReportUrl();
-
- if (pathReportUrl != null) {
- //Strip the last item to replace it with the actual pathology report
- String baseUrl = pathReportUrl.substring(0, pathReportUrl.lastIndexOf("/") + 1);
- try {
- URL url = new URL(pathReportUrl);
- Scanner s = new Scanner(url.openStream());
-
- // skip the first line (header)
- s.nextLine();
- for (String line=s.nextLine(); line!=null; line=s.nextLine()) {
- String patientId = line.split("\t")[0];
- String filename = line.split("\t")[1];
- pathologyReports.put(patientId, baseUrl + filename);
- }
- } catch (Exception ex) {
- logger.error(ex.getMessage());
- }
- }
- }
-
- return pathologyReports.get(caseId);
- }
-
- private void forwardToErrorPage(HttpServletRequest request, HttpServletResponse response,
- String userMessage, XDebug xdebug)
- throws ServletException, IOException {
- request.setAttribute("xdebug_object", xdebug);
- request.setAttribute(QueryBuilder.USER_ERROR_MESSAGE, userMessage);
- RequestDispatcher dispatcher =
- getServletContext().getRequestDispatcher("/WEB-INF/jsp/error.jsp");
- dispatcher.forward(request, response);
- }
-
//
/**
* Handles the HTTP GET method.
diff --git a/core/src/main/java/org/mskcc/cbio/portal/util/GlobalProperties.java b/core/src/main/java/org/mskcc/cbio/portal/util/GlobalProperties.java
index c3bde7577cb..664748ab029 100644
--- a/core/src/main/java/org/mskcc/cbio/portal/util/GlobalProperties.java
+++ b/core/src/main/java/org/mskcc/cbio/portal/util/GlobalProperties.java
@@ -124,7 +124,6 @@ public class GlobalProperties {
public static final double[] DEFAULT_GENOMIC_OVERVIEW_CNA_CUTOFF = new double[]{0.2,1.5};
public static final String PATIENT_VIEW_DIGITAL_SLIDE_IFRAME_URL = "digitalslidearchive.iframe.url";
public static final String PATIENT_VIEW_DIGITAL_SLIDE_META_URL = "digitalslidearchive.meta.url";
- public static final String PATIENT_VIEW_TCGA_PATH_REPORT_URL = "tcga_path_report.url";
public static final String PATIENT_VIEW_MDACC_HEATMAP_META_URL = "mdacc.heatmap.meta.url";
public static final String PATIENT_VIEW_MDACC_HEATMAP_URL = "mdacc.heatmap.patient.url";
@@ -639,15 +638,14 @@ public static String getGenomicBuild(){
public static String getLinkToPatientView(String caseId, String cancerStudyId)
{
- return "case.do?" + QueryBuilder.CANCER_STUDY_ID + "=" + cancerStudyId
- //+ "&"+ org.mskcc.cbio.portal.servlet.PatientView.PATIENT_ID + "=" + caseId;
- + "&"+ org.mskcc.cbio.portal.servlet.PatientView.SAMPLE_ID + "=" + caseId;
+ return "case.do#/patient?caseId=" + caseId
+ + "&studyId=" + cancerStudyId;
}
public static String getLinkToSampleView(String caseId, String cancerStudyId)
{
- return "case.do?" + QueryBuilder.CANCER_STUDY_ID + "=" + cancerStudyId
- + "&"+ org.mskcc.cbio.portal.servlet.PatientView.SAMPLE_ID + "=" + caseId;
+ return "case.do#/patient?sampleId=" + caseId
+ + "&studyId=" + cancerStudyId;
}
public static String getLinkToCancerStudyView(String cancerStudyId)
@@ -705,16 +703,6 @@ public static String getPatientHeatmapViewerUrl(String caseId)
return url + caseId;
}
- public static String getTCGAPathReportUrl()
- {
- String url = GlobalProperties.getProperty(PATIENT_VIEW_TCGA_PATH_REPORT_URL);
- if (url == null) {
- return null;
- }
-
- return url;
- }
-
// function for getting the custom tabs for the header
public static String[] getCustomHeaderTabs(){
String customPagesString = GlobalProperties.getProperty(SKIN_CUSTOM_HEADER_TABS);
diff --git a/core/src/main/java/org/mskcc/cbio/portal/util/MutationDataUtils.java b/core/src/main/java/org/mskcc/cbio/portal/util/MutationDataUtils.java
index bab033ec7fc..69666b40624 100644
--- a/core/src/main/java/org/mskcc/cbio/portal/util/MutationDataUtils.java
+++ b/core/src/main/java/org/mskcc/cbio/portal/util/MutationDataUtils.java
@@ -227,7 +227,7 @@ protected HashMap getMutationDataMap(
String typeOfCancer = DaoTypeOfCancer.getTypeOfCancerById(cancerStudy.getTypeOfCancerId()).getName();
String cancerStudyStableId = cancerStudy.getCancerStudyStableId();
Sample sample = DaoSample.getSampleById(mutation.getSampleId());
- String linkToPatientView = GlobalProperties.getLinkToPatientView(sample.getStableId(), cancerStudyStableId);
+ String linkToPatientView = GlobalProperties.getLinkToSampleView(sample.getStableId(), cancerStudyStableId);
List mcgLinks;
Boolean isHotspot;
if (mutation.getMutationType().equalsIgnoreCase("Fusion")) {
diff --git a/db-scripts/pom.xml b/db-scripts/pom.xml
index f779455bb52..dfa2a8a32b7 100644
--- a/db-scripts/pom.xml
+++ b/db-scripts/pom.xml
@@ -5,7 +5,7 @@
masterorg.mskcc.cbio
- 1.5.2
+ 1.6.04.0.0
diff --git a/db-scripts/src/main/resources/cgds.sql b/db-scripts/src/main/resources/cgds.sql
index 2cfa82f9e38..3c893330eca 100644
--- a/db-scripts/src/main/resources/cgds.sql
+++ b/db-scripts/src/main/resources/cgds.sql
@@ -69,6 +69,7 @@ DROP TABLE IF EXISTS `clinical_attribute_meta`;
DROP TABLE IF EXISTS `clinical_sample`;
DROP TABLE IF EXISTS `clinical_patient`;
DROP TABLE IF EXISTS `mutation_count`;
+DROP TABLE IF EXISTS `mutation_count_by_keyword`;
DROP TABLE IF EXISTS `mutation`;
DROP TABLE IF EXISTS `mutation_event`;
DROP TABLE IF EXISTS `structural_variant`;
@@ -406,6 +407,18 @@ CREATE TABLE `mutation_count` (
FOREIGN KEY (`SAMPLE_ID`) REFERENCES `sample` (`INTERNAL_ID`) ON DELETE CASCADE
);
+-- --------------------------------------------------------
+CREATE TABLE `mutation_count_by_keyword` (
+ `GENETIC_PROFILE_ID` int(11) NOT NULL,
+ `KEYWORD` varchar(50) DEFAULT NULL,
+ `ENTREZ_GENE_ID` int(11) NOT NULL,
+ `KEYWORD_COUNT` int NOT NULL,
+ `GENE_COUNT` int NOT NULL,
+ KEY (`GENETIC_PROFILE_ID`,`KEYWORD`),
+ FOREIGN KEY (`GENETIC_PROFILE_ID`) REFERENCES `genetic_profile` (`GENETIC_PROFILE_ID`) ON DELETE CASCADE,
+ FOREIGN KEY (`ENTREZ_GENE_ID`) REFERENCES `gene` (`ENTREZ_GENE_ID`) ON DELETE CASCADE
+);
+
-- --------------------------------------------------------
CREATE TABLE `clinical_patient` (
`INTERNAL_ID` int(11) NOT NULL,
@@ -705,4 +718,4 @@ CREATE TABLE `info` (
`DB_SCHEMA_VERSION` varchar(24)
);
-- THIS MUST BE KEPT IN SYNC WITH db.version PROPERTY IN pom.xml
-INSERT INTO info VALUES ('2.1.0');
+INSERT INTO info VALUES ('2.2.0');
diff --git a/db-scripts/src/main/resources/migration.sql b/db-scripts/src/main/resources/migration.sql
index 55f02de445a..fa1d5fcc4d2 100644
--- a/db-scripts/src/main/resources/migration.sql
+++ b/db-scripts/src/main/resources/migration.sql
@@ -267,3 +267,29 @@ UPDATE info SET DB_SCHEMA_VERSION="2.0.1";
ALTER TABLE `cancer_study` MODIFY COLUMN `TYPE_OF_CANCER_ID` varchar(63) NOT NULL;
ALTER TABLE `sample` MODIFY COLUMN `TYPE_OF_CANCER_ID` varchar(63) NOT NULL;
UPDATE info SET DB_SCHEMA_VERSION="2.1.0";
+
+##version: 2.2.0
+CREATE TABLE `mutation_count_by_keyword` (
+ `GENETIC_PROFILE_ID` int(11) NOT NULL,
+ `KEYWORD` varchar(50) DEFAULT NULL,
+ `ENTREZ_GENE_ID` int(11) NOT NULL,
+ `KEYWORD_COUNT` int NOT NULL,
+ `GENE_COUNT` int NOT NULL,
+ KEY (`GENETIC_PROFILE_ID`,`KEYWORD`),
+ FOREIGN KEY (`GENETIC_PROFILE_ID`) REFERENCES `genetic_profile` (`GENETIC_PROFILE_ID`) ON DELETE CASCADE,
+ FOREIGN KEY (`ENTREZ_GENE_ID`) REFERENCES `gene` (`ENTREZ_GENE_ID`) ON DELETE CASCADE
+);
+
+INSERT INTO mutation_count_by_keyword
+ SELECT g2.`GENETIC_PROFILE_ID`, mutation_event.`KEYWORD`, m2.`ENTREZ_GENE_ID`,
+ IF(mutation_event.`KEYWORD` IS NULL, 0, COUNT(*)) AS KEYWORD_COUNT,
+ (SELECT COUNT(*) FROM `mutation` AS m1 , `genetic_profile` AS g1
+ WHERE m1.`GENETIC_PROFILE_ID` = g1.`GENETIC_PROFILE_ID`
+ AND g1.`GENETIC_PROFILE_ID`= g2.`GENETIC_PROFILE_ID` AND m1.`ENTREZ_GENE_ID` = m2.`ENTREZ_GENE_ID`
+ GROUP BY g1.`GENETIC_PROFILE_ID` , m1.`ENTREZ_GENE_ID`) AS GENE_COUNT
+ FROM `mutation` AS m2 , `genetic_profile` AS g2 , `mutation_event`
+ WHERE m2.`GENETIC_PROFILE_ID` = g2.`GENETIC_PROFILE_ID`
+ AND m2.`MUTATION_EVENT_ID` = mutation_event.`MUTATION_EVENT_ID`
+ AND g2.`GENETIC_ALTERATION_TYPE` = 'MUTATION_EXTENDED'
+ GROUP BY g2.`GENETIC_PROFILE_ID` , mutation_event.`KEYWORD` , m2.`ENTREZ_GENE_ID`;
+UPDATE info SET DB_SCHEMA_VERSION="2.2.0";
\ No newline at end of file
diff --git a/docs/Customizing-your-instance-of-cBioPortal.md b/docs/Customizing-your-instance-of-cBioPortal.md
index 69f705e31e4..1daf13eb6eb 100644
--- a/docs/Customizing-your-instance-of-cBioPortal.md
+++ b/docs/Customizing-your-instance-of-cBioPortal.md
@@ -259,6 +259,6 @@ If your documentation contains a relative link, cBioPortal will assume it uses t
Please be aware that the links may be case-sensitive! E.g. https://github.com/cBioPortal/cbioportal/wiki/News.md is not the same as https://github.com/cBioPortal/cbioportal/wiki/news.md
# Custom styling of the patient view's clinical data
-The [Patient View](http://www.cbioportal.org/case.do?cancer_study_id=lgg_ucsf_2014&case_id=P04) shows several [clinical attributes](File-Formats.md#clinical-data) at the top of the page, e.g. `AGE`, `SEX`:
+The [Patient View](http://www.cbioportal.org/case.do#/patient?studyId=lgg_ucsf_2014&caseId=P04) shows several [clinical attributes](File-Formats.md#clinical-data) at the top of the page, e.g. `AGE`, `SEX`:
![test](../test/end-to-end/screenshots/firefox/patient_view_lgg_ucsf_2014_case_id_P04.png)
The order, styling and visibility of those [attributes](File-Formats.md#clinical-data) at the top can be changed by editing the [patient view's clinical attributes CSS file](../portal/src/main/webapp/css/patient-view/clinical-attributes.css).
diff --git a/docs/File-Formats.md b/docs/File-Formats.md
index 34604e277a3..8ad7cff9be6 100644
--- a/docs/File-Formats.md
+++ b/docs/File-Formats.md
@@ -145,7 +145,7 @@ Following the metadata rows comes a tab delimited list of clinical attributes (c
The file containing the patient attributes has one **required** column:
- **PATIENT_ID (required)**: a unique patient ID.
-The following columns are used by the study view as well as the patient view. In the [study view](http://www.cbioportal.org/study?id=brca_tcga) they are used to create the survival plots. In the patient view they are used to add information to the [header](http://www.cbioportal.org/case.do?cancer_study_id=lgg_ucsf_2014&case_id=P05).
+The following columns are used by the study view as well as the patient view. In the [study view](http://www.cbioportal.org/study?id=brca_tcga) they are used to create the survival plots. In the patient view they are used to add information to the [header](http://www.cbioportal.org/case.do#/patient?studyId=lgg_ucsf_2014&caseId=P05).
- **OS_STATUS**: Overall patient survival status
- Possible values: DECEASED, LIVING
- In the patient view, LIVING creates a green label, DECEASED a red label.
@@ -181,7 +181,7 @@ The file containing the sample attributes has two **required** columns:
- **PATIENT_ID (required)**: A patient ID.
- **SAMPLE_ID (required)**: A sample ID.
-By adding `PATIENT_ID` here, cBioPortal will map the given sample to this patient. This enables one to associate multiple samples to one patient. For example, a single patient may have had multiple biopsies, each of which has been genomically profiled. See [this example for a patient with multiple samples](http://www.cbioportal.org/case.do?cancer_study_id=lgg_ucsf_2014&case_id=P04).
+By adding `PATIENT_ID` here, cBioPortal will map the given sample to this patient. This enables one to associate multiple samples to one patient. For example, a single patient may have had multiple biopsies, each of which has been genomically profiled. See [this example for a patient with multiple samples](http://www.cbioportal.org/case.do#/patient?studyId=lgg_ucsf_2014&caseId=P04).
The following columns are required if you want the [pan-cancer summary statistics tab in a pan-cancer study](http://www.cbioportal.org/index.do?cancer_study_list=cellline_ccle_broad&cancer_study_id=cellline_ccle_broad&genetic_profile_ids_PROFILE_MUTATION_EXTENDED=cellline_ccle_broad_mutations&genetic_profile_ids_PROFILE_COPY_NUMBER_ALTERATION=cellline_ccle_broad_CNA&Z_SCORE_THRESHOLD=2.0&data_priority=0&case_set_id=cellline_ccle_broad_cnaseq&case_ids=&patient_case_select=sample&gene_set_choice=prostate-cancer%3A-ar-signaling-%2810-genes%29&gene_list=SOX9+RAN+TNK2+EP300+PXN+NCOA2+AR+NRIP1+NCOR1+NCOR2&clinical_param_selection=null&tab_index=tab_visualize&Action=Submit#pancancer_study_summary):
- **CANCER_TYPE**: Cancer Type
@@ -325,7 +325,7 @@ The log2 copy number data file follows the same format as expression data files.
## Segmented Data
-A SEG file (segmented data; .seg or .cbs) is a tab-delimited text file that lists loci and associated numeric values. The segmented data file format is the output of the Circular Binary Segmentation algorithm (Olshen et al., 2004). **Segment data for import into the cBioPortal should be based on build 37 (hg19)**. This Segment data enables the 'CNA' lane in the Genomic overview of the Patient view (as [can be seen in this example](http://www.cbioportal.org/case.do?sample_id=TCGA-BH-A0E6-01&cancer_study_id=brca_tcga)).
+A SEG file (segmented data; .seg or .cbs) is a tab-delimited text file that lists loci and associated numeric values. The segmented data file format is the output of the Circular Binary Segmentation algorithm (Olshen et al., 2004). **Segment data for import into the cBioPortal should be based on build 37 (hg19)**. This Segment data enables the 'CNA' lane in the Genomic overview of the Patient view (as [can be seen in this example](http://www.cbioportal.org/case.do#/patient?sampleId=TCGA-BH-A0E6-01&studyId=brca_tcga)).
#### Meta file
The segmented metadata file should contain the following fields:
diff --git a/docs/News.md b/docs/News.md
index 24fd50c3816..4f4663fc96c 100644
--- a/docs/News.md
+++ b/docs/News.md
@@ -91,7 +91,7 @@
# January 12, 2016
* **New features**:
* Visualization of multiple samples in a patient
- * Visualization of timeline data of a patient ([example](http://www.cbioportal.org/case.do?cancer_study_id=lgg_ucsf_2014&case_id=P04))
+ * Visualization of timeline data of a patient ([example](http://www.cbioportal.org/case.do#/patient?studyId=lgg_ucsf_2014&caseId=P04))
![timeline-example](https://cloud.githubusercontent.com/assets/840895/12055606/cca26160-aefc-11e5-93f9-2ecfe7e95caf.png)
* All **TCGA data** updated to the latest Firehose run of August 21, 2015
* **New TCGA studies**:
@@ -321,7 +321,7 @@
* Multi-gene correlation plots.
* Variant allele frequency distribution plots for individual tumor samples.
-* Tissue images for TCGA samples in the patient view, via [Digital Slide Archive](http://cancer.digitalslidearchive.net/). [Example](http://www.cbioportal.org/case.do?cancer_study_id=ucec_tcga&case_id=TCGA-BK-A0CC#tab_images).
+* Tissue images for TCGA samples in the patient view, via [Digital Slide Archive](http://cancer.digitalslidearchive.net/). [Example](http://www.cbioportal.org/case.do#/patient?studyId=ucec_tcga&caseId=TCGA-BK-A0CC&tab=tissueImageTab).
# July 16, 2013
diff --git a/model/pom.xml b/model/pom.xml
index 5f2c7f80cdd..0b18ddaed79 100644
--- a/model/pom.xml
+++ b/model/pom.xml
@@ -5,7 +5,7 @@
masterorg.mskcc.cbio
- 1.5.2
+ 1.6.04.0.0
diff --git a/model/src/main/java/org/cbioportal/model/ClinicalAttribute.java b/model/src/main/java/org/cbioportal/model/ClinicalAttribute.java
index ca5622c5e15..e1be7cba0c4 100644
--- a/model/src/main/java/org/cbioportal/model/ClinicalAttribute.java
+++ b/model/src/main/java/org/cbioportal/model/ClinicalAttribute.java
@@ -11,7 +11,7 @@ public class ClinicalAttribute implements Serializable {
private Boolean patientAttribute;
private String priority;
private Integer cancerStudyId;
- private CancerStudy cancerStudy;
+ private String cancerStudyIdentifier;
public String getAttrId() {
return attrId;
@@ -69,11 +69,11 @@ public void setCancerStudyId(Integer cancerStudyId) {
this.cancerStudyId = cancerStudyId;
}
- public CancerStudy getCancerStudy() {
- return cancerStudy;
+ public String getCancerStudyIdentifier() {
+ return cancerStudyIdentifier;
}
- public void setCancerStudy(CancerStudy cancerStudy) {
- this.cancerStudy = cancerStudy;
+ public void setCancerStudyIdentifier(String cancerStudyIdentifier) {
+ this.cancerStudyIdentifier = cancerStudyIdentifier;
}
}
diff --git a/model/src/main/java/org/cbioportal/model/MutationCount.java b/model/src/main/java/org/cbioportal/model/MutationCount.java
new file mode 100644
index 00000000000..f25b74a4bbd
--- /dev/null
+++ b/model/src/main/java/org/cbioportal/model/MutationCount.java
@@ -0,0 +1,34 @@
+package org.cbioportal.model;
+
+import java.io.Serializable;
+
+public class MutationCount implements Serializable {
+
+ private String geneticProfileId;
+ private String sampleId;
+ private Integer mutationCount;
+
+ public String getGeneticProfileId() {
+ return geneticProfileId;
+ }
+
+ public void setGeneticProfileId(String geneticProfileId) {
+ this.geneticProfileId = geneticProfileId;
+ }
+
+ public String getSampleId() {
+ return sampleId;
+ }
+
+ public void setSampleId(String sampleId) {
+ this.sampleId = sampleId;
+ }
+
+ public Integer getMutationCount() {
+ return mutationCount;
+ }
+
+ public void setMutationCount(Integer mutationCount) {
+ this.mutationCount = mutationCount;
+ }
+}
diff --git a/persistence/persistence-api/pom.xml b/persistence/persistence-api/pom.xml
index 933053da9bc..30716c69e18 100644
--- a/persistence/persistence-api/pom.xml
+++ b/persistence/persistence-api/pom.xml
@@ -5,7 +5,7 @@
persistenceorg.mskcc.cbio
- 1.5.2
+ 1.6.04.0.0
diff --git a/persistence/persistence-api/src/main/java/org/cbioportal/persistence/ClinicalAttributeRepository.java b/persistence/persistence-api/src/main/java/org/cbioportal/persistence/ClinicalAttributeRepository.java
new file mode 100644
index 00000000000..dc7194c59e0
--- /dev/null
+++ b/persistence/persistence-api/src/main/java/org/cbioportal/persistence/ClinicalAttributeRepository.java
@@ -0,0 +1,21 @@
+package org.cbioportal.persistence;
+
+import org.cbioportal.model.ClinicalAttribute;
+import org.cbioportal.model.meta.BaseMeta;
+
+import java.util.List;
+
+public interface ClinicalAttributeRepository {
+
+ List getAllClinicalAttributes(String projection, Integer pageSize, Integer pageNumber,
+ String sortBy, String direction);
+
+ BaseMeta getMetaClinicalAttributes();
+
+ ClinicalAttribute getClinicalAttribute(String studyId, String clinicalAttributeId);
+
+ List getAllClinicalAttributesInStudy(String studyId, String projection, Integer pageSize,
+ Integer pageNumber, String sortBy, String direction);
+
+ BaseMeta getMetaClinicalAttributesInStudy(String studyId);
+}
diff --git a/persistence/persistence-api/src/main/java/org/cbioportal/persistence/DiscreteCopyNumberRepository.java b/persistence/persistence-api/src/main/java/org/cbioportal/persistence/DiscreteCopyNumberRepository.java
index ebd25215c89..5a36b0b836b 100644
--- a/persistence/persistence-api/src/main/java/org/cbioportal/persistence/DiscreteCopyNumberRepository.java
+++ b/persistence/persistence-api/src/main/java/org/cbioportal/persistence/DiscreteCopyNumberRepository.java
@@ -8,12 +8,14 @@
public interface DiscreteCopyNumberRepository {
- List getDiscreteCopyNumbersInGeneticProfile(String geneticProfileId, String sampleId,
- List alterations, String projection);
+ List getDiscreteCopyNumbersInGeneticProfileBySampleListId(String geneticProfileId,
+ String sampleListId,
+ List alterations,
+ String projection);
- BaseMeta getMetaDiscreteCopyNumbersInGeneticProfile(String geneticProfileId, String sampleId,
- List alterations);
+ BaseMeta getMetaDiscreteCopyNumbersInGeneticProfileBySampleListId(String geneticProfileId, String sampleListId,
+ List alterations);
List fetchDiscreteCopyNumbersInGeneticProfile(String geneticProfileId,
List sampleIds,
diff --git a/persistence/persistence-api/src/main/java/org/cbioportal/persistence/MutationRepository.java b/persistence/persistence-api/src/main/java/org/cbioportal/persistence/MutationRepository.java
index 72535d142f0..b92ccda4dc7 100644
--- a/persistence/persistence-api/src/main/java/org/cbioportal/persistence/MutationRepository.java
+++ b/persistence/persistence-api/src/main/java/org/cbioportal/persistence/MutationRepository.java
@@ -1,6 +1,7 @@
package org.cbioportal.persistence;
import org.cbioportal.model.Mutation;
+import org.cbioportal.model.MutationCount;
import org.cbioportal.model.MutationSampleCountByGene;
import org.cbioportal.model.MutationSampleCountByKeyword;
import org.cbioportal.model.meta.BaseMeta;
@@ -10,19 +11,27 @@
public interface MutationRepository {
- List getMutationsInGeneticProfile(String geneticProfileId, String sampleId, String projection,
- Integer pageSize, Integer pageNumber, String sortBy, String direction);
+ List getMutationsInGeneticProfileBySampleListId(String geneticProfileId, String sampleListId,
+ List entrezGeneIds, String projection,
+ Integer pageSize, Integer pageNumber, String sortBy,
+ String direction);
- MutationMeta getMetaMutationsInGeneticProfile(String geneticProfileId, String sampleId);
+ MutationMeta getMetaMutationsInGeneticProfileBySampleListId(String geneticProfileId, String sampleListId,
+ List entrezGeneIds);
- List fetchMutationsInGeneticProfile(String geneticProfileId, List sampleIds,
- String projection, Integer pageSize, Integer pageNumber,
- String sortBy, String direction);
+ List fetchMutationsInGeneticProfile(String geneticProfileId, List sampleIds,
+ List entrezGeneIds, String projection, Integer pageSize,
+ Integer pageNumber, String sortBy, String direction);
- MutationMeta fetchMetaMutationsInGeneticProfile(String geneticProfileId, List sampleIds);
+ MutationMeta fetchMetaMutationsInGeneticProfile(String geneticProfileId, List sampleIds,
+ List entrezGeneIds);
List getSampleCountByEntrezGeneIds(String geneticProfileId, List entrezGeneIds);
List getSampleCountByKeywords(String geneticProfileId, List keywords);
+
+ List getMutationCountsInGeneticProfileBySampleListId(String geneticProfileId, String sampleListId);
+
+ List fetchMutationCountsInGeneticProfile(String geneticProfileId, List sampleIds);
}
diff --git a/persistence/persistence-mybatis/pom.xml b/persistence/persistence-mybatis/pom.xml
index 4bd0944900d..db98c2294d7 100644
--- a/persistence/persistence-mybatis/pom.xml
+++ b/persistence/persistence-mybatis/pom.xml
@@ -5,7 +5,7 @@
persistenceorg.mskcc.cbio
- 1.5.2
+ 1.6.04.0.0
diff --git a/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/ClinicalAttributeMapper.java b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/ClinicalAttributeMapper.java
index 050b4de07ba..2892b56c465 100644
--- a/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/ClinicalAttributeMapper.java
+++ b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/ClinicalAttributeMapper.java
@@ -1,4 +1,16 @@
package org.cbioportal.persistence.mybatis;
+import org.cbioportal.model.ClinicalAttribute;
+import org.cbioportal.model.meta.BaseMeta;
+
+import java.util.List;
+
public interface ClinicalAttributeMapper {
+
+ List getAllClinicalAttributes(String studyId, String projection, Integer limit, Integer offset,
+ String sortBy, String direction);
+
+ BaseMeta getMetaClinicalAttributes(String studyId);
+
+ ClinicalAttribute getClinicalAttribute(String studyId, String clinicalAttributeId, String projection);
}
diff --git a/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/ClinicalAttributeMyBatisRepository.java b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/ClinicalAttributeMyBatisRepository.java
new file mode 100644
index 00000000000..dba66b858d2
--- /dev/null
+++ b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/ClinicalAttributeMyBatisRepository.java
@@ -0,0 +1,57 @@
+package org.cbioportal.persistence.mybatis;
+
+import org.cbioportal.model.ClinicalAttribute;
+import org.cbioportal.model.meta.BaseMeta;
+import org.cbioportal.persistence.ClinicalAttributeRepository;
+import org.cbioportal.persistence.PersistenceConstants;
+import org.cbioportal.persistence.mybatis.util.OffsetCalculator;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class ClinicalAttributeMyBatisRepository implements ClinicalAttributeRepository {
+
+ @Autowired
+ private ClinicalAttributeMapper clinicalAttributeMapper;
+ @Autowired
+ private OffsetCalculator offsetCalculator;
+
+
+ @Override
+ public List getAllClinicalAttributes(String projection, Integer pageSize, Integer pageNumber,
+ String sortBy, String direction) {
+
+ return clinicalAttributeMapper.getAllClinicalAttributes(null, projection, pageSize,
+ offsetCalculator.calculate(pageSize, pageNumber), sortBy, direction);
+ }
+
+ @Override
+ public BaseMeta getMetaClinicalAttributes() {
+
+ return clinicalAttributeMapper.getMetaClinicalAttributes(null);
+ }
+
+ @Override
+ public ClinicalAttribute getClinicalAttribute(String studyId, String clinicalAttributeId) {
+
+ return clinicalAttributeMapper.getClinicalAttribute(studyId, clinicalAttributeId,
+ PersistenceConstants.DETAILED_PROJECTION);
+ }
+
+ @Override
+ public List getAllClinicalAttributesInStudy(String studyId, String projection, Integer pageSize,
+ Integer pageNumber, String sortBy,
+ String direction) {
+
+ return clinicalAttributeMapper.getAllClinicalAttributes(studyId, projection, pageSize,
+ offsetCalculator.calculate(pageSize, pageNumber), sortBy, direction);
+ }
+
+ @Override
+ public BaseMeta getMetaClinicalAttributesInStudy(String studyId) {
+
+ return clinicalAttributeMapper.getMetaClinicalAttributes(studyId);
+ }
+}
diff --git a/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMapper.java b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMapper.java
index 4ce4da819c6..af0ed7f909b 100644
--- a/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMapper.java
+++ b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMapper.java
@@ -7,13 +7,20 @@
import java.util.List;
public interface DiscreteCopyNumberMapper {
+
+ List getDiscreteCopyNumbersBySampleListId(String geneticProfileId, String sampleListId,
+ List entrezGeneIds,
+ List alterations, String projection);
+
+ BaseMeta getMetaDiscreteCopyNumbersBySampleListId(String geneticProfileId, String sampleListId,
+ List entrezGeneIds, List alterations);
- List getDiscreteCopyNumbers(String geneticProfileId, List sampleIds,
- List entrezGeneIds, List alterations,
- String projection);
+ List getDiscreteCopyNumbersBySampleIds(String geneticProfileId, List sampleIds,
+ List entrezGeneIds,
+ List alterations, String projection);
- BaseMeta getMetaDiscreteCopyNumbers(String geneticProfileId, List sampleIds, List entrezGeneIds,
- List alterations);
+ BaseMeta getMetaDiscreteCopyNumbersBySampleIds(String geneticProfileId, List sampleIds,
+ List entrezGeneIds, List alterations);
List getSampleCountByGeneAndAlteration(String geneticProfileId,
List entrezGeneIds,
diff --git a/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMyBatisRepository.java b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMyBatisRepository.java
index bfc2670f847..aa534a6f3b6 100644
--- a/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMyBatisRepository.java
+++ b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMyBatisRepository.java
@@ -17,20 +17,22 @@ public class DiscreteCopyNumberMyBatisRepository implements DiscreteCopyNumberRe
private DiscreteCopyNumberMapper discreteCopyNumberMapper;
@Override
- public List getDiscreteCopyNumbersInGeneticProfile(String geneticProfileId, String sampleId,
- List alterations,
- String projection) {
+ public List getDiscreteCopyNumbersInGeneticProfileBySampleListId(String geneticProfileId,
+ String sampleListId,
+ List alterations,
+ String projection) {
- return discreteCopyNumberMapper.getDiscreteCopyNumbers(geneticProfileId,
- sampleId == null ? null : Arrays.asList(sampleId), null, alterations, projection);
+ return discreteCopyNumberMapper.getDiscreteCopyNumbersBySampleListId(geneticProfileId, sampleListId, null,
+ alterations, projection);
}
@Override
- public BaseMeta getMetaDiscreteCopyNumbersInGeneticProfile(String geneticProfileId, String sampleId,
- List alterations) {
+ public BaseMeta getMetaDiscreteCopyNumbersInGeneticProfileBySampleListId(String geneticProfileId,
+ String sampleListId,
+ List alterations) {
- return discreteCopyNumberMapper.getMetaDiscreteCopyNumbers(geneticProfileId,
- sampleId == null ? null : Arrays.asList(sampleId), null, alterations);
+ return discreteCopyNumberMapper.getMetaDiscreteCopyNumbersBySampleListId(geneticProfileId, sampleListId, null,
+ alterations);
}
@Override
@@ -40,8 +42,8 @@ public List fetchDiscreteCopyNumbersInGeneticProfile(Str
List alterations,
String projection) {
- return discreteCopyNumberMapper.getDiscreteCopyNumbers(geneticProfileId, sampleIds, entrezGeneIds, alterations,
- projection);
+ return discreteCopyNumberMapper.getDiscreteCopyNumbersBySampleIds(geneticProfileId, sampleIds, entrezGeneIds,
+ alterations, projection);
}
@Override
@@ -49,8 +51,8 @@ public BaseMeta fetchMetaDiscreteCopyNumbersInGeneticProfile(String geneticProfi
List entrezGeneIds,
List alterations) {
- return discreteCopyNumberMapper.getMetaDiscreteCopyNumbers(geneticProfileId, sampleIds, entrezGeneIds,
- alterations);
+ return discreteCopyNumberMapper.getMetaDiscreteCopyNumbersBySampleIds(geneticProfileId, sampleIds,
+ entrezGeneIds, alterations);
}
@Override
diff --git a/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/MutationMapper.java b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/MutationMapper.java
index ae134648b4f..0265aa026ae 100644
--- a/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/MutationMapper.java
+++ b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/MutationMapper.java
@@ -1,6 +1,7 @@
package org.cbioportal.persistence.mybatis;
import org.cbioportal.model.Mutation;
+import org.cbioportal.model.MutationCount;
import org.cbioportal.model.MutationSampleCountByGene;
import org.cbioportal.model.MutationSampleCountByKeyword;
import org.cbioportal.model.meta.BaseMeta;
@@ -10,12 +11,25 @@
public interface MutationMapper {
- List getMutations(String geneticProfileId, List sampleIds, String projection, Integer limit,
- Integer offset, String sortBy, String direction);
+ List getMutationsBySampleListId(String geneticProfileId, String sampleListId, List entrezGeneIds,
+ String projection, Integer limit, Integer offset, String sortBy,
+ String direction);
- MutationMeta getMetaMutations(String geneticProfileId, List sampleIds);
+ MutationMeta getMetaMutationsBySampleListId(String geneticProfileId, String sampleListId,
+ List entrezGeneIds);
+
+ List getMutationsBySampleIds(String geneticProfileId, List sampleIds, List entrezGeneIds,
+ String projection, Integer limit, Integer offset, String sortBy,
+ String direction);
+
+ MutationMeta getMetaMutationsBySampleIds(String geneticProfileId, List sampleIds,
+ List entrezGeneIds);
List getSampleCountByEntrezGeneIds(String geneticProfileId, List entrezGeneIds);
List getSampleCountByKeywords(String geneticProfileId, List keywords);
+
+ List getMutationCountsBySampleListId(String geneticProfileId, String sampleListId);
+
+ List getMutationCountsBySampleIds(String geneticProfileId, List sampleIds);
}
diff --git a/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepository.java b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepository.java
index 4691b2063a7..f30c5041b73 100644
--- a/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepository.java
+++ b/persistence/persistence-mybatis/src/main/java/org/cbioportal/persistence/mybatis/MutationMyBatisRepository.java
@@ -1,16 +1,15 @@
package org.cbioportal.persistence.mybatis;
import org.cbioportal.model.Mutation;
+import org.cbioportal.model.MutationCount;
import org.cbioportal.model.MutationSampleCountByGene;
import org.cbioportal.model.MutationSampleCountByKeyword;
-import org.cbioportal.model.meta.BaseMeta;
import org.cbioportal.model.meta.MutationMeta;
import org.cbioportal.persistence.MutationRepository;
import org.cbioportal.persistence.mybatis.util.OffsetCalculator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
-import java.util.Arrays;
import java.util.List;
@Repository
@@ -22,33 +21,37 @@ public class MutationMyBatisRepository implements MutationRepository {
private OffsetCalculator offsetCalculator;
@Override
- public List getMutationsInGeneticProfile(String geneticProfileId, String sampleId, String projection,
- Integer pageSize, Integer pageNumber, String sortBy,
- String direction) {
+ public List getMutationsInGeneticProfileBySampleListId(String geneticProfileId, String sampleListId,
+ List entrezGeneIds, String projection,
+ Integer pageSize, Integer pageNumber,
+ String sortBy, String direction) {
- return mutationMapper.getMutations(geneticProfileId, sampleId == null ? null : Arrays.asList(sampleId),
- projection, pageSize, offsetCalculator.calculate(pageSize, pageNumber), sortBy, direction);
+ return mutationMapper.getMutationsBySampleListId(geneticProfileId, sampleListId, entrezGeneIds, projection,
+ pageSize, offsetCalculator.calculate(pageSize, pageNumber), sortBy, direction);
}
@Override
- public MutationMeta getMetaMutationsInGeneticProfile(String geneticProfileId, String sampleId) {
+ public MutationMeta getMetaMutationsInGeneticProfileBySampleListId(String geneticProfileId, String sampleListId,
+ List entrezGeneIds) {
- return mutationMapper.getMetaMutations(geneticProfileId, sampleId == null ? null : Arrays.asList(sampleId));
+ return mutationMapper.getMetaMutationsBySampleListId(geneticProfileId, sampleListId, entrezGeneIds);
}
@Override
- public List fetchMutationsInGeneticProfile(String geneticProfileId, List sampleIds,
- String projection, Integer pageSize, Integer pageNumber,
- String sortBy, String direction) {
+ public List fetchMutationsInGeneticProfile(String geneticProfileId, List sampleIds,
+ List entrezGeneIds, String projection,
+ Integer pageSize, Integer pageNumber, String sortBy,
+ String direction) {
- return mutationMapper.getMutations(geneticProfileId, sampleIds, projection, pageSize,
+ return mutationMapper.getMutationsBySampleIds(geneticProfileId, sampleIds, entrezGeneIds, projection, pageSize,
offsetCalculator.calculate(pageSize, pageNumber), sortBy, direction);
}
@Override
- public MutationMeta fetchMetaMutationsInGeneticProfile(String geneticProfileId, List sampleIds) {
+ public MutationMeta fetchMetaMutationsInGeneticProfile(String geneticProfileId, List sampleIds,
+ List entrezGeneIds) {
- return mutationMapper.getMetaMutations(geneticProfileId, sampleIds);
+ return mutationMapper.getMetaMutationsBySampleIds(geneticProfileId, sampleIds, entrezGeneIds);
}
@Override
@@ -63,4 +66,17 @@ public List getSampleCountByKeywords(String geneti
return mutationMapper.getSampleCountByKeywords(geneticProfileId, keywords);
}
+
+ @Override
+ public List getMutationCountsInGeneticProfileBySampleListId(String geneticProfileId,
+ String sampleListId) {
+
+ return mutationMapper.getMutationCountsBySampleListId(geneticProfileId, sampleListId);
+ }
+
+ @Override
+ public List fetchMutationCountsInGeneticProfile(String geneticProfileId, List sampleIds) {
+
+ return mutationMapper.getMutationCountsBySampleIds(geneticProfileId, sampleIds);
+ }
}
diff --git a/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/ClinicalAttributeMapper.xml b/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/ClinicalAttributeMapper.xml
index 5f1c611d3f0..5f5c5a39625 100644
--- a/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/ClinicalAttributeMapper.xml
+++ b/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/ClinicalAttributeMapper.xml
@@ -5,7 +5,8 @@
- clinical_attribute_meta.ATTR_ID AS "${prefix}attrId"
+ clinical_attribute_meta.ATTR_ID AS "${prefix}attrId",
+ cancer_study.CANCER_STUDY_IDENTIFIER AS "${prefix}cancerStudyIdentifier"
,
clinical_attribute_meta.DISPLAY_NAME AS "${prefix}displayName",
@@ -16,4 +17,47 @@
clinical_attribute_meta.CANCER_STUDY_ID AS "${prefix}cancerStudyId"
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMapper.xml b/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMapper.xml
index 5cb7270fb39..f98fb0e4e5f 100644
--- a/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMapper.xml
+++ b/persistence/persistence-mybatis/src/main/resources/org/cbioportal/persistence/mybatis/DiscreteCopyNumberMapper.xml
@@ -48,7 +48,48 @@
-
\ No newline at end of file
+Patient view of an endometrial cancer case
+
diff --git a/portal/src/main/resources/content/examples_prostate.markdown b/portal/src/main/resources/content/examples_prostate.markdown
index 996e45604c9..8980d451f0e 100644
--- a/portal/src/main/resources/content/examples_prostate.markdown
+++ b/portal/src/main/resources/content/examples_prostate.markdown
@@ -3,5 +3,5 @@
-A TCGA Prostate Adenocarcinoma Case
-
\ No newline at end of file
+A TCGA Prostate Adenocarcinoma Case
+
diff --git a/portal/src/main/resources/content/examples_tcga.markdown b/portal/src/main/resources/content/examples_tcga.markdown
index 354886ef121..99fea8bb8a2 100644
--- a/portal/src/main/resources/content/examples_tcga.markdown
+++ b/portal/src/main/resources/content/examples_tcga.markdown
@@ -13,7 +13,7 @@
-Patient view of an endometrial cancer case
+Patient view of an endometrial cancer case
diff --git a/portal/src/main/resources/content/news.markdown b/portal/src/main/resources/content/news.markdown
index 53db3653742..5cf2b397ea3 100644
--- a/portal/src/main/resources/content/news.markdown
+++ b/portal/src/main/resources/content/news.markdown
@@ -172,7 +172,7 @@
* Multi-gene correlation plots.
* Variant allele frequency distribution plots for individual tumor samples.
-* Tissue images for TCGA samples in the patient view, via [Digital Slide Archive](http://cancer.digitalslidearchive.net/). [Example](case.do?cancer_study_id=ucec_tcga&case_id=TCGA-BK-A0CC#images).
+* Tissue images for TCGA samples in the patient view, via [Digital Slide Archive](http://cancer.digitalslidearchive.net/). [Example](case.do#/patient?studyId=ucec_tcga&caseId=TCGA-BK-A0CC&tab=tissueImageTab).
# July 16, 2013
@@ -344,4 +344,4 @@ only view amplifications of EGFR, and ignore deletions.
* Official release of our [Web Interface](web_api.jsp), enabling programmatic access to all data.
* Official release of our [R Package](cgds_r.jsp), enabling programmatic access to all data from the R platform for statistical computing.
-
![OncoPrints](images/previews/gbm_oncoprint.png)
\ No newline at end of file
+
![OncoPrints](images/previews/gbm_oncoprint.png)
diff --git a/portal/src/main/resources/content/news_prostate.markdown b/portal/src/main/resources/content/news_prostate.markdown
index 5aa176e1714..17f1fc4909a 100644
--- a/portal/src/main/resources/content/news_prostate.markdown
+++ b/portal/src/main/resources/content/news_prostate.markdown
@@ -42,8 +42,8 @@
* Multi-gene correlation plots.
* Variant allele frequency distribution plots for individual tumor samples.
-* Tissue images for TCGA samples in the patient view, via [Digital Slide Archive](http://cancer.digitalslidearchive.net/). [Example](case.do?cancer_study_id=prad_tcga&case_id=TCGA-CH-5788#images).
-* Support for multiple tumor samples for a single patient. [Example](case.do?cancer_study_id=prad_mich&case_id=WA43).
+* Tissue images for TCGA samples in the patient view, via [Digital Slide Archive](http://cancer.digitalslidearchive.net/). [Example](case.do#/patient?studyId=prad_tcga&caseId=TCGA-CH-5788&tab=tissueImageTab).
+* Support for multiple tumor samples for a single patient. [Example](case.do#/patient?studyId=prad_mich&caseId=WA43).
# July 16, 2013
@@ -70,4 +70,4 @@
- Barbieri et al. (Broad/Cornell) - 112 primary tumors
- Grasso et al. (Michigan) - 61 metastatic and 11 primary tumors
- Taylor et al. (MSKCC) - 181 primary and 37 metastatic tumors
- - SU2C prostate study - 1 case.
\ No newline at end of file
+ - SU2C prostate study - 1 case.
diff --git a/portal/src/main/resources/content/news_tcga.markdown b/portal/src/main/resources/content/news_tcga.markdown
index 3af85432a59..90e736a5377 100644
--- a/portal/src/main/resources/content/news_tcga.markdown
+++ b/portal/src/main/resources/content/news_tcga.markdown
@@ -82,7 +82,7 @@
* Multi-gene correlation plots.
* Variant allele frequency distribution plots for individual tumor samples.
-* Tissue images for TCGA samples in the patient view, via [Digital Slide Archive](http://cancer.digitalslidearchive.net/). [Example](case.do?cancer_study_id=ucec_tcga&case_id=TCGA-BK-A0CC#images).
+* Tissue images for TCGA samples in the patient view, via [Digital Slide Archive](http://cancer.digitalslidearchive.net/). [Example](case.do#/patient?studyId=ucec_tcga&caseId=TCGA-BK-A0CC&tab=tissueImageTab).
# July 16, 2013
diff --git a/portal/src/main/webapp/WEB-INF/jsp/global/css_include.jsp b/portal/src/main/webapp/WEB-INF/jsp/global/css_include.jsp
index 24ed12a32ef..27da28d4afe 100644
--- a/portal/src/main/webapp/WEB-INF/jsp/global/css_include.jsp
+++ b/portal/src/main/webapp/WEB-INF/jsp/global/css_include.jsp
@@ -52,7 +52,7 @@
-
+
<%
String authenticationMethod = GlobalProperties.authenticationMethod();
String global_style = GlobalProperties.getProperty("global_css");
diff --git a/portal/src/main/webapp/WEB-INF/jsp/global/css_include_standard.jsp b/portal/src/main/webapp/WEB-INF/jsp/global/css_include_standard.jsp
index 1a3f1a1c367..cc86b290a33 100644
--- a/portal/src/main/webapp/WEB-INF/jsp/global/css_include_standard.jsp
+++ b/portal/src/main/webapp/WEB-INF/jsp/global/css_include_standard.jsp
@@ -45,7 +45,7 @@
-
+
<%
String global_style = GlobalProperties.getProperty("global_css");
String special_style = GlobalProperties.getProperty("special_css");
diff --git a/portal/src/main/webapp/WEB-INF/jsp/global/header.jsp b/portal/src/main/webapp/WEB-INF/jsp/global/header.jsp
index 5e382180d23..f9f1d14ffbe 100644
--- a/portal/src/main/webapp/WEB-INF/jsp/global/header.jsp
+++ b/portal/src/main/webapp/WEB-INF/jsp/global/header.jsp
@@ -37,7 +37,7 @@
<%@ page import="org.mskcc.cbio.portal.util.GlobalProperties" %>
-
+
@@ -70,13 +70,17 @@
<%= request.getAttribute(QueryBuilder.HTML_TITLE)%>
-
-
-
\ No newline at end of file
+
diff --git a/portal/src/main/webapp/content/examples_genie.html b/portal/src/main/webapp/content/examples_genie.html
index 68d0cd9533a..8356de8f6c4 100644
--- a/portal/src/main/webapp/content/examples_genie.html
+++ b/portal/src/main/webapp/content/examples_genie.html
@@ -5,5 +5,5 @@
-A TCGA Prostate Adenocarcinoma Case
-
\ No newline at end of file
+A TCGA Prostate Adenocarcinoma Case
+
diff --git a/portal/src/main/webapp/content/examples_tcga.html b/portal/src/main/webapp/content/examples_tcga.html
index c203a09c6e7..680640384c1 100644
--- a/portal/src/main/webapp/content/examples_tcga.html
+++ b/portal/src/main/webapp/content/examples_tcga.html
@@ -13,5 +13,5 @@
-Patient view of an endometrial cancer case
-
\ No newline at end of file
+Patient view of an endometrial cancer case
+
diff --git a/portal/src/main/webapp/content/news.html b/portal/src/main/webapp/content/news.html
index b5bcbfbb4bf..b50e586eb71 100644
--- a/portal/src/main/webapp/content/news.html
+++ b/portal/src/main/webapp/content/news.html
@@ -221,7 +221,7 @@
July 25, 2013
Multi-gene correlation plots.
Variant allele frequency distribution plots for individual tumor samples.
Support for multiple tumor samples for a single patient. Example.
July 16, 2013
@@ -83,4 +83,4 @@
January 25, 2013
SU2C prostate study - 1 case.
-
\ No newline at end of file
+
diff --git a/portal/src/main/webapp/content/news_tcga.html b/portal/src/main/webapp/content/news_tcga.html
index 83bd993228a..9fe21decb39 100644
--- a/portal/src/main/webapp/content/news_tcga.html
+++ b/portal/src/main/webapp/content/news_tcga.html
@@ -105,7 +105,7 @@
July 23, 2013
Multi-gene correlation plots.
Variant allele frequency distribution plots for individual tumor samples.
This is the initial release of the cBio TCGA Cancer Genomics Portal. The portal contains data from all completed and ongoing TCGA projects. All data is automatically imported from the output of the Broad Firehose.
-
This release includes data on 2531 samples from 11 tumor types.
\ No newline at end of file
+
This release includes data on 2531 samples from 11 tumor types.