diff --git a/.circleci/config.yml b/.circleci/config.yml index 9902b2f0..cebaef0e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: build: docker: # specify the version you desire here - - image: cimg/openjdk:11.0.20-browsers + - image: cimg/openjdk:21.0.0-browsers # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images diff --git a/Dockerfile b/Dockerfile index 37ff58f6..a7cb1cbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ -FROM maven:3-openjdk-11 +FROM openjdk:21-jdk-slim ENV GN_HOME=/genome-nexus-annotation-pipeline COPY . $GN_HOME WORKDIR $GN_HOME COPY annotationPipeline/src/main/resources/log4j.properties.EXAMPLE $GN_HOME/annotationPipeline/src/main/resources/log4j.properties +RUN apt-get update && apt-get install -y maven && apt-get clean; # set log4j file in properties RUN sed -i "s|log4j\.appender\.a\.File.*|log4j.appender.a.File = $GN_HOME/logs/genome-nexus-annotation-pipeline.log|" $GN_HOME/annotationPipeline/src/main/resources/log4j.properties @@ -12,7 +13,7 @@ ARG mvnprofiles='' RUN mvn -DskipTests clean install $mvnprofiles -FROM openjdk:11-slim +FROM openjdk:21-jdk-slim ENV GN_HOME=/genome-nexus-annotation-pipeline diff --git a/README.md b/README.md index 27bfbc82..45365aaf 100644 --- a/README.md +++ b/README.md @@ -204,26 +204,14 @@ The output file was generated with: ## Direct Database Annotation -If you have data already loaded into a cBioPortal database but did not properly -annotate it or discovered issues later, you can use the `databaseAnnotator` -utility to fix it. - -You will need to specify some database connection parameters inside the -`application.properties` file located in -`databaseAnnotator/src/main/resources`. Once this is done, build the project -using maven and run like so: - - $JAVA_HOME/bin/java -jar databaseAnnotator/target/databaseAnnotator-*.jar \ - --isoform - -As with the above tool, running the jar without any arguments or by providing -the optional parameter `-h` will bring up the full usage statement. You can -also specify a single study or set of studies to annotate by using the -`--studies` parameter. +There used to be a utility/module called databaseAnnotator which could be +used to annotate database records which were already loaded into a +cBioPortal database. This module was not being maintained and has been +removed (code is still reachable through git history). ## Annotator The `annotator` module is the client code that makes calls to the Genome Nexus -server and interprets the response. The other two modules use this as a +server and interprets the response. The `annotationPipeline` module uses this as a dependency. ## Updating the Genome Nexus Annotation Pipeline diff --git a/annotationPipeline/src/main/java/org/cbioportal/annotation/AnnotationPipeline.java b/annotationPipeline/src/main/java/org/cbioportal/annotation/AnnotationPipeline.java index 6e044a2d..2d7d9429 100644 --- a/annotationPipeline/src/main/java/org/cbioportal/annotation/AnnotationPipeline.java +++ b/annotationPipeline/src/main/java/org/cbioportal/annotation/AnnotationPipeline.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Memorial Sloan-Kettering Cancer Center. + * Copyright (c) 2016, 2024 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 @@ -67,33 +67,40 @@ public class AnnotationPipeline { private static final Logger LOG = LoggerFactory.getLogger(AnnotationPipeline.class); private static void annotateJob(String[] args, String filename, String outputFilename, String outputFormat, String isoformOverride, - String errorReportLocation, boolean replace, String postIntervalSize, String stripMatchingBases, Boolean ignoreOriginalGenomicLocation, Boolean addOriginalGenomicLocation, Boolean noteColumn) throws Exception { + String errorReportLocation, boolean replace, String postIntervalSize, String stripMatchingBases, + Boolean ignoreOriginalGenomicLocation, Boolean addOriginalGenomicLocation, Boolean noteColumn) throws Exception { SpringApplication app = new SpringApplication(AnnotationPipeline.class); app.setWebApplicationType(WebApplicationType.NONE); app.setAllowBeanDefinitionOverriding(Boolean.TRUE); ConfigurableApplicationContext ctx = app.run(args); JobLauncher jobLauncher = ctx.getBean(JobLauncher.class); - Job annotationJob = ctx.getBean(BatchConfiguration.ANNOTATION_JOB, Job.class); - JobParameters jobParameters = new JobParametersBuilder() - .addString("filename", filename) - .addString("outputFilename", outputFilename) - .addString("outputFormat", outputFormat) - .addString("replace", String.valueOf(replace)) - .addString("isoformOverride", isoformOverride) - .addString("errorReportLocation", errorReportLocation) - .addString("postIntervalSize", postIntervalSize) - .addString("stripMatchingBases", stripMatchingBases) - .addString("ignoreOriginalGenomicLocation", String.valueOf(ignoreOriginalGenomicLocation)) - .addString("addOriginalGenomicLocation", String.valueOf(addOriginalGenomicLocation)) - .addString("noteColumn", String.valueOf(noteColumn)) - .toJobParameters(); + JobParametersBuilder jobParametersBuilder = new JobParametersBuilder(); + addJobParameterIfValueIsNotNull(jobParametersBuilder, "filename", filename); + addJobParameterIfValueIsNotNull(jobParametersBuilder, "outputFilename", outputFilename); + addJobParameterIfValueIsNotNull(jobParametersBuilder, "outputFormat", outputFormat); + addJobParameterIfValueIsNotNull(jobParametersBuilder, "replace", String.valueOf(replace)); + addJobParameterIfValueIsNotNull(jobParametersBuilder, "isoformOverride", isoformOverride); + addJobParameterIfValueIsNotNull(jobParametersBuilder, "errorReportLocation", errorReportLocation); + addJobParameterIfValueIsNotNull(jobParametersBuilder, "postIntervalSize", postIntervalSize); + addJobParameterIfValueIsNotNull(jobParametersBuilder, "stripMatchingBases", stripMatchingBases); + addJobParameterIfValueIsNotNull(jobParametersBuilder, "ignoreOriginalGenomicLocation", String.valueOf(ignoreOriginalGenomicLocation)); + addJobParameterIfValueIsNotNull(jobParametersBuilder, "ignoreOriginalGenomicLocation", String.valueOf(addOriginalGenomicLocation)); + addJobParameterIfValueIsNotNull(jobParametersBuilder, "noteColumn", String.valueOf(noteColumn)); + JobParameters jobParameters = jobParametersBuilder.toJobParameters(); JobExecution jobExecution = jobLauncher.run(annotationJob, jobParameters); if (!jobExecution.getExitStatus().equals(ExitStatus.COMPLETED)) { System.exit(2); } } + // in Spring Batch 5.x, null valued JobParameters are not allowed. (java.lang.IllegalArgumentException: value must not be null) + private static void addJobParameterIfValueIsNotNull(JobParametersBuilder jobParametersBuilder, String key, String jobParameter) { + if (jobParameter != null && !jobParameter.trim().isEmpty()) { + jobParametersBuilder.addString(key, jobParameter); + } + } + public static void subMain(String[] args) throws NoSubcommandFoundException, ParseException, MergeFailedException, AnnotationFailedException { boolean help = false; for (String arg : args) { @@ -219,7 +226,7 @@ private static void annotate(Subcommand subcommand, String[] args) throws Annota subcommand.printHelp(); throw new AnnotationFailedException("required option: output-filename"); } - String outputFormat = null; + String outputFormat = ""; if (subcommand.hasOption("output-format")) { String outputFormatFile = subcommand.getOptionValue("output-format"); if ("extended".equals(outputFormatFile)) { diff --git a/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/BatchConfiguration.java b/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/BatchConfiguration.java index 836fac2f..6c96fa90 100644 --- a/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/BatchConfiguration.java +++ b/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/BatchConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Memorial Sloan-Kettering Cancer Center. + * Copyright (c) 2016 - 2024 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 @@ -36,37 +36,33 @@ import org.cbioportal.models.AnnotatedRecord; import org.springframework.batch.core.*; -import org.springframework.batch.item.*; import org.springframework.batch.core.configuration.annotation.*; -import org.springframework.context.annotation.*; +import org.springframework.batch.core.job.builder.JobBuilder; +import org.springframework.batch.core.repository.JobRepository; +import org.springframework.batch.core.step.builder.StepBuilder; +import org.springframework.batch.item.*; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.batch.core.configuration.annotation.StepScope; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.*; +import org.springframework.transaction.PlatformTransactionManager; /** * @author Zachary Heins */ @Configuration -@EnableBatchProcessing @ComponentScan(basePackages="org.cbioportal.annotator") public class BatchConfiguration { public static final String ANNOTATION_JOB = "annotationJob"; - @Autowired - public JobBuilderFactory jobBuilderFactory; - - @Autowired - public StepBuilderFactory stepBuilderFactory; - @Value("${chunk:1000000}") - private String chunk; + private String chunkSize; @Bean - public Job annotationJob() + public Job annotationJob(JobRepository jobRepository, Step step) { - return jobBuilderFactory.get(ANNOTATION_JOB) - .start(step()) + return new JobBuilder(ANNOTATION_JOB, jobRepository) + .start(step) .build(); } @@ -76,10 +72,10 @@ public AnnotationUtil annotationUtil() { } @Bean - public Step step() + public Step step(JobRepository jobRepository, PlatformTransactionManager transactionManager) { - return stepBuilderFactory.get("step") - . chunk(Integer.parseInt(chunk)) + return new StepBuilder("step", jobRepository) + . chunk(Integer.parseInt(chunkSize), transactionManager) .reader(reader()) .processor(processor()) .writer(writer()) diff --git a/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/MutationRecordReader.java b/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/MutationRecordReader.java index 98330b18..da888d8a 100644 --- a/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/MutationRecordReader.java +++ b/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/MutationRecordReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 - 2020 Memorial Sloan-Kettering Cancer Center. + * Copyright (c) 2016 - 2024 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 @@ -66,7 +66,7 @@ public class MutationRecordReader implements ItemStreamReader { private String filename; @Value("#{jobParameters[replace]}") - private boolean replace; + private Boolean replace; @Value("#{jobParameters[isoformOverride]}") private String isoformOverride; @@ -115,7 +115,7 @@ public void open(ExecutionContext ec) throws ItemStreamException { allAnnotatedRecords = annotator.annotateRecordsUsingGET(summaryStatistics, mutationRecords, isoformOverride, replace, true, stripMatchingBases, ignoreOriginalGenomicLocation, addOriginalGenomicLocation, noteColumn); } // if output-format option is supplied, we only need to convert its data into header - if (outputFormat != null) { + if (outputFormat != null && !outputFormat.equals("")) { if ("extended".equals(outputFormat)) { header.addAll(ExtendedMafFormat.headers); } else if ("minimal".equals(outputFormat)) { diff --git a/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/MutationRecordWriter.java b/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/MutationRecordWriter.java index 969f6034..c243becb 100644 --- a/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/MutationRecordWriter.java +++ b/annotationPipeline/src/main/java/org/cbioportal/annotation/pipeline/MutationRecordWriter.java @@ -98,7 +98,7 @@ public void close() throws ItemStreamException { } @Override - public void write(List items) throws Exception { + public void write(Chunk items) throws Exception { if (recordsToWriteCount > 0) { flatFileItemWriter.write(items); } diff --git a/annotationPipeline/src/test/java/org/cbioportal/annotation/SpringBatchIntegrationTest.java b/annotationPipeline/src/test/java/org/cbioportal/annotation/SpringBatchIntegrationTest.java index 8ef57755..2a5ee1f2 100644 --- a/annotationPipeline/src/test/java/org/cbioportal/annotation/SpringBatchIntegrationTest.java +++ b/annotationPipeline/src/test/java/org/cbioportal/annotation/SpringBatchIntegrationTest.java @@ -70,7 +70,6 @@ public void check_if_maf_file_still_the_same_when_annotating_with_uniprot_transc .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "uniprot") - .addString("errorReportLocation", null) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); } @@ -87,7 +86,6 @@ public void check_if_maf_file_still_the_same_when_annotating_with_mskcc_transcri .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "mskcc") - .addString("errorReportLocation", null) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); } @@ -104,7 +102,6 @@ public void check_if_minimal_example_maf_file_still_the_same_when_annotating_wit .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "uniprot") - .addString("errorReportLocation", null) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); } @@ -121,7 +118,6 @@ public void check_if_corner_cases_example_maf_file_still_the_same_when_annotatin .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "uniprot") - .addString("errorReportLocation", null) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); } @@ -138,7 +134,6 @@ public void check_if_corner_cases_example_maf_file_still_the_same_when_annotatin .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "mskcc") - .addString("errorReportLocation", null) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); } @@ -155,7 +150,6 @@ public void check_if_corner_cases_example_maf_file_still_the_same_when_annotatin .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "uniprot") - .addString("errorReportLocation", null) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); } @@ -172,7 +166,6 @@ public void check_if_corner_cases_example_maf_file_still_the_same_when_annotatin .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "mskcc") - .addString("errorReportLocation", null) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); } @@ -194,7 +187,6 @@ public void run_vcf2maf_test_case_mskcc() throws Exception { .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "mskcc") - .addString("errorReportLocation", null) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); } @@ -216,7 +208,6 @@ public void run_vcf2maf_test_case_uniprot() throws Exception { .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "uniprot") - .addString("errorReportLocation", null) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); } @@ -233,7 +224,6 @@ public void check_if_my_variant_info_provides_gnomad_annotations() throws Except .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "uniprot") - .addString("errorReportLocation", null) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); } @@ -250,7 +240,6 @@ public void check_if_nucleotide_context_provides_Ref_Tri_and_Var_Tri_columns() t .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "uniprot") - .addString("errorReportLocation", null) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); } @@ -268,7 +257,6 @@ public void test_output_format_extended() throws Exception { .addString("outputFormat", "extended") .addString("replace", String.valueOf(true)) .addString("isoformOverride", "uniprot") - .addString("errorReportLocation", null) .addString("postIntervalSize", String.valueOf(-1)) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); @@ -287,7 +275,6 @@ public void test_output_format_minimal() throws Exception { .addString("outputFormat", "minimal") .addString("replace", String.valueOf(true)) .addString("isoformOverride", "uniprot") - .addString("errorReportLocation", null) .addString("postIntervalSize", String.valueOf(-1)) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); @@ -310,7 +297,6 @@ public void test_output_format_with_formatFileHeaders() throws Exception { .addString("outputFormat", "Hugo_Symbol,Entrez_Gene_Id,Center,NCBI_Build,Chromosome,Annotation_Status") .addString("replace", String.valueOf(true)) .addString("isoformOverride", "uniprot") - .addString("errorReportLocation", null) .addString("postIntervalSize", String.valueOf(-1)) .toJobParameters(); testWith(jobParameters, expectedFile, actualFile); @@ -328,7 +314,6 @@ public void test_if_output_contains_original_genomic_location() throws Exception .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "mskcc") - .addString("errorReportLocation", null) .addString("postIntervalSize", String.valueOf(-1)) .addString("addOriginalGenomicLocation", String.valueOf(true)) .toJobParameters(); @@ -347,7 +332,6 @@ public void test_strip_off_first_matching_base() throws Exception { .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "mskcc") - .addString("errorReportLocation", null) .addString("postIntervalSize", String.valueOf(-1)) .addString("stripMatchingBases", "first") .toJobParameters(); @@ -366,7 +350,6 @@ public void test_no_strip_off_matching_bases() throws Exception { .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "mskcc") - .addString("errorReportLocation", null) .addString("postIntervalSize", String.valueOf(-1)) .addString("stripMatchingBases", "none") .toJobParameters(); @@ -385,7 +368,6 @@ public void test_ignore_original_genomic_location_in_input() throws Exception { .addString("outputFilename", actualFile) .addString("replace", String.valueOf(true)) .addString("isoformOverride", "mskcc") - .addString("errorReportLocation", null) .addString("postIntervalSize", String.valueOf(-1)) .addString("stripMatchingBases", "none") .addString("ignoreOriginalGenomicLocation", String.valueOf(true)) @@ -404,4 +386,4 @@ private void testWith(JobParameters jobParameters, String expectedPath, String a assertEquals("COMPLETED", actualJobExitStatus.getExitCode()); AssertFile.assertFileEquals(expectedResult, actualResult); } -} \ No newline at end of file +} diff --git a/annotator/pom.xml b/annotator/pom.xml index 2bef2359..c52f7b44 100644 --- a/annotator/pom.xml +++ b/annotator/pom.xml @@ -43,6 +43,21 @@ gson 2.10.1 + + com.github.cbioportal + maf + 1.0.0 + + + ch.qos.logback + logback-core + + + ch.qos.logback + logback-classic + + + diff --git a/annotator/src/main/java/org/cbioportal/annotator/internal/GenomeNexusImpl.java b/annotator/src/main/java/org/cbioportal/annotator/internal/GenomeNexusImpl.java index 7fb9f3bd..12f831cf 100644 --- a/annotator/src/main/java/org/cbioportal/annotator/internal/GenomeNexusImpl.java +++ b/annotator/src/main/java/org/cbioportal/annotator/internal/GenomeNexusImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 - 2020 Memorial Sloan-Kettering Cancer Center. + * Copyright (c) 2016 - 2024 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 @@ -67,7 +67,7 @@ * */ -@Configuration +@Configuration(enforceUniqueMethods=false) public class GenomeNexusImpl implements Annotator { @Value("${genomenexus.base:https://www.genomenexus.org}") diff --git a/annotator/src/test/java/org/cbioportal/annotator/MockGenomeNexusImpl.java b/annotator/src/test/java/org/cbioportal/annotator/MockGenomeNexusImpl.java index 263aff2f..fe793551 100644 --- a/annotator/src/test/java/org/cbioportal/annotator/MockGenomeNexusImpl.java +++ b/annotator/src/test/java/org/cbioportal/annotator/MockGenomeNexusImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 - 2020 Memorial Sloan-Kettering Cancer Center. + * Copyright (c) 2018 - 2024 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 @@ -64,7 +64,7 @@ * * @author ochoaa */ -@Configuration +@Configuration(enforceUniqueMethods=false) public class MockGenomeNexusImpl extends GenomeNexusImpl { private final boolean REPLACE = false; diff --git a/databaseAnnotator/pom.xml b/databaseAnnotator/pom.xml deleted file mode 100644 index 005f8061..00000000 --- a/databaseAnnotator/pom.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - 4.0.0 - org.cbioportal.annotation.pipeline - databaseAnnotator - - 0-auto-generated-version-SNAPSHOT - cBioPortal Database Annotator - Annotates mutations in database with missing information using Genome Nexus - - - org.cbioportal.annotation.pipeline - master - - 0-auto-generated-version-SNAPSHOT - - - - org.cbioportal.database.DatabaseAnnotator - - - - - org.springframework - spring-web - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - - commons-lang - commons-lang - 2.4 - - - commons-cli - commons-cli - 1.3 - - - commons-dbcp - commons-dbcp - 1.4 - jar - - - - - org.hibernate - hibernate-validator - 5.3.6.Final - - - javax.el - javax.el-api - 2.2.4 - - - cglib - cglib-nodep - 3.2.2 - - - com.google.guava - guava - 19.0 - - - org.glassfish.web - javax.el - 2.2.4 - - - javax.validation - validation-api - 1.1.0.Final - - - - - com.mysema.querydsl - querydsl-sql - 3.7.2 - jar - - - com.querydsl - querydsl-sql-spatial - 4.1.2 - jar - - - com.querydsl - querydsl-maven-plugin - 4.1.2 - - - com.querydsl - querydsl-jpa - 4.1.2 - - - mysql - mysql-connector-java - 8.0.16 - - - - - org.cbioportal.annotation.pipeline - annotator - 1.0.0 - - - - - msource - http://www.querydsl.com/static/querydsl/4.1.2/ - - - - diff --git a/databaseAnnotator/src/main/java/org/cbioportal/database/DatabaseAnnotator.java b/databaseAnnotator/src/main/java/org/cbioportal/database/DatabaseAnnotator.java deleted file mode 100644 index 7d66b15f..00000000 --- a/databaseAnnotator/src/main/java/org/cbioportal/database/DatabaseAnnotator.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 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 - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal CMO-Pipelines. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.cbioportal.database; - -import org.cbioportal.database.annotator.BatchConfiguration; -import org.apache.commons.cli.*; -import org.apache.commons.cli.Options; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.batch.core.*; -import org.springframework.batch.core.launch.JobLauncher; - -/** - * - * @author heinsz - */ - -@SpringBootApplication -public class DatabaseAnnotator { - - private static Logger log = LoggerFactory.getLogger(DatabaseAnnotator.class); - - private static Options getOptions(String[] args){ - Options gnuOptions = new Options(); - gnuOptions.addOption("h", "help", false, "shows this help document and quits."); - gnuOptions.addOption("i", "isoform", true, "Isoform desired for annotation. mskcc or uniprot"); - gnuOptions.addOption("s", "studies", true, "Colon (:) delimited studies)"); - return gnuOptions; - } - - private static void help(Options gnuOptions, int exitStatus){ - HelpFormatter helpFormatter = new HelpFormatter(); - helpFormatter.printHelp("Darwin Pipeline", gnuOptions); - System.exit(exitStatus); - } - - - private static void launchJob(String[] args, String isoform, String studies) throws Exception{ - SpringApplication app = new SpringApplication(DatabaseAnnotator.class); - - ConfigurableApplicationContext ctx = app.run(args); - JobLauncher jobLauncher = ctx.getBean(JobLauncher.class); - JobParameters jobParameters = new JobParametersBuilder() - .addString("isoform", isoform) - .addString("studies", studies) - .toJobParameters(); - Job databaseAnnotatorJob = ctx.getBean(BatchConfiguration.DATABASE_ANNOTATOR_JOB, Job.class); - JobExecution jobExecution = jobLauncher.run(databaseAnnotatorJob, jobParameters); - ctx.close(); - } - - public static void main(String[] args) throws Exception{ - Options gnuOptions = DatabaseAnnotator.getOptions(args); - CommandLineParser parser = new GnuParser(); - CommandLine commandLine = parser.parse(gnuOptions, args); - if (commandLine.hasOption("h") || !commandLine.hasOption("i")) { - help(gnuOptions, 0); - } - - launchJob(args, commandLine.getOptionValue("isoform"), commandLine.getOptionValue("studies")); - } -} diff --git a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/AnnotateRecordsProcessor.java b/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/AnnotateRecordsProcessor.java deleted file mode 100644 index d4ecf99c..00000000 --- a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/AnnotateRecordsProcessor.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2017 * 2019 Memorial Sloan-Kettering Cancer Center. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal CMO-Pipelines. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.cbioportal.database.annotator; - -import java.sql.*; -import com.querydsl.sql.SQLQueryFactory; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import org.cbioportal.models.*; -import org.cbioportal.annotator.Annotator; -import org.cbioportal.annotator.GenomeNexusAnnotationFailureException; -import org.cbioportal.database.annotator.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.batch.item.ItemProcessor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.client.*; - -/** - * - * @author heinsz - */ - -public class AnnotateRecordsProcessor implements ItemProcessor{ - @Value("#{jobParameters[isoform]}") - private String isoform; - - @Value("#{jobParameters[stripMatchingBases]}") - private String stripMatchingBases; - - @Value("#{jobParameters[ignoreOriginalGenomicLocation]}") - private Boolean ignoreOriginalGenomicLocation; - - @Value("#{jobParameters[addOriginalGenomicLocation]}") - private Boolean addOriginalGenomicLocation; - - @Value("#{jobParameters[noteColumn]}") - private Boolean noteColumn; - - @Autowired - Annotator annotator; - - @Autowired - SQLQueryFactory databaseAnnotatorQueryFactory; - - public final static int NA_INT = -1; - - private final Logger LOG = LoggerFactory.getLogger(AnnotateRecordsProcessor.class); - - @Override - public MutationEvent process(MutationEvent i) throws Exception { - // first make a MutationRecord that we can send to Genome Nexus to annotate - Map mafLine = new HashMap<>(); - String chromosome; - if (i.getCHR().equals("23")) { - chromosome = "X"; - } - else if (i.getCHR().equals("24")) { - chromosome = "Y"; - } - else { - chromosome = i.getCHR(); - } - mafLine.put("Chromosome", chromosome); - mafLine.put("Start_Position", String.valueOf(i.getSTART_POSITION())); - mafLine.put("End_Position", String.valueOf(i.getEND_POSITION())); - mafLine.put("Reference_Allele", i.getREFERENCE_ALLELE()); - mafLine.put("Tumor_Seq_Allele2", i.getTUMOR_SEQ_ALLELE()); - MutationRecord record = annotator.createRecord(mafLine); - AnnotatedRecord annotatedRecord; - try { - annotatedRecord = annotator.annotateRecord(record, true, isoform, true, stripMatchingBases, ignoreOriginalGenomicLocation, addOriginalGenomicLocation, noteColumn); - } - catch (GenomeNexusAnnotationFailureException ex1) { - LOG.warn("Failed to annotate record: " + ex1.getMessage()); - return i; - } - catch (HttpServerErrorException | ResourceAccessException e) { - LOG.error("Failed to annotate record - errors accessing Genome Nexus"); - return i; - } - - // If the mutation is a 5' or 3' flank mutation, or any other UTR, it shouldn't be in the database as these are supposed to be filtered.. Remove it. - if (annotatedRecord.getVARIANT_CLASSIFICATION().equals("5'Flank") && annotatedRecord.getHUGO_SYMBOL().equals("TERT")) { - i.setPROTEIN_CHANGE("Promoter"); - } - else if (annotatedRecord.getVARIANT_CLASSIFICATION().equals("5'Flank") || - annotatedRecord.getVARIANT_CLASSIFICATION().equals("3'Flank") || - annotatedRecord.getVARIANT_CLASSIFICATION().equals("IGR") || - annotatedRecord.getVARIANT_CLASSIFICATION().equals("Intron") || - annotatedRecord.getVARIANT_CLASSIFICATION().equals("RNA") || - annotatedRecord.getVARIANT_CLASSIFICATION().equals("5'UTR") || - annotatedRecord.getVARIANT_CLASSIFICATION().equals("3'UTR")) { - LOG.info("Mutation event " + String.valueOf(i.getMUTATION_EVENT_ID()) + " classification is in non translated region of genome. Removing from the database."); - deleteMutation(i); - return null; - } - - // lets do some sanity checking to make sure good values came back from genome nexus - String chr = !(annotatedRecord.getCHROMOSOME() == null || annotatedRecord.getCHROMOSOME().isEmpty()) ? annotatedRecord.getCHROMOSOME() : i.getCHR(); - Integer start = i.getSTART_POSITION(); - Integer end = i.getEND_POSITION(); - try { - start = Integer.parseInt(annotatedRecord.getSTART_POSITION()); - end = Integer.parseInt(annotatedRecord.getEND_POSITION()); - } - catch (NumberFormatException e) { - LOG.warn("Record with non parseable start or end positions encountered.\n\tMUTATION_EVENT_ID: " + i.getMUTATION_EVENT_ID()); - } - String ref = !(annotatedRecord.getREFERENCE_ALLELE() == null || annotatedRecord.getREFERENCE_ALLELE().isEmpty()) ? annotatedRecord.getREFERENCE_ALLELE() : i.getREFERENCE_ALLELE(); - String alt = !(annotatedRecord.getTUMOR_SEQ_ALLELE2() == null || annotatedRecord.getTUMOR_SEQ_ALLELE2().isEmpty()) ? annotatedRecord.getTUMOR_SEQ_ALLELE2() : i.getTUMOR_SEQ_ALLELE(); - String type = !(annotatedRecord.getVARIANT_CLASSIFICATION() == null || annotatedRecord.getVARIANT_CLASSIFICATION().isEmpty()) ? annotatedRecord.getVARIANT_CLASSIFICATION() : i.getMUTATION_TYPE(); - String codon = !(annotatedRecord.getCODONS() == null || annotatedRecord.getCODONS().isEmpty()) ? annotatedRecord.getCODONS() : i.getONCOTATOR_CODON_CHANGE(); - Integer proteinStart = !(annotatedRecord.getPROTEIN_POSITION() == null || annotatedRecord.getPROTEIN_POSITION().isEmpty()) ? getProteinPosStart(annotatedRecord.getPROTEIN_POSITION(), annotatedRecord.getHGVSP_SHORT()) : i.getONCOTATOR_PROTEIN_POS_START(); - Integer proteinEnd = !(annotatedRecord.getPROTEIN_POSITION() == null || annotatedRecord.getPROTEIN_POSITION().isEmpty()) ? getProteinPosEnd(annotatedRecord.getPROTEIN_POSITION(), annotatedRecord.getHGVSP_SHORT()) : i.getONCOTATOR_PROTEIN_POS_END(); - String change = !(annotatedRecord.getHGVSP_SHORT() == null || annotatedRecord.getHGVSP_SHORT().isEmpty()) ? annotatedRecord.getHGVSP_SHORT() : i.getPROTEIN_CHANGE(); - String pDot = "p."; - if (change.startsWith(pDot)) { - change = change.substring(pDot.length()); - } - return new MutationEvent(i.getMUTATION_EVENT_ID(), chr, start, end, ref, alt, change, type, codon, proteinStart, proteinEnd); - } - - private static int getProteinPosStart(String proteinPosition, String proteinChange) { - // parts[0] is the protein start-end positions, parts[1] is the length - String[] parts = proteinPosition.split("/"); - - int position = getPartInt(0, parts[0].split("-")); - - // there is a case where the protein change is "-" - if (position == NA_INT) { - // try to extract it from protein change value - Pattern p = Pattern.compile(".*[A-Z]([0-9]+)[^0-9]+"); - Matcher m = p.matcher(proteinChange); - if (m.find()) { - position = Integer.parseInt(m.group(1)); - } - } - return position; - } - - private static int getProteinPosEnd(String proteinPosition, String proteinChange) { - // parts[0] is the protein start-end positions, parts[1] is the length - String[] parts = proteinPosition.split("/"); - int end = getPartInt(1, parts[0].split("-")); - // if no end position is provided, - // then use start position as end position - if (end == -1) { - end = getProteinPosStart(proteinPosition, proteinChange); - } - return end; - } - - private static Integer getPartInt(int index, String[] parts) { - try { - String part = parts[index]; - return (int)(Float.parseFloat(part)); - } catch (ArrayIndexOutOfBoundsException e) { - return NA_INT; - } catch (NumberFormatException e) { - return NA_INT; - } - } - - private void deleteMutation(MutationEvent event) throws Exception { - // Need to delete the mutation event and all mutations associated with it. - LOG.info("Deleting mutations associated with mutation event " + event.getMUTATION_EVENT_ID()); - Connection con = databaseAnnotatorQueryFactory.getConnection(); - PreparedStatement pstmt_delete_mutations = con.prepareStatement("delete from mutation where mutation_event_id = ?"); - pstmt_delete_mutations.setInt(1, event.getMUTATION_EVENT_ID()); - pstmt_delete_mutations.execute(); - - LOG.info("Deleting mutation event " + event.getMUTATION_EVENT_ID()); - PreparedStatement pstmt_delete_mutation_event = con.prepareStatement("delete from mutation_event where mutation_event_id = ?"); - pstmt_delete_mutation_event.setInt(1, event.getMUTATION_EVENT_ID()); - pstmt_delete_mutation_event.execute(); - con.close(); - - } -} diff --git a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/AnnotateRecordsReader.java b/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/AnnotateRecordsReader.java deleted file mode 100644 index 69b7f03e..00000000 --- a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/AnnotateRecordsReader.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 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 - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal CMO-Pipelines. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.cbioportal.database.annotator; - -import com.querydsl.core.types.Projections; -import com.querydsl.sql.SQLQueryFactory; -import java.util.*; -import org.cbioportal.database.annotator.model.*; -import org.springframework.batch.item.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; -import static com.querydsl.core.alias.Alias.$; -import static com.querydsl.core.alias.Alias.alias; -import org.springframework.beans.factory.annotation.Value; - -/** - * - * @author heinsz - */ - -public class AnnotateRecordsReader implements ItemStreamReader{ - @Value("#{jobParameters[studies]}") - private String studies; - - @Autowired - SQLQueryFactory databaseAnnotatorQueryFactory; - - private final String MISSING_PROTEIN_CHANGE = "MUTATED"; - - private List mutationEvents; - - @Override - public void open(ExecutionContext ec) throws ItemStreamException { - List studyList = new ArrayList<>(); - if (studies != null && !studies.trim().equals("")) { - studyList = Arrays.asList(studies.split(":")); - } - this.mutationEvents = getMutationEvents(studyList); - - } - - @Override - public void update(ExecutionContext ec) throws ItemStreamException {} - - @Override - public void close() throws ItemStreamException {} - - @Override - public MutationEvent read() throws Exception { - if (!mutationEvents.isEmpty()) { - return mutationEvents.remove(0); - } - return null; - } - - @Transactional - private List getMutationEvents(List studyList) { - MutationEvent qMutationEvent = alias(MutationEvent.class, BatchConfiguration.MUTATION_EVENT_TABLE); - Mutation qMutation = alias(Mutation.class, BatchConfiguration.MUTATION_TABLE); - Sample qSample = alias(Sample.class, BatchConfiguration.SAMPLE_TABLE); - Patient qPatient = alias(Patient.class, BatchConfiguration.PATIENT_TABLE); - CancerStudy qCancerStudy = alias(CancerStudy.class, BatchConfiguration.CANCER_STUDY_TABLE); - - List mutationEvents = new ArrayList<>(); - if (studyList.size() > 0) { - mutationEvents = databaseAnnotatorQueryFactory.select( - Projections.constructor(MutationEvent.class, $(qMutationEvent.getMUTATION_EVENT_ID()), - $(qMutationEvent.getCHR()), - $(qMutationEvent.getSTART_POSITION()), - $(qMutationEvent.getEND_POSITION()), - $(qMutationEvent.getREFERENCE_ALLELE()), - $(qMutationEvent.getTUMOR_SEQ_ALLELE()), - $(qMutationEvent.getPROTEIN_CHANGE()), - $(qMutationEvent.getMUTATION_TYPE()), - $(qMutationEvent.getONCOTATOR_CODON_CHANGE()), - $(qMutationEvent.getONCOTATOR_PROTEIN_POS_START()), - $(qMutationEvent.getONCOTATOR_PROTEIN_POS_END()))) - .from($(qMutationEvent)) - .join($(qMutation)) - .on($(qMutationEvent.getMUTATION_EVENT_ID()).eq($(qMutation.getMUTATION_EVENT_ID()))) - .join($(qSample)) - .on($(qMutation.getSAMPLE_ID()).eq($(qSample.getINTERNAL_ID()))) - .join($(qPatient)) - .on($(qSample.getPATIENT_ID()).eq($(qPatient.getINTERNAL_ID()))) - .join($(qCancerStudy)) - .on($(qPatient.getCANCER_STUDY_ID()).eq($(qCancerStudy.getCANCER_STUDY_ID()))) - .where($(qMutationEvent.getPROTEIN_CHANGE()).eq(MISSING_PROTEIN_CHANGE) - .and($(qMutationEvent.getREFERENCE_ALLELE()).ne("")) - .and($(qMutationEvent.getREFERENCE_ALLELE()).ne($(qMutationEvent.getTUMOR_SEQ_ALLELE()))) - .and($(qCancerStudy.getCANCER_STUDY_IDENTIFIER()).in(studyList))) - .fetch(); - } - else { - mutationEvents = databaseAnnotatorQueryFactory.select( - Projections.constructor(MutationEvent.class, $(qMutationEvent.getMUTATION_EVENT_ID()), - $(qMutationEvent.getCHR()), - $(qMutationEvent.getSTART_POSITION()), - $(qMutationEvent.getEND_POSITION()), - $(qMutationEvent.getREFERENCE_ALLELE()), - $(qMutationEvent.getTUMOR_SEQ_ALLELE()), - $(qMutationEvent.getPROTEIN_CHANGE()), - $(qMutationEvent.getMUTATION_TYPE()), - $(qMutationEvent.getONCOTATOR_CODON_CHANGE()), - $(qMutationEvent.getONCOTATOR_PROTEIN_POS_START()), - $(qMutationEvent.getONCOTATOR_PROTEIN_POS_END()))) - .from($(qMutationEvent)) - .where($(qMutationEvent.getPROTEIN_CHANGE()).eq(MISSING_PROTEIN_CHANGE) - .and($(qMutationEvent.getREFERENCE_ALLELE()).ne("")) - .and($(qMutationEvent.getREFERENCE_ALLELE()).ne($(qMutationEvent.getTUMOR_SEQ_ALLELE())))) - .fetch(); - } - return mutationEvents; - } -} diff --git a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/AnnotateRecordsWriter.java b/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/AnnotateRecordsWriter.java deleted file mode 100644 index 8eda54ac..00000000 --- a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/AnnotateRecordsWriter.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 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 - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal CMO-Pipelines. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.cbioportal.database.annotator; - -import static com.querydsl.core.alias.Alias.$; -import static com.querydsl.core.alias.Alias.alias; -import com.querydsl.core.types.Projections; -import com.querydsl.sql.SQLQueryFactory; -import java.sql.*; -import java.util.List; -import org.cbioportal.database.annotator.model.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.batch.item.*; -import org.springframework.beans.factory.annotation.Autowired; - -/** - * - * @author heinsz - */ - -public class AnnotateRecordsWriter implements ItemStreamWriter{ - @Autowired - SQLQueryFactory databaseAnnotatorQueryFactory; - - private Connection con; - private final Logger LOG = LoggerFactory.getLogger(AnnotateRecordsWriter.class); - - @Override - public void open(ExecutionContext ec) throws ItemStreamException { - con = databaseAnnotatorQueryFactory.getConnection(); - } - - @Override - public void update(ExecutionContext ec) throws ItemStreamException {} - - @Override - public void close() throws ItemStreamException { - try { - con.close(); - } - catch (SQLException e) { - LOG.error("Failed to close connection!!"); - } - } - - @Override - public void write(List list) throws Exception { - for (MutationEvent event : list) { - updateMutationEventInDb(event); - } - } - - private void updateMutationEventInDb(MutationEvent annotatedEvent) throws Exception { - if (!annotatedEvent.getPROTEIN_CHANGE().equals("MUTATED")) { - PreparedStatement pstmt = con.prepareStatement("UPDATE mutation_event set chr = ?, start_position = ?, end_position = ?, reference_allele = ?, tumor_seq_allele = ?, protein_change = ?, mutation_type = ?, oncotator_codon_change = ?, oncotator_protein_pos_start = ?, oncotator_protein_pos_end = ? where mutation_event_id = ?"); - pstmt.setString(1, annotatedEvent.getCHR()); - pstmt.setInt(2, annotatedEvent.getSTART_POSITION()); - pstmt.setInt(3, annotatedEvent.getEND_POSITION()); - pstmt.setString(4, annotatedEvent.getREFERENCE_ALLELE()); - pstmt.setString(5, annotatedEvent.getTUMOR_SEQ_ALLELE()); - pstmt.setString(6, annotatedEvent.getPROTEIN_CHANGE()); - pstmt.setString(7, annotatedEvent.getMUTATION_TYPE()); - pstmt.setString(8, annotatedEvent.getONCOTATOR_CODON_CHANGE()); - pstmt.setInt(9, annotatedEvent.getONCOTATOR_PROTEIN_POS_START()); - pstmt.setInt(10, annotatedEvent.getONCOTATOR_PROTEIN_POS_END()); - pstmt.setInt(11, annotatedEvent.getMUTATION_EVENT_ID()); - try { - Integer rs = pstmt.executeUpdate(); - LOG.info("Updated mutation event. Mutation event id: " + annotatedEvent.getMUTATION_EVENT_ID()); - } - catch (SQLIntegrityConstraintViolationException e) { - List mutationEvents = getDuplicatedMutationEvents(annotatedEvent); - for (MutationEvent event : mutationEvents) { - if (event.getPROTEIN_CHANGE().equals(annotatedEvent.getPROTEIN_CHANGE())) { - updateMutationsInDb(annotatedEvent, event); - deleteMutationEvent(annotatedEvent); - } - } - } - } - else { - LOG.error("Event " + annotatedEvent.getMUTATION_EVENT_ID() + " unable to be fixed."); - } - } - - private List getDuplicatedMutationEvents(MutationEvent annotatedEvent) { - MutationEvent qMutationEvent = alias(MutationEvent.class, BatchConfiguration.MUTATION_EVENT_TABLE); - List mutationEvents = databaseAnnotatorQueryFactory.select( - Projections.constructor(MutationEvent.class, $(qMutationEvent.getMUTATION_EVENT_ID()), - $(qMutationEvent.getCHR()), - $(qMutationEvent.getSTART_POSITION()), - $(qMutationEvent.getEND_POSITION()), - $(qMutationEvent.getREFERENCE_ALLELE()), - $(qMutationEvent.getTUMOR_SEQ_ALLELE()), - $(qMutationEvent.getPROTEIN_CHANGE()), - $(qMutationEvent.getMUTATION_TYPE()), - $(qMutationEvent.getONCOTATOR_CODON_CHANGE()), - $(qMutationEvent.getONCOTATOR_PROTEIN_POS_START()), - $(qMutationEvent.getONCOTATOR_PROTEIN_POS_END()))) - .from($(qMutationEvent)) - .where($(qMutationEvent.getCHR()) - .eq(annotatedEvent.getCHR()) - .and($(qMutationEvent.getSTART_POSITION()) - .eq(annotatedEvent.getSTART_POSITION())) - .and($(qMutationEvent.getEND_POSITION()) - .eq(annotatedEvent.getEND_POSITION())) - .and($(qMutationEvent.getTUMOR_SEQ_ALLELE()) - .eq(annotatedEvent.getTUMOR_SEQ_ALLELE())) - .and($(qMutationEvent.getMUTATION_TYPE()).eq(annotatedEvent.getMUTATION_TYPE()))) - .fetch(); - return mutationEvents; - } - - private void updateMutationsInDb(MutationEvent eventToBeDeleted, MutationEvent properlyAnnotatedEvent) throws Exception{ - PreparedStatement pstmt = con.prepareStatement("UPDATE mutation set mutation_event_id = ? where mutation_event_id = ?"); - pstmt.setInt(1, properlyAnnotatedEvent.getMUTATION_EVENT_ID()); - pstmt.setInt(2, eventToBeDeleted.getMUTATION_EVENT_ID()); - pstmt.executeUpdate(); - LOG.info("Updating mutations - mutations linked to mutation event " + eventToBeDeleted.getMUTATION_EVENT_ID() + " now linked to " + properlyAnnotatedEvent.getMUTATION_EVENT_ID()); - } - - private void deleteMutationEvent(MutationEvent event) throws Exception{ - PreparedStatement pstmt = con.prepareStatement("delete from mutation_event where mutation_event_id = ?"); - pstmt.setInt(1, event.getMUTATION_EVENT_ID()); - LOG.info("Deleting mutation event. Properly annotated event already exists in database: " + event.getMUTATION_EVENT_ID()); - } -} diff --git a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/BatchConfiguration.java b/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/BatchConfiguration.java deleted file mode 100644 index 8d71d649..00000000 --- a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/BatchConfiguration.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 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 - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal CMO-Pipelines. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.cbioportal.database.annotator; - -import org.cbioportal.database.annotator.model.*; -import org.springframework.batch.core.*; -import org.springframework.batch.item.*; -import org.springframework.batch.core.configuration.annotation.*; -import org.springframework.context.annotation.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.batch.core.configuration.annotation.StepScope; -import org.springframework.beans.factory.annotation.Value; - -/** - * - * @author heinsz - */ - -@Configuration -@EnableBatchProcessing -@ComponentScan(basePackages="org.cbioportal.annotator") -public class BatchConfiguration { - - public static final String DATABASE_ANNOTATOR_JOB = "databaseAnnotatorJob"; - public static final String MUTATION_EVENT_TABLE = "mutation_event"; - public static final String MUTATION_TABLE = "mutation"; - public static final String SAMPLE_TABLE = "sample"; - public static final String PATIENT_TABLE = "patient"; - public static final String CANCER_STUDY_TABLE = "cancer_study"; - - @Value("${databaseannotator.chunk_size}") - private Integer chunkSize; - - @Autowired - public JobBuilderFactory jobBuilderFactory; - - @Autowired - public StepBuilderFactory stepBuilderFactory; - - @Bean - public Job databaseAnnotatorJob(){ - return jobBuilderFactory.get(DATABASE_ANNOTATOR_JOB) - .start(AnnotateRecordsStep()) - .build(); - } - - @Bean - public Step AnnotateRecordsStep(){ - return stepBuilderFactory.get("AnnotateRecordsStep") - . chunk(chunkSize) - .reader(annotateRecordsReader()) - .processor(annotateRecordsProcessor()) - .writer(annotateRecordsWriter()) - .build(); - } - - @Bean - @StepScope - public ItemStreamReader annotateRecordsReader(){ - return new AnnotateRecordsReader(); - } - - @Bean - @StepScope - public AnnotateRecordsProcessor annotateRecordsProcessor() - { - return new AnnotateRecordsProcessor(); - } - - @Bean - @StepScope - public ItemStreamWriter annotateRecordsWriter() - { - return new AnnotateRecordsWriter(); - } -} diff --git a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/DataSourceConfiguration.java b/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/DataSourceConfiguration.java deleted file mode 100644 index 0f2cef2f..00000000 --- a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/DataSourceConfiguration.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 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 - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal CMO-Pipelines. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.cbioportal.database.annotator; - -import com.querydsl.sql.MySQLTemplates; -import com.querydsl.sql.SQLQueryFactory; -import java.sql.SQLException; -import org.apache.commons.dbcp.BasicDataSource; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import org.springframework.beans.factory.annotation.Value; - -/** - * - * @author heinsz - */ - -@Configuration -public class DataSourceConfiguration { - - @Value("${databaseannotator.user}") - private String username; - - @Value("${databaseannotator.pass}") - private String password; - - @Value("${databaseannotator.driver}") - private String driver; - - @Value("${databaseannotator.connection_string}") - private String connection_string; - - @Bean - public SQLQueryFactory databaseAnnotatorQueryFactory() throws SQLException { - MySQLTemplates templates = new MySQLTemplates(); - com.querydsl.sql.Configuration config = new com.querydsl.sql.Configuration(templates); - return new SQLQueryFactory(config, dataSource()); - } - - public BasicDataSource dataSource() throws SQLException { - BasicDataSource dataSource = new BasicDataSource(); - dataSource.setUsername(username); - dataSource.setPassword(password); - dataSource.setDriverClassName(driver); - dataSource.setUrl(connection_string); - return dataSource; - } - -} diff --git a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/CancerStudy.java b/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/CancerStudy.java deleted file mode 100644 index b38dc23f..00000000 --- a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/CancerStudy.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 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 - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal CMO-Pipelines. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.cbioportal.database.annotator.model; - -/** - * - * @author heinsz - */ - -public class CancerStudy { - private Integer CANCER_STUDY_ID; - private String CANCER_STUDY_IDENTIFIER; - - public CancerStudy() {} - - public CancerStudy(Integer CANCER_STUDY_ID, String CANCER_STUDY_IDENTIFIER) { - this.CANCER_STUDY_ID = CANCER_STUDY_ID; - this.CANCER_STUDY_IDENTIFIER = CANCER_STUDY_IDENTIFIER; - } - - public Integer getCANCER_STUDY_ID() { - return CANCER_STUDY_ID; - } - - public void setCANCER_STUDY_ID(Integer CANCER_STUDY_ID) { - this.CANCER_STUDY_ID = CANCER_STUDY_ID; - } - - public String getCANCER_STUDY_IDENTIFIER() { - return CANCER_STUDY_IDENTIFIER; - } - - public void setCANCER_STUDY_IDENTIFIER(String CANCER_STUDY_IDENTIFIER) { - this.CANCER_STUDY_IDENTIFIER = CANCER_STUDY_IDENTIFIER; - } -} diff --git a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/Mutation.java b/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/Mutation.java deleted file mode 100644 index 0af0c9a3..00000000 --- a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/Mutation.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 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 - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal CMO-Pipelines. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.cbioportal.database.annotator.model; - -/** - * - * @author heinsz - */ - -public class Mutation { - private Integer MUTATION_EVENT_ID; - private Integer SAMPLE_ID; - - public Mutation() {} - - public Mutation(Integer MUTATION_EVENT_ID, Integer SAMPLE_ID) { - this.MUTATION_EVENT_ID = MUTATION_EVENT_ID; - this.SAMPLE_ID = SAMPLE_ID; - } - - public Integer getMUTATION_EVENT_ID() { - return MUTATION_EVENT_ID; - } - - public void setMUTATION_EVENT_ID(Integer MUTATION_EVENT_ID) { - this.MUTATION_EVENT_ID = MUTATION_EVENT_ID; - } - - public Integer getSAMPLE_ID() { - return SAMPLE_ID; - } - - public void setSAMPLE_ID(Integer SAMPLE_ID) { - this.SAMPLE_ID = SAMPLE_ID; - } -} diff --git a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/MutationEvent.java b/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/MutationEvent.java deleted file mode 100644 index 209d1fb6..00000000 --- a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/MutationEvent.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 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 - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal CMO-Pipelines. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.cbioportal.database.annotator.model; - -/** - * - * @author heinsz - */ - -public class MutationEvent { - - private Integer MUTATION_EVENT_ID; - private String CHR; - private Integer START_POSITION; - private Integer END_POSITION; - private String REFERENCE_ALLELE; - private String TUMOR_SEQ_ALLELE; - private String PROTEIN_CHANGE; - private String ONCOTATOR_CODON_CHANGE; - private Integer ONCOTATOR_PROTEIN_POS_START; - private Integer ONCOTATOR_PROTEIN_POS_END; - private String MUTATION_TYPE; - - public MutationEvent() {} - - public MutationEvent(Integer MUTATION_EVENT_ID, String CHR, Integer START_POSITION, Integer END_POSITION, String REFERENCE_ALLELE, String TUMOR_SEQ_ALLELE, String PROTEIN_CHANGE, String MUTATION_TYPE, String ONCOTATOR_CODON_CHANGE, Integer ONCOTATOR_PROTEIN_POS_START, Integer ONCOTATOR_PROTEIN_POS_END) { - this.MUTATION_EVENT_ID = MUTATION_EVENT_ID; - this.CHR = CHR; - this.START_POSITION = START_POSITION; - this.END_POSITION = END_POSITION; - this.REFERENCE_ALLELE = REFERENCE_ALLELE; - this.TUMOR_SEQ_ALLELE = TUMOR_SEQ_ALLELE; - this.PROTEIN_CHANGE = PROTEIN_CHANGE; - this.MUTATION_TYPE = MUTATION_TYPE; - this.ONCOTATOR_CODON_CHANGE = ONCOTATOR_CODON_CHANGE; - this.ONCOTATOR_PROTEIN_POS_START = ONCOTATOR_PROTEIN_POS_START; - this.ONCOTATOR_PROTEIN_POS_END = ONCOTATOR_PROTEIN_POS_END; - } - - public Integer getMUTATION_EVENT_ID() { - return MUTATION_EVENT_ID; - } - - public void setMUTATION_EVENT_ID(Integer MUTATION_EVENT_ID) { - this.MUTATION_EVENT_ID = MUTATION_EVENT_ID; - } - - public String getCHR() { - return CHR; - } - - public void setCHR(String CHR) { - this.CHR = CHR; - } - - public Integer getSTART_POSITION() { - return START_POSITION; - } - - public void setSTART_POSITION(Integer START_POSITION) { - this.START_POSITION = START_POSITION; - } - - public Integer getEND_POSITION() { - return END_POSITION; - } - - public void setEND_POSITION(Integer END_POSITION) { - this.END_POSITION = END_POSITION; - } - - public String getREFERENCE_ALLELE() { - return REFERENCE_ALLELE; - } - - public void setREFERENCE_ALLELE(String REFERENCE_ALLELE) { - this.REFERENCE_ALLELE = REFERENCE_ALLELE; - } - - public String getTUMOR_SEQ_ALLELE() { - return TUMOR_SEQ_ALLELE; - } - - public void setTUMOR_SEQ_ALLELE(String TUMOR_SEQ_ALLELE) { - this.TUMOR_SEQ_ALLELE = TUMOR_SEQ_ALLELE; - } - - public String getPROTEIN_CHANGE() { - return PROTEIN_CHANGE; - } - - public void setPROTEIN_CHANGE(String PROTEIN_CHANGE) { - this.PROTEIN_CHANGE = PROTEIN_CHANGE; - } - - public String getONCOTATOR_CODON_CHANGE() { - return ONCOTATOR_CODON_CHANGE; - } - - public void setONCOTATOR_CODON_CHANGE(String ONCOTATOR_CODON_CHANGE) { - this.ONCOTATOR_CODON_CHANGE = ONCOTATOR_CODON_CHANGE; - } - - public Integer getONCOTATOR_PROTEIN_POS_START() { - return ONCOTATOR_PROTEIN_POS_START; - } - - public void setONCOTATOR_PROTEIN_POS_START(Integer ONCOTATOR_PROTEIN_POS_START) { - this.ONCOTATOR_PROTEIN_POS_START = ONCOTATOR_PROTEIN_POS_START; - } - - public Integer getONCOTATOR_PROTEIN_POS_END() { - return ONCOTATOR_PROTEIN_POS_END; - } - - public void setONCOTATOR_PROTEIN_POS_END(Integer ONCOTATOR_PROTEIN_POS_END) { - this.ONCOTATOR_PROTEIN_POS_END = ONCOTATOR_PROTEIN_POS_END; - } - - public String getMUTATION_TYPE() { - return MUTATION_TYPE; - } - - public void setMUTATION_TYPE(String MUTATION_TYPE) { - this.MUTATION_TYPE = MUTATION_TYPE; - } -} diff --git a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/Patient.java b/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/Patient.java deleted file mode 100644 index 553220b5..00000000 --- a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/Patient.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 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 - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal CMO-Pipelines. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.cbioportal.database.annotator.model; - -/** - * - * @author heinsz - */ - -public class Patient { - private Integer INTERNAL_ID; - private Integer CANCER_STUDY_ID; - - public Patient() {} - - public Patient(Integer INTERNAL_ID, Integer CANCER_STUDY_ID) { - this.INTERNAL_ID = INTERNAL_ID; - this.CANCER_STUDY_ID = CANCER_STUDY_ID; - } - - public Integer getINTERNAL_ID() { - return INTERNAL_ID; - } - - public void setINTERNAL_ID(Integer INTERNAL_ID) { - this.INTERNAL_ID = INTERNAL_ID; - } - - public Integer getCANCER_STUDY_ID() { - return CANCER_STUDY_ID; - } - - public void setCANCER_STUDY_ID(Integer CANCER_STUDY_ID) { - this.CANCER_STUDY_ID = CANCER_STUDY_ID; - } -} diff --git a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/Sample.java b/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/Sample.java deleted file mode 100644 index 65ceb30d..00000000 --- a/databaseAnnotator/src/main/java/org/cbioportal/database/annotator/model/Sample.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 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 - * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder - * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no - * obligations to provide maintenance, support, updates, enhancements or - * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be - * liable to any party for direct, indirect, special, incidental or - * consequential damages, including lost profits, arising out of the use of this - * software and its documentation, even if Memorial Sloan-Kettering Cancer - * Center has been advised of the possibility of such damage. - */ - -/* - * This file is part of cBioPortal CMO-Pipelines. - * - * cBioPortal is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . -*/ - -package org.cbioportal.database.annotator.model; - -/** - * - * @author heinsz - */ - -public class Sample { - private Integer INTERNAL_ID; - private Integer PATIENT_ID; - - public Sample() {} - - public Sample(Integer INTERNAL_ID, Integer PATIENT_ID) { - this.INTERNAL_ID = INTERNAL_ID; - this.PATIENT_ID = PATIENT_ID; - } - - public Integer getINTERNAL_ID() { - return INTERNAL_ID; - } - - public void setINTERNAL_ID(Integer INTERNAL_ID) { - this.INTERNAL_ID = INTERNAL_ID; - } - - public Integer getPATIENT_ID() { - return PATIENT_ID; - } - - public void setPATIENT_ID(Integer PATIENT_ID) { - this.PATIENT_ID = PATIENT_ID; - } -} diff --git a/databaseAnnotator/src/main/resources/application.properties.EXAMPLE b/databaseAnnotator/src/main/resources/application.properties.EXAMPLE deleted file mode 100644 index 8d9bccc6..00000000 --- a/databaseAnnotator/src/main/resources/application.properties.EXAMPLE +++ /dev/null @@ -1,11 +0,0 @@ -spring.batch.job.enabled=false -databaseannotator.chunk_size=500 -databaseannotator.user= -databaseannotator.pass= -databaseannotator.driver=com.mysql.jdbc.Driver -databaseannotator.connection_string=jdbc:mysql:/// - -genomenexus.hgvs=/variant_annotation/hgvs/ -genomenexus.xrefs=/xrefs/ -genomenexus.isoform_query_parameter=isoformOverrideSource -genomenexus.enrichment_fields=hotspots,mutation_assessor diff --git a/databaseAnnotator/src/main/resources/banner.txt b/databaseAnnotator/src/main/resources/banner.txt deleted file mode 100644 index f01f17c0..00000000 --- a/databaseAnnotator/src/main/resources/banner.txt +++ /dev/null @@ -1,7 +0,0 @@ - _____ _ _ - / ____| | \ | | -| | __ ___ _ __ ___ _ __ ___ ___ | \| | ___ __ __ _ _ ___ -| | |_ | / _ \ | '_ \ / _ \ | '_ ` _ \ / _ \ | . ` | / _ \ \ \/ / | | | | / __| -| |__| | | __/ | | | | | (_) | | | | | | | | __/ | |\ | | __/ > < | |_| | \__ \ - \_____| \___| |_| |_| \___/ |_| |_| |_| \___| |_| \_| \___| /_/\_\ \__,_| |___/ - diff --git a/databaseAnnotator/src/main/resources/log4j.properties.EXAMPLE b/databaseAnnotator/src/main/resources/log4j.properties.EXAMPLE deleted file mode 100644 index 9d220dcf..00000000 --- a/databaseAnnotator/src/main/resources/log4j.properties.EXAMPLE +++ /dev/null @@ -1,32 +0,0 @@ -# Change INFO to DEBUG, if you want to see debugging info on underlying libraries we use. -log4j.rootLogger=INFO, a - -# Change INFO to DEBUG, if you want see debugging info on our packages only. -log4j.category.org.mskcc=INFO -#log4j.category.org.springframework=ALL - -#log4j.logger.org.springframework.security=DEBUG -#log4j.logger.org.springframework.integration=DEBUG - - -# Use the JVM option, e.g.: "java -DPORTAL_HOME=/pathto/portal_homedir", -# or - "java -DPORTAL_HOME=$PORTAL_HOME", where PORTAL_HOME is shell (environment) variable. - -## IMPORTANT - THRESHOLD SHOULD NOT BE DEBUG FOR PRODUCTION, CREDENTIALS CAN BE DISPLAYED! - -log4j.appender.a = org.apache.log4j.FileAppender - -log4j.appender.a.File = /path/to/logfile.log - -log4j.appender.a.layout = org.apache.log4j.PatternLayout -log4j.appender.a.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} [%t] %-5p %c - %m%n -log4j.appender.a.append = true - -#log4j.logger.org.hibernate=INFO, a -#log4j.logger.org.hibernate.SQL=DEBUG -#log4j.logger.org.hibernate.type=TRACE -#log4j.logger.org.hibernate.hql.ast.AST=info -#log4j.logger.org.hibernate.tool.hbm2ddl=warn -#log4j.logger.org.hibernate.hql=debug -#log4j.logger.org.hibernate.cache=info -#log4j.logger.org.hibernate.jdbc=debug diff --git a/jitpack.yml b/jitpack.yml index c37cf255..a0d1375c 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,7 +1,6 @@ jdk: - - openjdk11 + - openjdk21 before_install: - - sdk install java 11.0.20-tem - - sdk use java 11.0.20-tem + - sdk install java 21.0.2-open + - sdk use java 21.0.2-open - sdk install maven - - mvn -v diff --git a/pom.xml b/pom.xml index 10014040..bc6bfe5d 100644 --- a/pom.xml +++ b/pom.xml @@ -14,21 +14,21 @@ annotationPipeline annotator - databaseAnnotator org.springframework.boot spring-boot-starter-parent - 2.3.3.RELEASE + 3.1.4 - 11 + 21 1.7.30 - 5.2.6.RELEASE - 2.11.2 + 6.0.12 + 2.14.3 + 5.10.0 @@ -77,21 +77,6 @@ guava 29.0-jre - - com.github.cbioportal.cbioportal - maf - ee5802d836c05ed846d7d1ea3f584febdc07ffa8 - - - ch.qos.logback - logback-core - - - ch.qos.logback - logback-classic - - - com.h2database @@ -108,7 +93,7 @@ org.junit.vintage junit-vintage-engine - 5.6.2 + 5.10.1 test @@ -122,30 +107,16 @@ genomeNexusInternalApiClient 7128635f2704eb9ebe9c3062770f748ab4127003 - - org.mockito - mockito-core - 4.6.1 - test - - - org.mockito - mockito-inline - 4.6.1 - test - - net.bytebuddy - byte-buddy-dep - 1.12.10 + byte-buddy-agent + 1.14.10 test - net.bytebuddy - byte-buddy-agent - 1.12.10 + byte-buddy + 1.14.10 test