diff --git a/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/AnnotationMongo.java b/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/AnnotationMongo.java index 7120499f..cef64954 100644 --- a/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/AnnotationMongo.java +++ b/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/AnnotationMongo.java @@ -216,7 +216,7 @@ private void addConsequenceTypes(Set consequenceTypes) { consequenceTypes.forEach(this::addConsequenceType); } - private void addConsequenceType(ConsequenceTypeMongo consequenceType) { + public void addConsequenceType(ConsequenceTypeMongo consequenceType) { consequenceTypes.add(consequenceType); xrefs.addAll(generateXrefsFromConsequenceType(consequenceType)); } diff --git a/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/VariantSourceMongo.java b/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/VariantSourceMongo.java index 8869c309..b3149d58 100644 --- a/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/VariantSourceMongo.java +++ b/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/VariantSourceMongo.java @@ -55,6 +55,10 @@ public class VariantSourceMongo implements IVariantSource { public final static String METADATA_FIELD = "meta"; + public final static String METADATA_FILEFORMAT_FIELD = "fileformat"; + + public final static String METADATA_HEADER_FIELD = "header"; + @Field(value = FILEID_FIELD) private String fileId; @@ -85,6 +89,12 @@ public class VariantSourceMongo implements IVariantSource { @Field(value = STATISTICS_FIELD) private VariantGlobalStatsMongo stats; +// @Field(value = METADATA_FILEFORMAT_FIELD) +// private String MetadataFileformatField; + +// @Field(value = METADATA_HEADER_FIELD) +// private String MetadataHeaderField; + VariantSourceMongo() { //Empty spring constructor this( @@ -183,4 +193,11 @@ public void setStats(VariantGlobalStatsMongo stats) { this.stats = stats; } +// public String getMetadataFileformatField() { +// return MetadataFileformatField; +// } +// +// public String getMetadataHeaderField() { +// return MetadataHeaderField; +// } } diff --git a/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/projections/SimplifiedVariant.java b/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/projections/SimplifiedVariant.java index ebdac378..bda81ede 100644 --- a/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/projections/SimplifiedVariant.java +++ b/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/entities/projections/SimplifiedVariant.java @@ -94,4 +94,39 @@ public SimplifiedVariant(VariantType variantType, String chromosome, long start, } } + public VariantType getVariantType() { + return variantType; + } + + public String getChromosome() { + return chromosome; + } + + public long getStart() { + return start; + } + + public long getEnd() { + return end; + } + + public int getLength() { + return length; + } + + public String getReference() { + return reference; + } + + public String getAlternate() { + return alternate; + } + + public VariantAtMongo getAt() { + return at; + } + + public Set getHgvs() { + return hgvs; + } } diff --git a/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/writers/VariantMongoWriter.java b/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/writers/VariantMongoWriter.java index 3a73add1..d809eff0 100644 --- a/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/writers/VariantMongoWriter.java +++ b/variation-commons-mongodb/src/main/java/uk/ac/ebi/eva/commons/mongodb/writers/VariantMongoWriter.java @@ -102,7 +102,7 @@ private void createIndexes() { } @Override - protected void doWrite(List variants) { + public void doWrite(List variants) { BulkWriteOperation bulk = mongoOperations.getCollection(collection).initializeUnorderedBulkOperation(); for (IVariant variant : variants) { bulk.find(generateQuery(variant)).upsert().updateOne(generateUpdate(variant));