diff --git a/src/client/ch/epfl/lca1/medco/MedCoLoadingClient.java b/src/client/ch/epfl/lca1/medco/MedCoLoadingClient.java deleted file mode 100644 index 899733b..0000000 --- a/src/client/ch/epfl/lca1/medco/MedCoLoadingClient.java +++ /dev/null @@ -1,457 +0,0 @@ -package ch.epfl.lca1.medco; - -import ch.epfl.lca1.medco.dao.MedCoDatabase; -import ch.epfl.lca1.medco.loader.DataType; -import ch.epfl.lca1.medco.util.MedCoUtil; -import ch.epfl.lca1.medco.util.exceptions.UnlynxException; -import com.opencsv.CSVReader; -import edu.harvard.i2b2.common.exception.I2B2Exception; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.postgresql.ds.PGSimpleDataSource; - -import java.io.FileReader; -import java.io.IOException; -import java.util.*; - -/** - * Created by misbach on 15.07.17. - */ -public class MedCoLoadingClient { - - public static void main(String[] args) throws InterruptedException, I2B2Exception, IOException, UnlynxException { - - Logger.getRootLogger().setLevel(Level.INFO); - - // rerun for each dataset setting: - //loadStandardDataset("quarter"); //quadruple, double, normal, half, quarter - //loadClearDataset("quadruple"); - //System.out.println(StopWatch.misc.prettyPrint()); - //loadFullGenomicClearOntology(); - loadProfileManyNode(); - } - - public static void loadFullGenomicClearOntology() throws I2B2Exception, IOException { - loadSrv5Conf(); - String - dir = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/"; - - MedCoDatabase dao = new MedCoDatabase(); - CSVReader genomicReader = new CSVReader(new FileReader(dir + "data_mutations_extended_skcm_broad_clear_i2b2.txt"), '\t', '\u0000', 0); - String[] genomicHeader = genomicReader.readNext(); - - String[] genomicEntry; - int count = 0; - while ((genomicEntry = genomicReader.readNext()) != null) { - try { - - // ontology entry - dao.batchSqlStatements.add( - "insert into i2b2metadata.clinical_non_sensitive" + - "(c_hlevel, c_fullname, c_name, c_synonym_cd, c_visualattributes, c_basecode, c_facttablecolumn, c_tablename, c_columnname, c_columndatatype, c_operator, c_dimcode, update_date, valuetype_cd, m_applied_path) values(" + - "'4', '\\medco\\clinical\\nonsensitive\\VARIANT_ID\\" + genomicEntry[2] + "\\', '" + genomicEntry[2] + "', 'N', 'LA', '" + genomicEntry[2] + "', 'concept_cd', 'concept_dimension', 'concept_path', 'T', 'LIKE', " + - "'\\medco\\clinical\\nonsensitive\\VARIANT_ID\\" + genomicEntry[2] + "\\', now(), 'MEDCO_CLEAR', '@') ON CONFLICT DO NOTHING"); - - } catch (Throwable e) { - System.out.println("ignoring entry"); - } - - } - - dao.sqlBatchUpdate(); - // concept dim entry: all at once - dao.sqlUpdate("insert into i2b2demodata.concept_dimension(concept_path, concept_cd, name_char, import_date)" + - "select c_fullname, c_basecode, c_name, update_date from i2b2metadata.clinical_non_sensitive where c_basecode is not null ON CONFLICT DO NOTHING;");//c_fullname like '%VARIANT_ID%' and - - } - - public static void loadClearDataset(String datasetSplit) throws UnlynxException, IOException, I2B2Exception { - - // change me node number - loadSrv1Conf(); - - //StopWatch.misc.start("clear dataset loading: clinical ontology"); - String - dir = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/", - nodeId = "1", - datasetId = "skcm_broad_clear_i2b2_part"+nodeId+"_" + datasetSplit; - - - System.out.println("Starting loading node " + nodeId); - MedCoDataLoader loader1 = new MedCoDataLoader("chuvclear" + nodeId, datasetId, "i2b2demotest", "Demo", "demo", "demouser"); - - loader1.loadClinicalFileOntology(dir + "data_clinical_skcm_broad.txt", '\t', '\u0000', 5, typesClinical); - System.out.println("Node " + nodeId + ": ontology clinical OK"); - //StopWatch.misc.stop(); - - //StopWatch.misc.start("clear dataset loading: clinical data"); - loader1.loadClinicalFileData(dir + "data_clinical_skcm_broad.txt", '\t', '\u0000', 5, typesClinical); - System.out.println("Node " + nodeId + ": clinical data OK"); - - // for each entry of the dataset: - // generate ontology entry, generate concept dim entry generate obs fact - //StopWatch.misc.stop(); - - //StopWatch.misc.start("clear dataset loading: variants data"); - MedCoDatabase dao = new MedCoDatabase(); - //CSVReader genomicReader = new CSVReader(new FileReader(dir + "data_mutations_extended_skcm_broad_clear_i2b2_part"+ nodeId + "_"+datasetSplit+".txt"), '\t', '\u0000', 0); - CSVReader genomicReader = new CSVReader(new FileReader(dir + "data_mutations_extended_skcm_broad_clear_i2b2.txt"), '\t', '\u0000', 0); - String[] genomicHeader = genomicReader.readNext(); - - // [sample_id, patient_id, variant_id] - Map patientsMap = new HashMap<>(), samplesMap = new HashMap<>(); - String[] genomicEntry; - int count = 0; - while ((genomicEntry = genomicReader.readNext()) != null) { - try { - - // ontology entry - dao.batchSqlStatements.add( - "insert into i2b2metadata.clinical_non_sensitive" + - "(c_hlevel, c_fullname, c_name, c_synonym_cd, c_visualattributes, c_basecode, c_facttablecolumn, c_tablename, c_columnname, c_columndatatype, c_operator, c_dimcode, update_date, valuetype_cd, m_applied_path) values(" + - "'4', '\\medco\\clinical\\nonsensitive\\VARIANT_ID\\" + genomicEntry[2] + "\\', '" + genomicEntry[2] + "', 'N', 'LA', '" + genomicEntry[2] + "', 'concept_cd', 'concept_dimension', 'concept_path', 'T', 'LIKE', " + - "'\\medco\\clinical\\nonsensitive\\VARIANT_ID\\" + genomicEntry[2] + "\\', now(), 'MEDCO_CLEAR', '@') ON CONFLICT DO NOTHING"); - // todo: remove me - //dao.batchSqlStatements.add( - // "insert into i2b2metadata.clinical_non_sensitive" + - // "(c_hlevel, c_fullname, c_name, c_synonym_cd, c_visualattributes, c_basecode, c_facttablecolumn, c_tablename, c_columnname, c_columndatatype, c_operator, c_dimcode, update_date, valuetype_cd, m_applied_path) values(" + - // "'4', '\\medco\\clinical\\nonsensitive\\VARIANT_ID\\S" + genomicEntry[2] + "\\', 'S" + genomicEntry[2] + "', 'N', 'LA', 'S" + genomicEntry[2] + "', 'concept_cd', 'concept_dimension', 'concept_path', 'T', 'LIKE', " + - // "'\\medco\\clinical\\nonsensitive\\VARIANT_ID\\S" + genomicEntry[2] + "\\', now(), 'MEDCO_CLEAR', '@') ON CONFLICT DO NOTHING"); - // obs fact entry - int patient_id = -1, sample_id = -1; - if (patientsMap.containsKey(genomicEntry[1])) { - patient_id = patientsMap.get(genomicEntry[1]); - } else { - patient_id = dao.sqlSelectInt("select patient_num from i2b2demodata.patient_mapping where patient_ide=?", genomicEntry[1]); - patientsMap.put(genomicEntry[1], patient_id); - } - if (samplesMap.containsKey(genomicEntry[0])) { - sample_id = samplesMap.get(genomicEntry[0]); - } else { - sample_id = dao.sqlSelectInt("select encounter_num from i2b2demodata.encounter_mapping where encounter_ide=?", genomicEntry[0]); - samplesMap.put(genomicEntry[0], sample_id); - } - - int instanceNum=1;//count++%4;//change me for quadruple - - dao.batchSqlStatements.add("insert into i2b2demodata.observation_fact(encounter_num, patient_num, concept_cd, provider_id, start_date, instance_num) values(" + - "'" + sample_id + "', '" + patient_id + "', '" + genomicEntry[2] + "', 'chuvclear"+nodeId+datasetSplit+"', NOW(), '"+instanceNum+"')"); - //todo: remove me - //instanceNum=2; - //dao.batchSqlStatements.add("insert into i2b2demodata.observation_fact(encounter_num, patient_num, concept_cd, provider_id, start_date, instance_num) values(" + - // "'" + sample_id + "', '" + patient_id + "', '" + genomicEntry[2] + "', 'chuvclear"+nodeId+datasetSplit+"', NOW(), '"+instanceNum+"')"); - System.out.println(patient_id + " -- " + sample_id); - } catch (Throwable e) { - e.printStackTrace(); - System.err.println("ignoring genomic entry ..."); - } - } - - //dao.exec the batchie - dao.sqlBatchUpdate(); - // concept dim entry: all at once - dao.sqlUpdate("insert into i2b2demodata.concept_dimension(concept_path, concept_cd, name_char, import_date)" + - "select c_fullname, c_basecode, c_name, update_date from i2b2metadata.clinical_non_sensitive where c_basecode is not null;");//c_fullname like '%VARIANT_ID%' and - - //StopWatch.misc.stop(); - - - -// loader1.loadClinicalFileOntology(dir + "data_mutations_extended_skcm_broad_clear_i2b2_part1_normal.txt", '\t', '\u0000', 0, typesGenomicClear); - //System.out.println("Node " + nodeId + ": ontology clinical 2 OK"); - - - - //loader1.loadClinicalFileData(dir + "data_mutations_extended_skcm_broad_clear_i2b2_part1_normal.txt", '\t', '\u0000',0, typesGenomicClear); - //System.out.println("Node " + nodeId + ": genomic data OK"); - - //loader1.translateIdsToNums(); - //System.out.println("Node " + nodeId + ": translate OK"); - - } - - public static void loadStandardDataset(String datasetSplit) throws UnlynxException, IOException, I2B2Exception { - { - - loadSrv1Conf(); - - String - dir = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/", - datasetId = "skcm_broad_part1_" + datasetSplit; - - nodeLoading("1", datasetId, - dir + "data_clinical_skcm_broad.txt", - dir + "data_clinical_skcm_broad_part1.txt", - dir + "data_mutations_extended_" + datasetId + ".txt"); - - } { - loadSrv3Conf(); - - String - dir = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/", - datasetId = "skcm_broad_part2_" + datasetSplit; - - nodeLoading("2", datasetId, - dir + "data_clinical_skcm_broad.txt", - dir + "data_clinical_skcm_broad_part2.txt", - dir + "data_mutations_extended_" + datasetId + ".txt"); - - } { - loadSrv5Conf(); - - String - dir = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/", - datasetId = "skcm_broad_part3_" + datasetSplit; - - nodeLoading("3", datasetId, - dir + "data_clinical_skcm_broad.txt", - dir + "data_clinical_skcm_broad_part3.txt", - dir + "data_mutations_extended_" + datasetId + ".txt"); - } - } - - public static void loadProfileManyNode() throws UnlynxException, IOException, I2B2Exception { - - loadSrv1Conf(); - String datasetSplit = "normal"; - - String - dir = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/", - datasetId = "skcm_broad_part1_" + datasetSplit; - - nodeLoading("1", datasetId, - dir + "data_clinical_skcm_broad.txt", - dir + "data_clinical_skcm_broad_part1.txt", - dir + "data_mutations_extended_" + datasetId + ".txt"); - - } - - public static void nodeLoading(String nodeId, String datasetId, String clinicalPath_full, String clinicalPath_part, String genomicPath_part) throws I2B2Exception, IOException, UnlynxException { - System.out.println("Starting loading node " + nodeId); - MedCoDataLoader loader1 = new MedCoDataLoader("chuv" + nodeId, datasetId, "medcodeployment", "Demo", "demo", "demouser"); - - loader1.loadClinicalFileOntology(clinicalPath_full, '\t', '\u0000', 5, typesClinical); - System.out.println("Node " + nodeId + ": ontology OK"); - - loader1.loadClinicalFileData(clinicalPath_part, '\t', '\u0000', 0, typesClinical); - System.out.println("Node " + nodeId + ": clinical data OK"); - - loader1.loadGenomicFile(genomicPath_part, '\t', '\u0000',0, typesGenomic); - System.out.println("Node " + nodeId + ": genomic data OK"); - - loader1.translateIdsToNums(); - System.out.println("Node " + nodeId + ": translate OK"); - } - - protected static void loadMedCoConf(String hostname, int i2b2Port, int psqlPort, String unlynxEntryPoint) { - MedCoUtil.getTestInstance().setProperty(MedCoUtil.ONTCELL_WS_URL_PROPERTIES, - "http://" + hostname + ":" + i2b2Port + "/i2b2/services/OntologyService"); - MedCoUtil.getTestInstance().setProperty(MedCoUtil.FRCELL_WS_URL_PROPERTIES, - "http://" + hostname + ":" + i2b2Port + "/i2b2/services/FRService"); - MedCoUtil.getTestInstance().setProperty(MedCoUtil.CRCCELL_WS_URL_PROPERTIES, - "http://" + hostname + ":" + i2b2Port + "/i2b2/services/QueryToolService"); - MedCoUtil.getTestInstance().setProperty(MedCoUtil.I2B2CELLS_WS_WAITTIME_PROPERTIES, - "180000"); - - MedCoUtil.getTestInstance().setProperty(MedCoUtil.UNLYNX_BINARY_PATH_PROPERTIES, "unlynxI2b2"); // assumed in bin path - MedCoUtil.getTestInstance().setProperty(MedCoUtil.UNLYNX_GROUP_FILE_PATH_PROPERTIES, - "/home/misbach/repositories/medco-deployment/configuration/keys/dev-3nodes-samehost/group.toml"); - - MedCoUtil.getTestInstance().setProperty(MedCoUtil.UNLYNX_DEBUG_LEVEL_PROPERTIES, "5"); - MedCoUtil.getTestInstance().setProperty(MedCoUtil.UNLYNX_PROOFS_PROPERTIES, "0"); - MedCoUtil.getTestInstance().setProperty(MedCoUtil.UNLYNX_ENTRY_POINT_IDX_PROPERTIES, unlynxEntryPoint); - - PGSimpleDataSource ds = new PGSimpleDataSource(); - ds.setServerName(hostname); - ds.setDatabaseName("medcodeployment"); - ds.setPortNumber(psqlPort); - ds.setUser("postgres"); - ds.setPassword("prigen2017"); - //ds.setCurrentSchema("medco_data"); - - MedCoUtil.getTestInstance().setDataSource(ds); - } - - protected static void loadSrv1Conf() { - loadMedCoConf("localhost", 8082, - 5434, "0"); - } - - protected static void loadSrv3Conf() { - loadMedCoConf("iccluster062.iccluster.epfl.ch", 8080, - 5432, "1"); - } - - protected static void loadSrv5Conf() { - loadMedCoConf("iccluster063.iccluster.epfl.ch", 8080, - 5432, "2"); - } - - - private static DataType[] typesClinical = new DataType[]{ - DataType.SAMPLE_ID, - DataType.PATIENT_ID, - DataType.CLEAR, - DataType.CLEAR, - DataType.CLEAR, - DataType.CLEAR, - - DataType.ENC, - - DataType.CLEAR, - DataType.CLEAR, - DataType.CLEAR, - DataType.ENC - - }, typesGenomicClear = new DataType[]{ - DataType.SAMPLE_ID, - DataType.PATIENT_ID, - DataType.CLEAR - - },typesGenomic = new DataType[]{ - - // Hugo_Symbol Entrez_Gene_Id Center NCBI_Build Chromosome Start_Position End_Position Strand - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.CHROMOSOME, - DataType.START_POS, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Variant_Classification Variant_Type Reference_Allele Tumor_Seq_Allele1 Tumor_Seq_Allele2 dbSNP_RS - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.REF_ALLELES, - DataType.ALT_ALLELES, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // dbSNP_Val_Status Tumor_Sample_Barcode Matched_Norm_Sample_Barcode Match_Norm_Seq_Allele1 - DataType.ANNOTATION, - DataType.SAMPLE_ID, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Match_Norm_Seq_Allele2 Tumor_Validation_Allele1 Tumor_Validation_Allele2 Match_Norm_Validation_Allele1 - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Match_Norm_Validation_Allele2 Verification_Status Validation_Status Mutation_Status Sequencing_Phase - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Sequence_Source Validation_Method Score BAM_File Sequencer MA:FImpact MA:FIS MA:protein.change - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // MA:link.MSA MA:link.PDB MA:link.var Tumor_Sample_UUID Matched_Norm_Sample_UUID HGVSc HGVSp - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // HGVSp_Short Transcript_ID Exon_Number t_depth t_ref_count t_alt_count n_depth n_ref_count n_alt_count - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // all_effects Allele Gene Feature Feature_type Consequence cDNA_position CDS_position - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Protein_position Amino_acids Codons Existing_variation ALLELE_NUM DISTANCE SYMBOL SYMBOL_SOURCE - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // HGNC_ID BIOTYPE CANONICAL CCDS ENSP SWISSPROT TREMBL UNIPARC RefSeq SIFT PolyPhen EXON - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // INTRON DOMAINS GMAF AFR_MAF AMR_MAF ASN_MAF EAS_MAF EUR_MAF SAS_MAF AA_MAF EA_MAF CLIN_SIG - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // SOMATIC PUBMED MOTIF_NAME MOTIF_POS HIGH_INF_POS MOTIF_SCORE_CHANGE IMPACT PICK VARIANT_CLASS - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // TSL HGVS_OFFSET PHENO MINIMISED ExAC_AF ExAC_AF_AFR ExAC_AF_AMR ExAC_AF_EAS ExAC_AF_FIN ExAC_AF_NFE - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // ExAC_AF_OTH ExAC_AF_SAS GENE_PHENO FILTER - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION - }; -} diff --git a/src/server/ch/epfl/lca1/medco/dao/MedCoDatabase.java b/src/server/ch/epfl/lca1/medco/dao/MedCoDatabase.java deleted file mode 100755 index fcca655..0000000 --- a/src/server/ch/epfl/lca1/medco/dao/MedCoDatabase.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2006-2007 Massachusetts General Hospital - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the i2b2 Software License v1.0 - * which accompanies this distribution. - * - * Contributors: - * Lori Phillips - */ -package ch.epfl.lca1.medco.dao; - -import java.util.*; - -import javax.sql.DataSource; - -import ch.epfl.lca1.medco.util.Logger; -import org.javatuples.Pair; -import org.springframework.jdbc.core.support.JdbcDaoSupport; - -import ch.epfl.lca1.medco.util.MedCoUtil; -import edu.harvard.i2b2.common.exception.I2B2Exception; -import org.springframework.jdbc.support.rowset.SqlRowSet; - - -// TODO: migrate the medco_data.enc_observation_fact to the normal i2b2 observation fact -// todo: do not use the bootstrap datasource, use it according to the user (from PM) - -public class MedCoDatabase extends JdbcDaoSupport { - - public MedCoDatabase() throws I2B2Exception { - DataSource ds = null; - try { - ds = MedCoUtil.getInstance().getDataSource("java:/MedCoBootStrapDS"); - Logger.debug(ds.toString()); - } catch (I2B2Exception e2) { - throw Logger.fatal(e2); - } - this.setDataSource(ds); - - this.batchSqlStatements = new ArrayList<>(); - } - - - public int sqlUpdate(String sql, String... params) { - return this.getJdbcTemplate().update(sql, params); - } - - public SqlRowSet sqlSelect(String sql, String... params) { - return this.getJdbcTemplate().queryForRowSet(sql, params); - } - - public int sqlSelectInt(String sql, String... params) { - return getJdbcTemplate().queryForInt(sql, params); - } - - public ArrayList batchSqlStatements; - public int[] sqlBatchUpdate() { - int[] ret = this.getJdbcTemplate().batchUpdate(batchSqlStatements.toArray(new String[]{})); - batchSqlStatements.clear(); - return ret; - } - - - /** - * Adds a medco encrypted observation fact. - */ - public int addEncObservationFact(String encounterNum, String patientNum, String providerId, String encConceptNum) { - - String sql = - "insert into medco_data.enc_observation_fact " + - "(encounter_id, patient_id, provider_id, enc_concept_id) " + - "values (?,?,?,?)"; - //String metadataId = null; //TODO metadata_id??? (not for now) - return sqlUpdate(sql, encounterNum, patientNum, providerId, encConceptNum); - // TODO: temp disabled - } - - - /** - * Adds a medco encrypted observation fact. - */ - public void accumulateEncObservationFact(String encounterNum, String patientNum, String providerId, String encConceptNum) { - - batchSqlStatements.add("insert into medco_data.enc_observation_fact " + - "(encounter_id, patient_id, provider_id, enc_concept_id) " + - "values ('" + encounterNum + "','" + patientNum + "','" + providerId + "','" + encConceptNum + "')"); - //String metadataId = null; //TODO metadata_id??? (not for now) - //return sqlUpdate(sql, encounterNum, patientNum, providerId, encConceptNum); - // TODO: temp disabled - } - - public int[] commitEncObservationFact() { - return sqlBatchUpdate(); - } - - /** - * Returns pairs of {sample_id, sample_id_source/provider_id} from the enc obs fact - * - * @return - */ - public Set> getUniqueSampleIds() { - String sql = "select distinct encounter_id, provider_id from medco_data.enc_observation_fact"; - SqlRowSet rowSet = sqlSelect(sql); - - Set> returnSet = new HashSet<>(); - while (rowSet.next()) { - returnSet.add(new Pair<>( - rowSet.getString("encounter_id"), - rowSet.getString("provider_id") - )); - } - - Logger.info("Retrieved pairs of sample_id and sample_id_source, size:" + returnSet.size()); - return returnSet; - } - - /** - * Updates the patients and samples ids to their corresponding nums using the provided map. - * - * @param map map containing: key=sample_id, value={sample_num, patient_num}TODO wrong - * val0: sample, val1: patients - */ - public int updateSampleAndPatientIds(Map> map) { - - int nbUpdatesCount = 0; - for (Map.Entry> entry: map.entrySet()) { - String sql = "update medco_data.enc_observation_fact " + - "set encounter_id = ?, patient_id = ? where encounter_id = ?"; - nbUpdatesCount += sqlUpdate(sql, entry.getValue().getValue0(), entry.getValue().getValue1(), entry.getKey()); - } - - return nbUpdatesCount; - } - - public List> getPatientsData(List patientIdsList) { - List> patientsData = new ArrayList<>(); - - for (String patientId : patientIdsList) { - String sql = "select enc_concept_id from medco_data.enc_observation_fact where patient_id = ?"; - SqlRowSet rowSet = sqlSelect(sql, patientId); - - List currentPatientData = new ArrayList<>(); - while (rowSet.next()) { - currentPatientData.add(rowSet.getString("enc_concept_id")); - } - patientsData.add(currentPatientData); - } - - return patientsData; - } - -// TODO: tests! -} \ No newline at end of file diff --git a/src/test/ch/epfl/lca1/medco/dao/DaoTests.java b/src/test/ch/epfl/lca1/medco/dao/DaoTests.java deleted file mode 100644 index 65a11e9..0000000 --- a/src/test/ch/epfl/lca1/medco/dao/DaoTests.java +++ /dev/null @@ -1,39 +0,0 @@ -package ch.epfl.lca1.medco.dao; - -import ch.epfl.lca1.medco.util.MedCoUtil; -import edu.harvard.i2b2.common.exception.I2B2Exception; -import org.junit.Test; -import org.postgresql.ds.PGSimpleDataSource; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.sql.DataSource; -import java.util.Hashtable; - -/** - * Created by misbach on 19.06.17. - */ -public class DaoTests { - -// TODO: some common setup for tests - static { - PGSimpleDataSource ds = new PGSimpleDataSource(); - ds.setServerName("localhost"); - ds.setDatabaseName("i2b2demotest"); - ds.setPortNumber(5432); - ds.setUser("medco_data"); - ds.setPassword("demouser"); - ds.setCurrentSchema("medco_data"); - - MedCoUtil.getTestInstance().setDataSource(ds); - } - - @Test - public void encObsFactTest() throws I2B2Exception { - MedCoDatabase dao = new MedCoDatabase(); - dao.addEncObservationFact("test1", "test2", "chuv", "amflnwieruzlfb666asvgbli"); - - - } -} diff --git a/src/test/ch/epfl/lca1/medco/loader/EncryptedIdsUnlynxTests.java b/src/test/ch/epfl/lca1/medco/loader/EncryptedIdsUnlynxTests.java deleted file mode 100644 index b268e0c..0000000 --- a/src/test/ch/epfl/lca1/medco/loader/EncryptedIdsUnlynxTests.java +++ /dev/null @@ -1,205 +0,0 @@ -package ch.epfl.lca1.medco.loader; - -import ch.epfl.lca1.medco.util.exceptions.UnlynxException; -import org.junit.Assert; -import org.junit.Test; - -import java.math.BigInteger; - -public class EncryptedIdsUnlynxTests { - - @Test - public void PushBitsTest() { - - long orig = 0b1110_1011; - - Assert.assertEquals( - EncryptedIdentifiersManager.pushBitsFromRight(orig, 0, 0b101), - 0b1110_1011 - ); - - Assert.assertEquals( - EncryptedIdentifiersManager.pushBitsFromRight(orig, 1, 0b1111101), - 0b1110_1011_1 - ); - - Assert.assertEquals( - EncryptedIdentifiersManager.pushBitsFromRight(orig, 3, 0b101), - 0b11101011101 - ); - - Assert.assertEquals( - EncryptedIdentifiersManager.pushBitsFromRight(orig, 8, 0b101011110101011), - 0b1110_1011_1010_1011 - ); - } - - @Test - public void RegexTests() { - Assert.assertTrue( - "3".matches(EncryptedIdentifiersManager.CHROMOSOME_ID_REGEX) - ); - Assert.assertTrue( - "11".matches(EncryptedIdentifiersManager.CHROMOSOME_ID_REGEX) - ); - Assert.assertTrue( - "20".matches(EncryptedIdentifiersManager.CHROMOSOME_ID_REGEX) - ); - Assert.assertTrue( - "X".matches(EncryptedIdentifiersManager.CHROMOSOME_ID_REGEX) - ); - Assert.assertFalse( - "33".matches(EncryptedIdentifiersManager.CHROMOSOME_ID_REGEX) - ); - Assert.assertFalse( - "V".matches(EncryptedIdentifiersManager.CHROMOSOME_ID_REGEX) - ); - Assert.assertFalse( - "XX".matches(EncryptedIdentifiersManager.CHROMOSOME_ID_REGEX) - ); - Assert.assertFalse( - "0".matches(EncryptedIdentifiersManager.CHROMOSOME_ID_REGEX) - ); - Assert.assertFalse( - "M2".matches(EncryptedIdentifiersManager.CHROMOSOME_ID_REGEX) - ); - - Assert.assertTrue( - "ATGGG".matches(EncryptedIdentifiersManager.ALLELES_REGEX) - ); - Assert.assertTrue( - "-".matches(EncryptedIdentifiersManager.ALLELES_REGEX) - ); - Assert.assertTrue( - "GATGGG".matches(EncryptedIdentifiersManager.ALLELES_REGEX) - ); - Assert.assertFalse( - "ATGGGGGG".matches(EncryptedIdentifiersManager.ALLELES_REGEX) - ); - Assert.assertFalse( - "D".matches(EncryptedIdentifiersManager.ALLELES_REGEX) - ); - Assert.assertFalse( - "3".matches(EncryptedIdentifiersManager.ALLELES_REGEX) - ); - Assert.assertTrue( - "-".matches(EncryptedIdentifiersManager.ALLELES_REGEX) - ); - Assert.assertFalse( - "G-".matches(EncryptedIdentifiersManager.ALLELES_REGEX) - ); - } - - @Test - public void GetIDTests() { - - try { - long id = EncryptedIdentifiersManager.getVariantId( - "3", - 33366L, - "ATCC", - "-"); - - long check = new BigInteger( - "1" + - "00011" + - "0000000000001000001001010110" + - "100" + - "000111110000" + - "000" + - "000000000000", 2).longValue(); - System.out.println(id); - Assert.assertEquals(id, check); - - long id2 = EncryptedIdentifiersManager.getVariantId( - "M", - 33366L, - "-", - "AAAAAA"); - - long check2 = new BigInteger( - "1" + - "11010" + - "0000000000001000001001010110" + - "000" + - "000000000000" + - "110" + - "000000000000", 2).longValue(); - - Assert.assertEquals(id2, check2); - - } catch (UnlynxException e) { - Assert.fail(e.getMessage()); - } - - - try { - EncryptedIdentifiersManager.getVariantId("3", - 33366L, - "ATCCCCC", - "-"); - Assert.fail(); - } catch (UnlynxException e) { - e.printStackTrace(); - Assert.assertTrue(true); - } - try { - EncryptedIdentifiersManager.getVariantId( - "XX", - 33366L, - "ATCC", - "-"); - Assert.fail(); - } catch (UnlynxException e) { - e.printStackTrace(); - Assert.assertTrue(true); - } try { - EncryptedIdentifiersManager.getVariantId( - "3", - 33366L, - "XATCC", - "-"); - Assert.fail(); - } catch (UnlynxException e) { - e.printStackTrace(); - Assert.assertTrue(true); - } try { - EncryptedIdentifiersManager.getVariantId( - "3", - -33366L, - "ATCC", - "-"); - Assert.fail(); - } catch (UnlynxException e) { - e.printStackTrace(); - Assert.assertTrue(true); - } - } - - @Test - public void GetSpecificID() { - - try { - long id = EncryptedIdentifiersManager.getVariantId( - "11", - 74985268L, - "G", - "A"); - - long check = new BigInteger( - "1" + - "00011" + - "0000000000001000001001010110" + - "100" + - "000111110000" + - "000" + - "000000000000", 2).longValue(); - System.out.println(id); - Assert.assertEquals(id, check); - } catch (UnlynxException e) { - e.printStackTrace(); - Assert.assertTrue(true); - } - - } -} diff --git a/src/test/ch/epfl/lca1/medco/loader/MedCoDataLoaderTests.java b/src/test/ch/epfl/lca1/medco/loader/MedCoDataLoaderTests.java deleted file mode 100644 index 20de6fc..0000000 --- a/src/test/ch/epfl/lca1/medco/loader/MedCoDataLoaderTests.java +++ /dev/null @@ -1,482 +0,0 @@ -package ch.epfl.lca1.medco.loader; - -import ch.epfl.lca1.medco.ConfiguredTests; -import ch.epfl.lca1.medco.MedCoDataLoader; -import ch.epfl.lca1.medco.i2b2.ont.I2B2ONTCell; -import ch.epfl.lca1.medco.i2b2.pm.MedCoI2b2MessageHeader; -import ch.epfl.lca1.medco.loader.clinical.OntologyLoader; -import ch.epfl.lca1.medco.util.exceptions.UnlynxException; -import edu.harvard.i2b2.common.exception.I2B2Exception; -import org.junit.Test; - -import java.io.IOException; - -/** - * Created by misbach on 16.06.17. - */ -public class MedCoDataLoaderTests extends ConfiguredTests { - - @Test - public void testClinicalOntLoader() throws I2B2Exception, UnlynxException { - String[] headers = new String[] { - "sample_id", "patient_id", "test_enc_1", "test enc 2", "some clear1", "clear2", "ency3" - }; - DataType[] types = new DataType[] { - DataType.SAMPLE_ID, - DataType.PATIENT_ID, - DataType.ENC, - DataType.ENC, - DataType.CLEAR, - DataType.CLEAR, - DataType.ENC - }; - MedCoI2b2MessageHeader auth = new MedCoI2b2MessageHeader("i2b2demotest", "Demo", "demo", false, 0, "demouser"); - - OntologyLoader loader = new OntologyLoader(headers, types, "chuv"); - loader.parseEntry(new String[]{"22", "333F", "A", "B", "A", "33", "5630"}); - loader.parseEntry(new String[]{"22", "33F", "B", "B", "B", "33", "511630"}); - loader.parseEntry(new String[]{"223", "33F", "A", "C", "A", "353", "5630"}); - loader.parseEntry(new String[]{"22F", "33f3F", "B", "B", "C", "333", "5630"}); - loader.parseEntry(new String[]{"22F", "3f33F", "C", "L", "A", "33", "563220"}); - - loader.loadOntology(new I2B2ONTCell(auth)); - - } - - @Test - public void testClinicalLoader() throws UnlynxException, IOException, I2B2Exception { - String clinicalPath_full = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/data_clinical_skcm_broad.txt", - clinicalPath_part1 = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/data_clinical_skcm_broad_part1.txt", - clinicalPath_part2 = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/data_clinical_skcm_broad_part2.txt", - clinicalPath_part3 = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/data_clinical_skcm_broad_part3.txt"; - - // --- mapping for the test dataset - //SAMPLE_ID PATIENT_ID AGE DISTANT_METASTASIS_PATHOLOGIC_SPREAD GENDER - // HISTOLOGICAL_SUBTYPE ICD_O_3_HISTOLOGY ICD_O_3_SITE PRETREATMENT_HISTORY - // PRIMARY_TUMOR_PATHOLOGIC_SPREAD PRIOR_DIAGNOSIS RESIDUAL_TUMOR - // TOBACCO_SMOKING_HISTORY_INDICATOR TUMOR_STAGE_2009 OS_STATUS OS_MONTHS - // DFS_STATUS DFS_MONTHS CANCER_TYPE CANCER_TYPE_DETAILED - /* - DataType[] typesClinical = new DataType[]{ - DataType.SAMPLE_ID, - DataType.PATIENT_ID, - DataType.CLEAR, - DataType.ENC, - DataType.CLEAR, - - DataType.ENC, - DataType.ENC, - DataType.ENC, - DataType.CLEAR, - - DataType.CLEAR, - DataType.CLEAR, - DataType.ENC, - - DataType.IGNORE, - DataType.ENC, - DataType.CLEAR, - DataType.CLEAR, - - DataType.ENC, - DataType.ENC, - DataType.CLEAR, - DataType.IGNORE - };*/ - - // --- mapping for the skcm_broad dataset - // SAMPLE_ID PATIENT_ID GENDER(C) AGE(C) AGE_AT_PROCUREMENT(C) PRIMARY_DIAGNOSIS(C) - // [PRIMARY_TUMOR_LOCALIZATION_TYPE](S) - // PRIMARY_SITE(C) BRESLOW_DEPTH(C) CANCER_TYPE(C) [CANCER_TYPE_DETAILED](S) - - DataType[] typesClinical = new DataType[]{ - DataType.SAMPLE_ID, - DataType.PATIENT_ID, - DataType.CLEAR, - DataType.CLEAR, - DataType.CLEAR, - DataType.CLEAR, - - DataType.ENC, - - DataType.CLEAR, - DataType.CLEAR, - DataType.CLEAR, - DataType.ENC - }; - - { - loadSrv1Conf(); - MedCoDataLoader loader = new MedCoDataLoader("chuv1", "skcm_broad_part1", "i2b2demotest", "Demo", "demo", "demouser"); - loader.loadClinicalFileOntology(clinicalPath_full, '\t', '\u0000', 5, typesClinical); - loader.loadClinicalFileData(clinicalPath_part1, '\t', '\u0000', 0, typesClinical); - } { - loadSrv3Conf(); - MedCoDataLoader loader = new MedCoDataLoader("chuv2", "skcm_broad_part2", "i2b2demotest", "Demo", "demo", "demouser"); - loader.loadClinicalFileOntology(clinicalPath_full, '\t', '\u0000', 5, typesClinical); - loader.loadClinicalFileData(clinicalPath_part2, '\t', '\u0000', 0, typesClinical); - } { - loadSrv5Conf(); - MedCoDataLoader loader = new MedCoDataLoader("chuv3", "skcm_broad_part3", "i2b2demotest", "Demo", "demo", "demouser"); - loader.loadClinicalFileOntology(clinicalPath_full, '\t', '\u0000', 5, typesClinical); - loader.loadClinicalFileData(clinicalPath_part3, '\t', '\u0000', 0, typesClinical); - } - - /* - - 1 - demo - /opt/FRC_files/Demo/pdoUploadchuv.xml - COMPLETED - 2017-07-20T16:54:25.121Z - 2017-07-20T16:54:26.761Z - - - - - - - - - - */ - } - - @Test - public void testGenomicLoader() throws UnlynxException, IOException, I2B2Exception { - String genomicPath_part1 = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/data_mutations_extended_skcm_broad_part1.txt", - genomicPath_part2 = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/data_mutations_extended_skcm_broad_part2.txt", - genomicPath_part3 = "/home/misbach/repositories/i2b2-core-server-medco/ch.epfl.lca1.medco/testfiles/datasets/full/skcm_broad/data_mutations_extended_skcm_broad_part3.txt"; - - DataType[] typesGenomic = new DataType[]{ - - // Hugo_Symbol Entrez_Gene_Id Center NCBI_Build Chromosome Start_Position End_Position Strand - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.CHROMOSOME, - DataType.START_POS, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Variant_Classification Variant_Type Reference_Allele Tumor_Seq_Allele1 Tumor_Seq_Allele2 dbSNP_RS - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.REF_ALLELES, - DataType.ALT_ALLELES, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // dbSNP_Val_Status Tumor_Sample_Barcode Matched_Norm_Sample_Barcode Match_Norm_Seq_Allele1 - DataType.ANNOTATION, - DataType.SAMPLE_ID, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Match_Norm_Seq_Allele2 Tumor_Validation_Allele1 Tumor_Validation_Allele2 Match_Norm_Validation_Allele1 - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Match_Norm_Validation_Allele2 Verification_Status Validation_Status Mutation_Status Sequencing_Phase - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Sequence_Source Validation_Method Score BAM_File Sequencer MA:FImpact MA:FIS MA:protein.change - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // MA:link.MSA MA:link.PDB MA:link.var Tumor_Sample_UUID Matched_Norm_Sample_UUID HGVSc HGVSp - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // HGVSp_Short Transcript_ID Exon_Number t_depth t_ref_count t_alt_count n_depth n_ref_count n_alt_count - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // all_effects Allele Gene Feature Feature_type Consequence cDNA_position CDS_position - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Protein_position Amino_acids Codons Existing_variation ALLELE_NUM DISTANCE SYMBOL SYMBOL_SOURCE - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // HGNC_ID BIOTYPE CANONICAL CCDS ENSP SWISSPROT TREMBL UNIPARC RefSeq SIFT PolyPhen EXON - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // INTRON DOMAINS GMAF AFR_MAF AMR_MAF ASN_MAF EAS_MAF EUR_MAF SAS_MAF AA_MAF EA_MAF CLIN_SIG - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // SOMATIC PUBMED MOTIF_NAME MOTIF_POS HIGH_INF_POS MOTIF_SCORE_CHANGE IMPACT PICK VARIANT_CLASS - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // TSL HGVS_OFFSET PHENO MINIMISED ExAC_AF ExAC_AF_AFR ExAC_AF_AMR ExAC_AF_EAS ExAC_AF_FIN ExAC_AF_NFE - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // ExAC_AF_OTH ExAC_AF_SAS GENE_PHENO FILTER - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION - - }; - - // dataset test - /* - DataType[] typesGenomic = new DataType[] { - - // Hugo_Symbol Entrez_Gene_Id Center NCBI_Build Chromosome Start_Position End_Position Strand - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.CHROMOSOME, - DataType.START_POS, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Variant_Classification Variant_Type Reference_Allele Tumor_Seq_Allele1 Tumor_Seq_Allele2 dbSNP_RS - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.REF_ALLELES, - DataType.ALT_ALLELES, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // dbSNP_Val_Status Tumor_Sample_Barcode Matched_Norm_Sample_Barcode Match_Norm_Seq_Allele1 Match_Norm_Seq_Allele2 - DataType.ANNOTATION, - DataType.IGNORE, - DataType.IGNORE, - DataType.SAMPLE_DATA, - DataType.SAMPLE_DATA, - - // Tumor_Validation_Allele1 Tumor_Validation_Allele2 Match_Norm_Validation_Allele1 Match_Norm_Validation_Allele2 - DataType.SAMPLE_DATA, - DataType.SAMPLE_DATA, - DataType.SAMPLE_DATA, - DataType.SAMPLE_DATA, - - // Verification_Status Validation_Status Mutation_Status Sequencing_Phase Sequence_Source Validation_Method - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Score BAM_File Sequencer MA:FImpact MA:FIS MA:protein.change MA:link.MSA MA:link.PDB MA:link.var - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.SAMPLE_DATA, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Tumor_Sample_UUID Matched_Norm_Sample_UUID HGVSc HGVSp HGVSp_Short Transcript_ID Exon_Number - DataType.IGNORE, - DataType.IGNORE, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // t_depth t_ref_count t_alt_count n_depth n_ref_count n_alt_count all_effects Allele Gene Feature Feature_type - DataType.SAMPLE_DATA, - DataType.SAMPLE_DATA, - DataType.SAMPLE_DATA, - DataType.SAMPLE_DATA, - DataType.SAMPLE_DATA, - DataType.SAMPLE_DATA, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // Consequence cDNA_position CDS_position Protein_position Amino_acids Codons Existing_variation ALLELE_NUM - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // DISTANCE SYMBOL SYMBOL_SOURCE HGNC_ID BIOTYPE CANONICAL CCDS ENSP SWISSPROT TREMBL UNIPARC RefSeq SIFT - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // PolyPhen EXON INTRON DOMAINS GMAF AFR_MAF AMR_MAF ASN_MAF EAS_MAF EUR_MAF SAS_MAF AA_MAF EA_MAF CLIN_SIG - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // SOMATIC PUBMED MOTIF_NAME MOTIF_POS HIGH_INF_POS MOTIF_SCORE_CHANGE IMPACT PICK VARIANT_CLASS - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // TSL HGVS_OFFSET PHENO MINIMISED ExAC_AF ExAC_AF_AFR ExAC_AF_AMR ExAC_AF_EAS ExAC_AF_FIN ExAC_AF_NFE ExAC_AF_OTH - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - - // ExAC_AF_SAS GENE_PHENO FILTER SAMPLE_ID - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.ANNOTATION, - DataType.SAMPLE_ID - }; - */ - - { - loadSrv1Conf(); - MedCoDataLoader loader = new MedCoDataLoader("chuv1", "skcm_broad_part1","i2b2demotest", "Demo", "demo", "demouser"); - loader.loadGenomicFile(genomicPath_part1, '\t', '\u0000',0, typesGenomic); - } { - loadSrv3Conf(); - MedCoDataLoader loader = new MedCoDataLoader("chuv2", "skcm_broad_part2","i2b2demotest", "Demo", "demo", "demouser"); - loader.loadGenomicFile(genomicPath_part2, '\t', '\u0000',0, typesGenomic); - } { - loadSrv5Conf(); - MedCoDataLoader loader = new MedCoDataLoader("chuv3", "skcm_broad_part3","i2b2demotest", "Demo", "demo", "demouser"); - loader.loadGenomicFile(genomicPath_part3, '\t', '\u0000',0, typesGenomic); - } - - } - - @Test - public void testTranslateIdsToNums() throws UnlynxException, IOException, I2B2Exception { - { - loadSrv1Conf(); - MedCoDataLoader loader = new MedCoDataLoader("chuv1", "skcm_broad_part1","i2b2demotest", "Demo", "demo", "demouser"); - loader.translateIdsToNums(); - } { - loadSrv3Conf(); - MedCoDataLoader loader = new MedCoDataLoader("chuv2", "skcm_broad_part2","i2b2demotest", "Demo", "demo", "demouser"); - loader.translateIdsToNums(); - } { - loadSrv5Conf(); - MedCoDataLoader loader = new MedCoDataLoader("chuv3", "skcm_broad_part3","i2b2demotest", "Demo", "demo", "demouser"); - loader.translateIdsToNums(); - } - - - } -}