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 for better use #80

Open
wants to merge 3 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 @@ -216,7 +216,7 @@ private void addConsequenceTypes(Set<ConsequenceTypeMongo> consequenceTypes) {
consequenceTypes.forEach(this::addConsequenceType);
}

private void addConsequenceType(ConsequenceTypeMongo consequenceType) {
public void addConsequenceType(ConsequenceTypeMongo consequenceType) {
consequenceTypes.add(consequenceType);
xrefs.addAll(generateXrefsFromConsequenceType(consequenceType));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -183,4 +193,11 @@ public void setStats(VariantGlobalStatsMongo stats) {
this.stats = stats;
}

// public String getMetadataFileformatField() {
// return MetadataFileformatField;
// }
//
// public String getMetadataHeaderField() {
// return MetadataHeaderField;
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<HgvsMongo> getHgvs() {
return hgvs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void createIndexes() {
}

@Override
protected void doWrite(List<? extends IVariant> variants) {
public void doWrite(List<? extends IVariant> variants) {
BulkWriteOperation bulk = mongoOperations.getCollection(collection).initializeUnorderedBulkOperation();
for (IVariant variant : variants) {
bulk.find(generateQuery(variant)).upsert().updateOne(generateUpdate(variant));
Expand Down