Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update models wrt eva-pipeline issue #147 #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public AggregatedVcfLineMapper(String fileId, String studyId, Aggregation aggreg
default:
throw new IllegalArgumentException(
this.getClass().getSimpleName() + " should be used to read aggregated VCFs only, " +
"but the VariantSource.Aggregation is set to " + aggregation);
"but the Aggregation is set to " + aggregation);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ public interface IVariantSource {

IVariantGlobalStats getStats();

void addMetadata(String key, Object value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import uk.ac.ebi.eva.commons.core.models.stats.VariantGlobalStats;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
Expand Down Expand Up @@ -75,7 +76,7 @@ public VariantSource(String fileId, String fileName, String studyId, String stud
this.aggregation = aggregation;
this.date = date;
this.samplesPosition = samplesPosition;
this.metadata = metadata;
this.metadata = (metadata != null) ? metadata : new HashMap<>();
if (stats != null) {
this.stats = new VariantGlobalStats(stats);
}
Expand Down Expand Up @@ -131,6 +132,11 @@ public VariantGlobalStats getStats() {
return stats;
}

@Override
public void addMetadata(String key, Object value) {
this.metadata.put(key, value);
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down
5 changes: 5 additions & 0 deletions variation-commons-mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<artifactId>variation-commons-core</artifactId>
<version>0.7-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>uk.ac.ebi.eva</groupId>
<artifactId>biodata-models</artifactId>
<version>0.4.7</version>
</dependency>
</dependencies>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,9 @@ public void setStats(VariantGlobalStatsMongo stats) {
this.stats = stats;
}

@Override
public void addMetadata(String key, Object value) {
this.metadata.put(key, value);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,23 @@ public SimplifiedVariant(VariantType variantType, String chromosome, long start,
}
}

public String getChromosome() {
return chromosome;
}

public int getStart() {
return (int) start;
}

public int getEnd() {
return (int) end;
}

public String getReference() {
return reference;
}

public String getAlternate() {
return alternate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class ConsequenceTypeMongo implements IConsequenceType {
@Field(value = RELATIVE_POS_FIELD)
private Integer relativePosition;

ConsequenceTypeMongo() {
public ConsequenceTypeMongo() {
this(null, null, null, null, null, null, null, null, null, null, null, null, null, null);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## spring.data.mongodb.database
spring.data.mongodb.host=localhost:27017
#spring.data.mongodb.authentication-database
#spring.data.mongodb.username
#spring.data.mongodb.password
spring.data.mongodb.authentication-database=admin
spring.data.mongodb.username=appAdmin
spring.data.mongodb.password=password