Skip to content

Commit

Permalink
Merge pull request #20 from molgenis/chore/bump_deps
Browse files Browse the repository at this point in the history
chore:bump dependencies, resolve warnings, small PanelMapper fix
  • Loading branch information
bartcharbon authored Sep 11, 2023
2 parents cf73a81 + 3639938 commit 655266f
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 16 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.5</version>
<version>3.1.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId>org.molgenis</groupId>
<artifactId>vip-utils</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>

<name>vip-utils</name>
<description>Shared classes and tools between VIP repo's</description>
Expand Down Expand Up @@ -47,9 +47,9 @@

<properties>
<java.version>17</java.version>
<samtools.htsjdk.version>3.0.5</samtools.htsjdk.version>
<jacoco-maven-plugin.version>0.8.9</jacoco-maven-plugin.version>
<opencsv.version>5.7.1</opencsv.version>
<samtools.htsjdk.version>4.0.1</samtools.htsjdk.version>
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
<opencsv.version>5.8</opencsv.version>
<commons.cli.version>1.4</commons.cli.version>
</properties>

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/molgenis/vcf/utils/InvalidPedException.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package org.molgenis.vcf.utils;

import java.io.Serial;

import static java.lang.String.format;

public class InvalidPedException extends RuntimeException {
@Serial
private static final long serialVersionUID = 1L;
private static final String MESSAGE = "Invalid PED line, expected 6 columns on line: %s";
private final String argument;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package org.molgenis.vcf.utils;

import java.io.Serial;

import static java.lang.String.format;

public class InvalidSamplePhenotypesException extends RuntimeException {

@Serial
private static final long serialVersionUID = 1L;
private static final String MESSAGE =
"Invalid phenotype argument: '%s', valid example: 'sample1/phenotype1;phenotype2,sample2/phenotype1'";
private final String argument;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package org.molgenis.vcf.utils;

import java.io.Serial;

public class MixedPhenotypesException extends IllegalArgumentException {
@Serial
private static final long serialVersionUID = 1L;
private static final String MESSAGE =
"Mixing general phenotypes for all samples and phenotypes per sample is not allowed.";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.molgenis.vcf.utils;

import java.io.Serial;

import static java.lang.String.format;
import static java.util.Objects.requireNonNull;

Expand All @@ -8,7 +10,8 @@
* strategy.
*/
public class UnexpectedEnumException extends RuntimeException {

@Serial
private static final long serialVersionUID = 1L;
private static final String UNEXPECTED_ENUM_CONSTANT_FORMAT =
"Unexpected enum constant '%s' for type '%s'";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

import org.springframework.lang.NonNull;

public class UnknownFieldException extends RuntimeException {
import java.io.Serial;

public class UnknownFieldException extends RuntimeException {
@Serial
private static final long serialVersionUID = 1L;
private static final String MESSAGE = "No known nested metadata for identifier '%s'.";
private final String id;

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/molgenis/vcf/utils/model/NestedField.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.ToString;
import lombok.experimental.SuperBuilder;

Expand All @@ -16,6 +15,5 @@
@AllArgsConstructor
@ToString(callSuper=true)
public class NestedField extends Field {
@NonNull
@Default int index = -1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ private static Path getOutput(CommandLine commandLine) {
} else {
outputPath = Path.of(commandLine
.getOptionValue(OPT_INPUT)
.replace(" ", "_")
.replace(".txt", "_mapped.tsv"));
}
return outputPath;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package org.molgenis.vcf.utils.sample;

import java.io.Serial;

import static java.lang.String.format;

public class UnsupportedPedException extends RuntimeException {
@Serial
private static final long serialVersionUID = 1L;
private static final String MESSAGE =
"Phenotype value '%s' that is not an affection status (-9, 0, 1 or 2) is unsupported";
private final String token;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package org.molgenis.vcf.utils.sample.mapper;

import java.io.Serial;

import static java.lang.String.format;
import static java.util.Objects.requireNonNull;

public class IllegalPhenotypeArgumentException extends RuntimeException {
@Serial
private static final long serialVersionUID = 1L;
private static final String MESSAGE =
"Illegal phenotype '%s' phenotypes must be specified in CURIE (prefix:reference) format.";
private final String argument;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package org.molgenis.vcf.utils.sample.mapper;

public class VcfParseException extends RuntimeException {
import java.io.Serial;

public class VcfParseException extends RuntimeException {
@Serial
private static final long serialVersionUID = 1L;
public VcfParseException(String message) {
super(message);
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/molgenis/vcf/utils/sample/model/Sample.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ public class Sample {

// index of the sample in the VCF, -1 means the sample is not available in the file.
@JsonProperty("index")
@NonNull
int index;

@JsonProperty("proband")
@NonNull
boolean proband;
}
3 changes: 1 addition & 2 deletions src/test/java/org/molgenis/vcf/utils/panelmapper/AppIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void test() throws IOException {
assertEquals(expected, output);
}
@Test
void testNoOuputParam() throws IOException {
void testNoOutputParam() throws IOException {
File inputFile = ResourceUtils.getFile("classpath:panel.txt");
String inputPath = inputFile.toString();
String mappingFile = ResourceUtils.getFile("classpath:mapping.txt").toString();
Expand All @@ -43,7 +43,6 @@ void testNoOuputParam() throws IOException {
Path expectedPath = ResourceUtils.getFile("classpath:expected.tsv").toPath();
String expected = Files.readString(expectedPath).replaceAll("\\R", "\n");
Path outputPath = Path.of(inputFile.getPath()
.replace(" ", "_")
.replace(".txt", "_mapped.tsv"));
String output = Files.readString(outputPath).replaceAll("\\R", "\n");
assertEquals(expected, output);
Expand Down

0 comments on commit 655266f

Please sign in to comment.