forked from cBioPortal/cbioportal-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e0f5bc
commit f28bb81
Showing
11 changed files
with
458 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.{java,py}] | ||
indent_style = space | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Sample_Id Entrez_Gene_Id Hugo_Symbol Cell_Type Tissue Expression_Value | ||
SHAH_H000004_T09_01_WG01 TP53 CELLTYPE TISSUE 57.4 | ||
SHAH_H000004_T09_01_WG01 7157 CELLTYPE2 TISSUE 57.4 | ||
SAMPLE1 7157 TP53 CELLTYPE2 TISSUE 57.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cancer_study_identifier: msk_spectrum_tme_2022 | ||
genetic_alteration_type: SINGLE_CELL_EXPRESSION | ||
datatype: SINGLE_CELL_EXPRESSION | ||
stable_id: single_cell_expression | ||
show_profile_in_analysis_tab: false | ||
profile_name: single cell expression | ||
profile_description: single cell expression test | ||
data_filename: data_single_cell_expression.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/org/mskcc/cbio/portal/dao/DaoSingleCellExpression.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright (c) 2024 The Hyve B.V. | ||
* This code is licensed under the GNU Affero General Public License (AGPL), | ||
* version 3, or (at your option) any later version. | ||
*/ | ||
|
||
/* | ||
* 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 <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/* | ||
* @author Matthijs Pon | ||
*/ | ||
|
||
package org.mskcc.cbio.portal.dao; | ||
|
||
import java.sql.*; | ||
import org.mskcc.cbio.portal.model.*; | ||
|
||
public class DaoSingleCellExpression { | ||
|
||
private DaoSingleCellExpression() { | ||
} | ||
|
||
public static void addSingleCellExpression(SingleCellExpression singleCellExpression) throws DaoException { | ||
Connection connection = null; | ||
PreparedStatement preparedStatement = null; | ||
ResultSet resultSet = null; | ||
|
||
try { | ||
// Open connection to database | ||
connection = JdbcUtil.getDbConnection(DaoGeneticProfileLink.class); | ||
|
||
// Prepare SQL statement | ||
preparedStatement = connection.prepareStatement("INSERT INTO single_cell_expression " | ||
+ "(GENETIC_PROFILE_ID, SAMPLE_ID, TISSUE, CELL_TYPE, ENTREZ_GENE_ID, EXPRESSION_VALUE) VALUES (?,?,?,?,?,?)"); | ||
// Fill in statement | ||
preparedStatement.setInt(1, singleCellExpression.getGeneticProfileId()); | ||
preparedStatement.setInt(2, singleCellExpression.getSampleId()); | ||
preparedStatement.setString(3, singleCellExpression.getTissue()); | ||
preparedStatement.setString(4, singleCellExpression.getCellType()); | ||
preparedStatement.setLong(5, singleCellExpression.getGene().getEntrezGeneId()); | ||
preparedStatement.setString(6, singleCellExpression.getExpressionValue()); | ||
|
||
// Execute statement | ||
preparedStatement.execute(); | ||
} catch (SQLException e) { | ||
throw new DaoException(e); | ||
} finally { | ||
JdbcUtil.closeAll(DaoGeneticProfileLink.class, connection, preparedStatement, resultSet); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
src/main/java/org/mskcc/cbio/portal/model/SingleCellExpression.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package org.mskcc.cbio.portal.model; | ||
|
||
public class SingleCellExpression { | ||
private int sampleId; | ||
private int geneticProfileId; | ||
private CanonicalGene gene; | ||
private String cellType; | ||
private String tissue; | ||
private String expressionValue; | ||
|
||
public SingleCellExpression(int sampleId, int geneticProfileId, CanonicalGene gene, String cellType, String tissue, | ||
String expressionValue) { | ||
this.sampleId = sampleId; | ||
this.geneticProfileId = geneticProfileId; | ||
this.gene = gene; | ||
this.cellType = cellType; | ||
this.tissue = tissue; | ||
this.expressionValue = expressionValue; | ||
} | ||
|
||
public int getSampleId() { | ||
return sampleId; | ||
} | ||
|
||
public void setSampleId(int sampleId) { | ||
this.sampleId = sampleId; | ||
} | ||
|
||
public int getGeneticProfileId() { | ||
return geneticProfileId; | ||
} | ||
|
||
public void setGeneticProfileId(int geneticProfileId) { | ||
this.geneticProfileId = geneticProfileId; | ||
} | ||
|
||
public CanonicalGene getGene() { | ||
return gene; | ||
} | ||
|
||
public void setGene(CanonicalGene gene) { | ||
this.gene = gene; | ||
} | ||
|
||
public String getCellType() { | ||
return cellType; | ||
} | ||
|
||
public void setCellType(String cellType) { | ||
this.cellType = cellType; | ||
} | ||
|
||
public String getTissue() { | ||
return tissue; | ||
} | ||
|
||
public void setTissue(String tissue) { | ||
this.tissue = tissue; | ||
} | ||
|
||
public String getExpressionValue() { | ||
return expressionValue; | ||
} | ||
|
||
public void setExpressionValue(String expressionValue) { | ||
this.expressionValue = expressionValue; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.