diff --git a/documents/logos/GWAS_Catalog_banner_2206x356.png b/documents/logos/GWAS_Catalog_banner_2206x356.png new file mode 100644 index 0000000000..810987c440 Binary files /dev/null and b/documents/logos/GWAS_Catalog_banner_2206x356.png differ diff --git a/documents/logos/GWAS_Catalog_circle_178x178.png b/documents/logos/GWAS_Catalog_circle_178x178.png new file mode 100644 index 0000000000..3cfa2a7472 Binary files /dev/null and b/documents/logos/GWAS_Catalog_circle_178x178.png differ diff --git a/documents/logos/GWAS_Catalog_logo_160x160.png b/documents/logos/GWAS_Catalog_logo_160x160.png new file mode 100644 index 0000000000..bdcbd81ab2 Binary files /dev/null and b/documents/logos/GWAS_Catalog_logo_160x160.png differ diff --git a/documents/logos/GWAS_Catalog_logo_240x240.png b/documents/logos/GWAS_Catalog_logo_240x240.png new file mode 100644 index 0000000000..ad4797a189 Binary files /dev/null and b/documents/logos/GWAS_Catalog_logo_240x240.png differ diff --git a/documents/logos/GWAS_Catalog_logo_31x31.png b/documents/logos/GWAS_Catalog_logo_31x31.png new file mode 100644 index 0000000000..3f1d531cbb Binary files /dev/null and b/documents/logos/GWAS_Catalog_logo_31x31.png differ diff --git a/documents/logos/GWAS_Catalog_logo_48x48.png b/documents/logos/GWAS_Catalog_logo_48x48.png new file mode 100644 index 0000000000..63ab38a678 Binary files /dev/null and b/documents/logos/GWAS_Catalog_logo_48x48.png differ diff --git a/documents/logos/GWAS_Catalog_logo_73x73.png b/documents/logos/GWAS_Catalog_logo_73x73.png new file mode 100644 index 0000000000..5e699397b9 Binary files /dev/null and b/documents/logos/GWAS_Catalog_logo_73x73.png differ diff --git a/goci-tools/goci-catalog-io/src/main/java/uk/ac/ebi/spot/goci/repository/CatalogImportRepository.java b/goci-tools/goci-catalog-io/src/main/java/uk/ac/ebi/spot/goci/repository/CatalogImportRepository.java index 0bf9b5c702..237565e6be 100644 --- a/goci-tools/goci-catalog-io/src/main/java/uk/ac/ebi/spot/goci/repository/CatalogImportRepository.java +++ b/goci-tools/goci-catalog-io/src/main/java/uk/ac/ebi/spot/goci/repository/CatalogImportRepository.java @@ -35,7 +35,6 @@ public class CatalogImportRepository { private SimpleJdbcInsert insertStudyReport; private SimpleJdbcInsert insertAssociationReport; - private AssociationReportUpdate updateAssociationReport; private static final String SELECT_STUDY_REPORTS = "SELECT ID FROM STUDY_REPORT WHERE STUDY_ID = ?"; @@ -52,6 +51,17 @@ public class CatalogImportRepository { private static final String SELECT_ASSOCIATION_REPORTS = "SELECT ID FROM ASSOCIATION_REPORT WHERE ASSOCIATION_ID = ?"; + private static final String UPDATE_ASSOCIATION_REPORTS = + "UPDATE ASSOCIATION_REPORT SET " + + "LAST_UPDATE_DATE = ?, " + + "GENE_ERROR = ?, " + + "SNP_ERROR = ?, " + + "SNP_GENE_ON_DIFF_CHR = ?, " + + "NO_GENE_FOR_SYMBOL = ?, " + + "GENE_NOT_ON_GENOME = ?, " + + "SNP_PENDING = ? " + + "WHERE ID = ?"; + private static final String UPDATE_MAPPED_DATA = "UPDATE CATALOG_SUMMARY_VIEW SET " + "REGION = ?, " + @@ -73,7 +83,6 @@ protected Logger getLog() { return log; } - @Autowired(required = false) public CatalogImportRepository(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; @@ -101,8 +110,6 @@ public CatalogImportRepository(JdbcTemplate jdbcTemplate) { "GENE_NOT_ON_GENOME", "SNP_PENDING") .usingGeneratedKeyColumns("ID"); - - this.updateAssociationReport = new AssociationReportUpdate(jdbcTemplate); } public void loadNCBIMappedData(String[][] data) { @@ -426,28 +433,29 @@ private void addStudyReport(Long studyId, "trying to add study report with no paper title"); } - Map studyArgs = new HashMap<>(); - studyArgs.put("STUDY_ID", studyId); - studyArgs.put("PUBMED_ID_ERROR", pubmedIdError); - studyArgs.put("NCBI_PAPER_TITLE", ncbiPaperTitle); - studyArgs.put("NCBI_FIRST_AUTHOR", ncbiFirstAuthor); - studyArgs.put("NCBI_NORMALIZED_FIRST_AUTHOR", ncbiNormalisedFirstAuthor); - studyArgs.put("NCBI_FIRST_UPDATE_DATE", ncbiFirstUpdateDate); - - // Check for an existing id in database + int rows; try { - Long studyReportIdInDatabase = jdbcTemplate.queryForObject(SELECT_STUDY_REPORTS, Long.class, studyId); - Object[] params = {pubmedIdError, ncbiPaperTitle, ncbiFirstAuthor, ncbiNormalisedFirstAuthor, - ncbiFirstUpdateDate, studyReportIdInDatabase}; - jdbcTemplate.update(UPDATE_STUDY_REPORTS, params); - + Long studyReportId = jdbcTemplate.queryForObject(SELECT_STUDY_REPORTS, Long.class, studyId); + rows = jdbcTemplate.update(UPDATE_STUDY_REPORTS, + pubmedIdError, + ncbiPaperTitle, + ncbiFirstAuthor, + ncbiNormalisedFirstAuthor, + ncbiFirstUpdateDate, + studyReportId); } catch (EmptyResultDataAccessException e) { - insertStudyReport.execute(studyArgs); - + Map studyArgs = new HashMap<>(); + studyArgs.put("STUDY_ID", studyId); + studyArgs.put("PUBMED_ID_ERROR", pubmedIdError); + studyArgs.put("NCBI_PAPER_TITLE", ncbiPaperTitle); + studyArgs.put("NCBI_FIRST_AUTHOR", ncbiFirstAuthor); + studyArgs.put("NCBI_NORMALIZED_FIRST_AUTHOR", ncbiNormalisedFirstAuthor); + studyArgs.put("NCBI_FIRST_UPDATE_DATE", ncbiFirstUpdateDate); + rows = insertStudyReport.execute(studyArgs); } - + getLog().trace("Adding report for Study ID: " + studyId + " - Updated " + rows + " rows"); } private void addAssociationReport(Long associationId, @@ -458,33 +466,35 @@ private void addAssociationReport(Long associationId, String noGeneForSymbol, String geneNotOnGenome) { - Map associationArgs = new HashMap<>(); - - associationArgs.put("ASSOCIATION_ID", associationId); - associationArgs.put("LAST_UPDATE_DATE", lastUpdateDate); - associationArgs.put("GENE_ERROR", geneError); - associationArgs.put("SNP_ERROR", snpError); - associationArgs.put("SNP_GENE_ON_DIFF_CHR", snpGeneOnDiffChr); - associationArgs.put("NO_GENE_FOR_SYMBOL", noGeneForSymbol); - associationArgs.put("GENE_NOT_ON_GENOME", geneNotOnGenome); - associationArgs.put("SNP_PENDING", null); - - System.out.println(associationId + " - " + lastUpdateDate + " - " + geneError + " - " + snpError + " - " + - snpGeneOnDiffChr + " - " + noGeneForSymbol + " - " + geneNotOnGenome); - System.out.println(associationArgs.size()); + // Check for an existing id in database + int rows; try { - Long associationReportIdInDatabase = + Long associationReportId = jdbcTemplate.queryForObject(SELECT_ASSOCIATION_REPORTS, Long.class, associationId); - associationArgs.put("ID", associationReportIdInDatabase); - updateAssociationReport.updateByNamedParam(associationArgs); + rows = jdbcTemplate.update(UPDATE_ASSOCIATION_REPORTS, + lastUpdateDate, + geneError, + snpError, + snpGeneOnDiffChr, + noGeneForSymbol, + geneNotOnGenome, + null, + associationReportId); } catch (EmptyResultDataAccessException e) { - getLog().info("No previous report for association " + associationId); - insertAssociationReport.execute(associationArgs); - + Map associationArgs = new HashMap<>(); + associationArgs.put("ASSOCIATION_ID", associationId); + associationArgs.put("LAST_UPDATE_DATE", lastUpdateDate); + associationArgs.put("GENE_ERROR", geneError); + associationArgs.put("SNP_ERROR", snpError); + associationArgs.put("SNP_GENE_ON_DIFF_CHR", snpGeneOnDiffChr); + associationArgs.put("NO_GENE_FOR_SYMBOL", noGeneForSymbol); + associationArgs.put("GENE_NOT_ON_GENOME", geneNotOnGenome); + associationArgs.put("SNP_PENDING", null); + rows = insertAssociationReport.execute(associationArgs); } - + getLog().trace("Adding report for Association ID: " + associationId + " - Updated " + rows + " rows"); } private void addMappedData(Long studyId, @@ -511,7 +521,8 @@ private void addMappedData(Long studyId, isIntergenic, studyId, associationId); - System.out.println("Updated " + rows + " rows"); + getLog().trace("Adding mapped data for Study ID: " + studyId + " and Association ID: " + associationId + " " + + "- Updated " + rows + " rows"); } private static T[] extractRange(T[] array, int startIndex) { @@ -562,42 +573,4 @@ public AssociationReportUpdate(JdbcTemplate jdbcTemplate) { } } - - private class MappedDataUpdate extends SqlUpdate { - public MappedDataUpdate(JdbcTemplate jdbcTemplate) { - // String region = null; // REGION - // String chromosomeName = null; // CHROMOSOME_NAME - // String chromosomePosition = null; // CHROMOSOME_POSITION - // String upstreamMappedGene = null; // UPSTREAM_MAPPED_GENE - // String upstreamEntrezGeneId = null; // UPSTREAM_ENTREZ_GENE_ID - // Integer upstreamGeneDistance = null; // UPSTREAM_GENE_DISTANCE - // String downstreamMappedGene = null; // DOWNSTREAM_MAPPED_GENE - // String downstreamEntrezGeneId = null; // DOWNSTREAM_ENTREZ_GENE_ID - // Integer downstreamGeneDistance = null; // DOWNSTREAM_GENE_DISTANCE - // Boolean isIntergenic = null; // IS_INTERGENIC - setJdbcTemplate(jdbcTemplate); - setSql("UPDATE CATALOG_SUMMARY_VIEW SET " + - "REGION = ?," + - "CHROMOSOME_NAME = ?, " + - "CHROMOSOME_POSITION = ?, " + - "UPSTREAM_MAPPED_GENE = ?, " + - "UPSTREAM_ENTREZ_GENE_ID = ?," + - "UPSTREAM_GENE_DISTANCE = ?," + - "DOWNSTREAM_MAPPED_GENE = ?," + - "DOWNSTREAM_GENE_DISTANCE = ?," + - "IS_INTERGENIC = ?" + - "WHERE STUDY_ID = ? AND ASSOCIATION_ID = ?"); - declareParameter(new SqlParameter("region", Types.VARCHAR)); - declareParameter(new SqlParameter("chromosomeName", Types.VARCHAR)); - declareParameter(new SqlParameter("chromosomePosition", Types.VARCHAR)); - declareParameter(new SqlParameter("upstreamMappedGene", Types.VARCHAR)); - declareParameter(new SqlParameter("upstreamEntrezGeneId", Types.VARCHAR)); - declareParameter(new SqlParameter("upstreamGeneDistance", Types.NUMERIC)); - declareParameter(new SqlParameter("downstreamMappedGene", Types.VARCHAR)); - declareParameter(new SqlParameter("downstreamEntrezGeneId", Types.VARCHAR)); - declareParameter(new SqlParameter("downstreamGeneDistance", Types.NUMERIC)); - declareParameter(new SqlParameter("isIntergenic", Types.BOOLEAN)); - compile(); - } - } } \ No newline at end of file