From 614c72c65c00840020b72e5255c02ac33ee79e60 Mon Sep 17 00:00:00 2001 From: nkumar2 Date: Mon, 30 Sep 2024 09:33:06 +0100 Subject: [PATCH] minor updates --- pom.xml | 5 +++++ .../mongo/entity/subdocuments/HgvsMongo.java | 4 ++++ .../subdocuments/VariantSourceEntryMongo.java | 18 ++++++++++++++++++ .../entity/subdocuments/VariantStatsMongo.java | 13 +++++++++++++ 4 files changed, 40 insertions(+) diff --git a/pom.xml b/pom.xml index cd908cf83..de96bce84 100644 --- a/pom.xml +++ b/pom.xml @@ -8,6 +8,7 @@ eva-pipeline 2.9.8-SNAPSHOT + jar org.springframework.boot @@ -177,9 +178,13 @@ spring-boot-maven-plugin + repackage repackage + + exec + diff --git a/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/HgvsMongo.java b/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/HgvsMongo.java index 2841fed5c..8757b2ddb 100644 --- a/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/HgvsMongo.java +++ b/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/HgvsMongo.java @@ -40,4 +40,8 @@ public HgvsMongo(String type, String name) { this.type = type; this.name = name; } + + public String getName() { + return name; + } } diff --git a/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/VariantSourceEntryMongo.java b/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/VariantSourceEntryMongo.java index a75b653d3..30369a4b3 100644 --- a/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/VariantSourceEntryMongo.java +++ b/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/VariantSourceEntryMongo.java @@ -71,6 +71,20 @@ public class VariantSourceEntryMongo { // Spring empty constructor } + public VariantSourceEntryMongo(String fileId, String studyId, String[] alternates, BasicDBObject attrs, String format, BasicDBObject samp) { + this.fileId = fileId; + this.studyId = studyId; + if (alternates != null && alternates.length > 0) { + this.alternates = Arrays.stream(alternates) + .map(a -> a.toUpperCase()) + .collect(Collectors.toList()) + .toArray(new String[0]); + } + this.attrs = attrs; + this.format = format; + this.samp = samp; + } + public VariantSourceEntryMongo(String fileId, String studyId, String[] alternates, Map attributes) { this.fileId = fileId; this.studyId = studyId; @@ -193,4 +207,8 @@ public String[] getAlternates() { public BasicDBObject getAttrs() { return attrs; } + + public String getFormat() { + return format; + } } diff --git a/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/VariantStatsMongo.java b/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/VariantStatsMongo.java index e66a3071b..c6cd9ca01 100644 --- a/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/VariantStatsMongo.java +++ b/src/main/java/uk/ac/ebi/eva/commons/models/mongo/entity/subdocuments/VariantStatsMongo.java @@ -81,6 +81,19 @@ public class VariantStatsMongo { //Empty constructor for spring } + public VariantStatsMongo(String studyId, String fileId, String cohortId, float maf, float mgf, String mafAllele, String mgfGenotype, int missingAlleles, int missingGenotypes, Map numGt) { + this.studyId = studyId; + this.fileId = fileId; + this.cohortId = cohortId; + this.maf = maf; + this.mgf = mgf; + this.mafAllele = mafAllele; + this.mgfGenotype = mgfGenotype; + this.missingAlleles = missingAlleles; + this.missingGenotypes = missingGenotypes; + this.numGt = numGt; + } + public VariantStatsMongo(String studyId, String fileId, String cohortId, VariantStats stats) { this.studyId = studyId; this.fileId = fileId;