Skip to content

Commit

Permalink
Merge pull request #244 from TheJacksonLaboratory/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
ielis authored Feb 26, 2024
2 parents 5c65e77 + 60b41f9 commit 1ac346b
Show file tree
Hide file tree
Showing 17 changed files with 77 additions and 71 deletions.
12 changes: 7 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
<phenopacket-schema.version>2.0.2</phenopacket-schema.version>
<silent.genes.version>0.2.5</silent.genes.version>
<htsjdk.version>3.0.5</htsjdk.version>
<guava.version>33.0.0-jre</guava.version>
<commons-csv.version>1.7</commons-csv.version>
<commons-io.version>2.8.0</commons-io.version>
<commons-net.version>3.8.0</commons-net.version>
<commons-compress.version>1.24.0</commons-compress.version>
<h2.version>1.4.200</h2.version>
<commons-io.version>2.15.1</commons-io.version>
<commons-net.version>3.9.0</commons-net.version>
<commons-compress.version>1.26.0</commons-compress.version>
<h2.version>2.2.220</h2.version>
<flyway.version>10.8.1</flyway.version>
</properties>

<developers>
Expand Down Expand Up @@ -127,7 +129,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public int insertItem(DosageRegion item) {
try (Connection connection = dataSource.getConnection()) {
connection.setAutoCommit(false);
String sql = "insert into SVANNA.CLINGEN_DOSAGE_ELEMENT(" +
" CONTIG, START, END, " +
" CONTIG, START_POS, END_POS, " +
" ID, DOSAGE_SENSITIVITY, DOSAGE_EVIDENCE) " +
" VALUES ( ?, ?, ?, ?, ?, ? )";
try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
Expand Down Expand Up @@ -83,11 +83,11 @@ public int insertItem(DosageRegion item) {

@Override
public List<DosageRegion> getOverlapping(GenomicRegion query) {
String sql = "select CONTIG, START, END, ID, DOSAGE_SENSITIVITY, DOSAGE_EVIDENCE " +
String sql = "select CONTIG, START_POS, END_POS, ID, DOSAGE_SENSITIVITY, DOSAGE_EVIDENCE " +
" from SVANNA.CLINGEN_DOSAGE_ELEMENT " +
" where CONTIG = ? " +
" and ? < END " +
" and START < ?";
" and ? < END_POS " +
" and START_POS < ?";
try (Connection connection = dataSource.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
preparedStatement.setInt(1, query.contigId());
Expand Down Expand Up @@ -119,8 +119,8 @@ public List<Dosage> geneDosageDataForHgncIdAndRegion(String hgncId, GenomicRegio
String sql = "select distinct ID, DOSAGE_SENSITIVITY, DOSAGE_EVIDENCE " +
" from SVANNA.CLINGEN_DOSAGE_ELEMENT " +
" where (CONTIG = ? " +
" and ? < END " +
" and START < ?) " +
" and ? < END_POS " +
" and START_POS < ?) " +
" or ID = ?";
try (Connection connection = dataSource.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
Expand All @@ -146,7 +146,7 @@ private List<DosageRegion> processDosageRegionStatement(PreparedStatement prepar
continue;
}
Coordinates coordinates = Coordinates.of(CoordinateSystem.zeroBased(), // database invariant
rs.getInt("START"), rs.getInt("END"));
rs.getInt("START_POS"), rs.getInt("END_POS"));
GenomicRegion location = GenomicRegion.of(contig, Strand.POSITIVE, coordinates);
Dosage dosage = Dosage.of(rs.getString("ID"),
DosageSensitivity.valueOf(rs.getString("DOSAGE_SENSITIVITY")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private List<PopulationVariant> processStatement(PreparedStatement preparedState
}
regions.add(
BasePopulationVariant.of(
GenomicRegion.of(contig, Strand.POSITIVE, CoordinateSystem.zeroBased(), rs.getInt("START"), rs.getInt("END")),
GenomicRegion.of(contig, Strand.POSITIVE, CoordinateSystem.zeroBased(), rs.getInt("START_POS"), rs.getInt("END_POS")),
rs.getString("ID"), VariantType.valueOf(rs.getString("VARIANT_TYPE")),
rs.getFloat("ALLELE_FREQUENCY"), origin));
}
Expand All @@ -74,7 +74,7 @@ public int insertItem(PopulationVariant item) {

try (Connection connection = dataSource.getConnection()) {
connection.setAutoCommit(false);
String sql = "insert into SVANNA.POPULATION_VARIANTS(CONTIG, START, END, " +
String sql = "insert into SVANNA.POPULATION_VARIANTS(CONTIG, START_POS, END_POS, " +
"ID, VARIANT_TYPE, ORIGIN, ALLELE_FREQUENCY) " +
"VALUES ( ?, ?, ?, ?, ?, ?, ? )";
try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
Expand Down Expand Up @@ -111,11 +111,11 @@ public Set<PopulationVariantOrigin> availableOrigins() {
@Override
public List<PopulationVariant> getOverlapping(GenomicRegion query, Set<PopulationVariantOrigin> origins) {

String sql = "select CONTIG, START, END, ID, VARIANT_TYPE, ORIGIN, ALLELE_FREQUENCY " +
String sql = "select CONTIG, START_POS, END_POS, ID, VARIANT_TYPE, ORIGIN, ALLELE_FREQUENCY " +
" from SVANNA.POPULATION_VARIANTS " +
" where CONTIG = ? " +
" and ? < END " +
" and START < ?";
" and ? < END_POS " +
" and START_POS < ?";
try (Connection connection = dataSource.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
preparedStatement.setInt(1, query.contigId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public int insertItem(Enhancer enhancer) {

try (Connection connection = dataSource.getConnection()) {
connection.setAutoCommit(false);
String enhancerSql = "insert into SVANNA.ENHANCERS(CONTIG, START, END, " +
String enhancerSql = "insert into SVANNA.ENHANCERS(CONTIG, START_POS, END_POS, " +
" ENHANCER_SOURCE, NAME, IS_DEVELOPMENTAL, TAU) " +
" VALUES ( ?, ?, ?, ?, ?, ?, ? )";
String tissueSpecSql = "insert into SVANNA.ENHANCER_TISSUE_SPECIFICITY(ENHANCER_ID, " +
Expand Down Expand Up @@ -111,7 +111,7 @@ public int insertItem(Enhancer enhancer) {
}

public List<Enhancer> getAllItems() {
String sql = "select E.ENHANCER_ID, CONTIG, START, END, ENHANCER_SOURCE, NAME, IS_DEVELOPMENTAL, TAU, " +
String sql = "select E.ENHANCER_ID, CONTIG, START_POS, END_POS, ENHANCER_SOURCE, NAME, IS_DEVELOPMENTAL, TAU, " +
" TERM_ID, TERM_LABEL, HPO_ID, HPO_LABEL, SPECIFICITY " +
" from SVANNA.ENHANCERS E join SVANNA.ENHANCER_TISSUE_SPECIFICITY ETS on E.ENHANCER_ID = ETS.ENHANCER_ID";
try (Connection connection = dataSource.getConnection();
Expand Down Expand Up @@ -157,12 +157,12 @@ public List<Enhancer> getOverlapping(GenomicRegion query) {
try (Connection connection = dataSource.getConnection()) {
if (!enhancerParameters.useFantom5()) {
// just VISTA
String enhancerSql = "select E.ENHANCER_ID, CONTIG, START, END, ENHANCER_SOURCE, NAME, IS_DEVELOPMENTAL, TAU, " +
String enhancerSql = "select E.ENHANCER_ID, CONTIG, START_POS, END_POS, ENHANCER_SOURCE, NAME, IS_DEVELOPMENTAL, TAU, " +
" TERM_ID, TERM_LABEL, HPO_ID, HPO_LABEL, SPECIFICITY " +
" from SVANNA.ENHANCERS E join SVANNA.ENHANCER_TISSUE_SPECIFICITY ETS on E.ENHANCER_ID = ETS.ENHANCER_ID " +
" where E.CONTIG = ? " +
" and ? < E.END " +
" and E.START < ? " +
" and ? < E.END_POS " +
" and E.START_POS < ? " +
" and E.IS_DEVELOPMENTAL = true";
try (PreparedStatement ps = connection.prepareStatement(enhancerSql)) {
ps.setInt(1, query.contigId());
Expand All @@ -172,12 +172,12 @@ public List<Enhancer> getOverlapping(GenomicRegion query) {
}
} else {
// FANTOM5 and maybe VISTA
String enhancerSql = "select E.ENHANCER_ID, CONTIG, START, END, ENHANCER_SOURCE, NAME, IS_DEVELOPMENTAL, TAU, " +
String enhancerSql = "select E.ENHANCER_ID, CONTIG, START_POS, END_POS, ENHANCER_SOURCE, NAME, IS_DEVELOPMENTAL, TAU, " +
" TERM_ID, TERM_LABEL, HPO_ID, HPO_LABEL, SPECIFICITY " +
" from SVANNA.ENHANCERS E join SVANNA.ENHANCER_TISSUE_SPECIFICITY ETS on E.ENHANCER_ID = ETS.ENHANCER_ID" +
" where E.CONTIG = ? " +
" and ? < E.END " +
" and E.START < ? " +
" and ? < E.END_POS " +
" and E.START_POS < ? " +
" and (E.IS_DEVELOPMENTAL = ? or (E.IS_DEVELOPMENTAL = false and ETS.SPECIFICITY > ?))";
try (PreparedStatement ps = connection.prepareStatement(enhancerSql)) {
ps.setInt(1, query.contigId());
Expand Down Expand Up @@ -210,7 +210,7 @@ private List<Enhancer> processEnhancers(PreparedStatement statement) throws SQLE

if (!builders.containsKey(enhancerId)) {
// database invariant
Coordinates coordinates = Coordinates.of(CoordinateSystem.zeroBased(), rs.getInt("START"), rs.getInt("END"));
Coordinates coordinates = Coordinates.of(CoordinateSystem.zeroBased(), rs.getInt("START_POS"), rs.getInt("END_POS"));
GenomicRegion location = GenomicRegion.of(contig, Strand.POSITIVE, coordinates);
BaseEnhancer.Builder builder = BaseEnhancer.builder()
.location(location)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public RepetitiveRegionDao(DataSource dataSource, GenomicAssembly genomicAssembl
}

public List<RepetitiveRegion> getAllItems() {
String sql = "select CONTIG, START, END, REPEAT_FAMILY from SVANNA.REPETITIVE_REGIONS";
String sql = "select CONTIG, START_POS, END_POS, REPEAT_FAMILY from SVANNA.REPETITIVE_REGIONS";
try (Connection connection = dataSource.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
return processStatement(preparedStatement);
Expand All @@ -42,11 +42,11 @@ public List<RepetitiveRegion> getAllItems() {

@Override
public List<RepetitiveRegion> getOverlapping(GenomicRegion query) {
String sql = "select CONTIG, START, END, REPEAT_FAMILY " +
String sql = "select CONTIG, START_POS, END_POS, REPEAT_FAMILY " +
" from SVANNA.REPETITIVE_REGIONS " +
" where CONTIG = ? " +
" and ? < END " +
" and START < ?";
" and ? < END_POS " +
" and START_POS < ?";
try (Connection connection = dataSource.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
preparedStatement.setInt(1, query.contigId());
Expand All @@ -70,7 +70,7 @@ private List<RepetitiveRegion> processStatement(PreparedStatement preparedStatem
}
regions.add(RepetitiveRegion.of(contig,
Strand.POSITIVE, CoordinateSystem.zeroBased(), // database invariant
rs.getInt("START"), rs.getInt("END"),
rs.getInt("START_POS"), rs.getInt("END_POS"),
RepeatFamily.valueOf(rs.getString("REPEAT_FAMILY"))));
}
}
Expand All @@ -83,7 +83,7 @@ public int insertItem(RepetitiveRegion item) {

try (Connection connection = dataSource.getConnection()) {
connection.setAutoCommit(false);
String sql = "insert into SVANNA.REPETITIVE_REGIONS(CONTIG, START, END, REPEAT_FAMILY) " +
String sql = "insert into SVANNA.REPETITIVE_REGIONS(CONTIG, START_POS, END_POS, REPEAT_FAMILY) " +
"VALUES ( ?, ?, ?, ? )";
try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
preparedStatement.setInt(1, item.contigId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public int insertItem(TadBoundary item) {

try (Connection connection = dataSource.getConnection()) {
connection.setAutoCommit(false);
String sql = "insert into SVANNA.TAD_BOUNDARY(CONTIG, START, END, MIDPOINT, ID, STABILITY) " +
String sql = "insert into SVANNA.TAD_BOUNDARY(CONTIG, START_POS, END_POS, MIDPOINT, ID, STABILITY) " +
"VALUES ( ?, ?, ?, ?, ?, ?)";
try (PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
preparedStatement.setInt(1, item.contigId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ create table SVANNA.ENHANCERS
(
ENHANCER_ID INT auto_increment,
CONTIG INT not null,
START INT not null,
END INT not null,
START_POS INT not null,
END_POS INT not null,
ENHANCER_SOURCE VARCHAR(50) not null,
NAME VARCHAR(255) not null,
IS_DEVELOPMENTAL BOOL not null,
TAU DOUBLE not null
);

create index SVANNA.ENHANCERS__CONTIG_START_END_IDX
on SVANNA.ENHANCERS (CONTIG, START, END);
on SVANNA.ENHANCERS (CONTIG, START_POS, END_POS);


drop table if exists SVANNA.ENHANCER_TISSUE_SPECIFICITY;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
truncate table SVANNA.ENHANCERS;

insert into SVANNA.ENHANCERS(ENHANCER_ID, CONTIG, START, END, ENHANCER_SOURCE, NAME, IS_DEVELOPMENTAL, TAU)
insert into SVANNA.ENHANCERS(ENHANCER_ID, CONTIG, START_POS, END_POS, ENHANCER_SOURCE, NAME, IS_DEVELOPMENTAL, TAU)
values (1, 1, 10, 20, 'UNKNOWN', 'first', TRUE, .123),
(2, 1, 30, 40, 'UNKNOWN', 'second', TRUE, .456);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ drop table if exists SVANNA.POPULATION_VARIANTS;
create table SVANNA.POPULATION_VARIANTS
(
CONTIG INT not null,
START INT not null,
END INT not null,
START_POS INT not null,
END_POS INT not null,

ID VARCHAR(200) not null,
VARIANT_TYPE VARCHAR(20) not null,
ORIGIN VARCHAR(40) not null,
ALLELE_FREQUENCY FLOAT not null
);
create index SVANNA.POPULATION_VARIANTS__CONTIG_START_ON_POS_END_ON_POS_IDX
on SVANNA.POPULATION_VARIANTS (CONTIG, START, END);
on SVANNA.POPULATION_VARIANTS (CONTIG, START_POS, END_POS);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
insert into SVANNA.POPULATION_VARIANTS(CONTIG, START, END, ID, VARIANT_TYPE, ORIGIN, ALLELE_FREQUENCY)
insert into SVANNA.POPULATION_VARIANTS(CONTIG, START_POS, END_POS, ID, VARIANT_TYPE, ORIGIN, ALLELE_FREQUENCY)
VALUES
( 1, 10, 10, 'abc', 'INS_ME_LINE1', 'DGV', 22.1),
( 1, 30, 30, 'def', 'INS', 'GNOMAD_SV', 23.4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ create table SVANNA.REPETITIVE_REGIONS
(
ENHANCER_ID INT auto_increment,
CONTIG INT not null,
START INT not null,
END INT not null,
START_POS INT not null,
END_POS INT not null,
REPEAT_FAMILY VARCHAR(50) not null
);
create index SVANNA.REPETITIVE_REGIONS__CONTIG_START_ON_POS_END_ON_POS_IDX
on SVANNA.REPETITIVE_REGIONS (CONTIG, START, END);
on SVANNA.REPETITIVE_REGIONS (CONTIG, START_POS, END_POS);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
insert into SVANNA.REPETITIVE_REGIONS(CONTIG, START, END, REPEAT_FAMILY)
insert into SVANNA.REPETITIVE_REGIONS(CONTIG, START_POS, END_POS, REPEAT_FAMILY)
VALUES (1, 20, 30, 'DNA_hAT_Blackjack'),
(1, 30, 40, 'SINE_tRNA_Deu'),
(2, 30, 40, 'RNA_srpRNA');
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ drop table if exists SVANNA.TAD_BOUNDARY;
create table SVANNA.TAD_BOUNDARY
(
CONTIG INT not null,
START INT not null, -- zero-based start on POSITIVE strand
END INT not null, -- zero-based end on POSITIVE strand
START_POS INT not null, -- zero-based start on POSITIVE strand
END_POS INT not null, -- zero-based end on POSITIVE strand
MIDPOINT INT not null,
ID VARCHAR(200) not null,
STABILITY FLOAT not null
);
create index SVANNA.TAD_BOUNDARY__CONTIG_START_END_IDX
on SVANNA.TAD_BOUNDARY (CONTIG, START, END);
on SVANNA.TAD_BOUNDARY (CONTIG, START_POS, END_POS);
create index SVANNA.TAD_BOUNDARY__CONTIG_MIDPOINT_IDX
on SVANNA.TAD_BOUNDARY (CONTIG, MIDPOINT);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
insert into SVANNA.TAD_BOUNDARY(CONTIG, START, END, MIDPOINT, ID, STABILITY)
insert into SVANNA.TAD_BOUNDARY(CONTIG, START_POS, END_POS, MIDPOINT, ID, STABILITY)
values
( 1, 20, 40, 30, 'one', .8),
( 1, 30, 50, 40, 'two', .9),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,9 @@ private static void ingestTads(TadProperties properties, GenomicAssembly assembl
URL mcArthurSupplement = new URL(properties.mcArthur2021Supplement());
Path localPath = downloadUrl(mcArthurSupplement, tmpDir);

try (ZipFile zipFile = new ZipFile(localPath.toFile())) {
try (ZipFile zipFile = ZipFile.builder()
.setFile(localPath.toFile())
.get()) {
// this is the single file from the entire ZIP that we're interested in
String entryName = "emcarthur-TAD-stability-heritability-184f51a/data/boundariesByStability/100kbBookendBoundaries_mainText/100kbBookendBoundaries_byStability.bed";
ZipArchiveEntry entry = zipFile.getEntry(entryName);
Expand Down Expand Up @@ -683,7 +685,7 @@ public Integer call() throws Exception {
DigestUtils digest = new DigestUtils(MessageDigestAlgorithms.SHA_256);

for (File resource : resources) {
if (LOGGER.isDebugEnabled()) LOGGER.debug("Calculating SHA256 digest for `{}`", resource);
LOGGER.debug("Calculating SHA256 digest for `{}`", resource);
String hexDigest = digest.digestAsHex(resource);
fileToDigest.put(resource, hexDigest);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.monarchinitiative.svanna.ingest.io;

import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.compress.utils.IOUtils;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -36,7 +36,7 @@ public void addResource(File file, String name) throws IOException {
return;
}

ArchiveEntry entry = archive.createArchiveEntry(file, name);
ZipArchiveEntry entry = archive.createArchiveEntry(file, name);
archive.putArchiveEntry(entry);
if (attributes.isRegularFile()) {
try (InputStream is = Files.newInputStream(file.toPath())) {
Expand Down
Loading

0 comments on commit 1ac346b

Please sign in to comment.