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

TASK-5318 - Implement custom annotator to allow clients private files #695

Merged
merged 8 commits into from
Sep 26, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,12 @@ public CellBaseException(String msg) {
super(msg);
}

public CellBaseException(String msg, Throwable cause) {
super(msg, cause);
}

public CellBaseException(Throwable cause) {
super(cause);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.commons.lang3.StringUtils;
import org.opencb.biodata.formats.variant.clinvar.rcv.ClinvarParser;
import org.opencb.biodata.formats.variant.clinvar.rcv.v64jaxb.*;
import org.opencb.biodata.models.sequence.SequenceLocation;
import org.opencb.biodata.models.variant.avro.*;
import org.opencb.cellbase.lib.EtlCommons;
import org.opencb.cellbase.lib.variant.VariantAnnotationUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,12 @@ public abstract class ClinicalIndexer {
protected VariantNormalizer normalizer;

public ClinicalIndexer(Path genomeSequenceFilePath) throws IOException {
// Forcing decomposition here in all cases - assuming the way CellBase stores clinical variants from here
// onwards will be decomposed and Adaptors will deal with phased/no-phased queries
// Use the same OpenCGA normalization parameters
VariantNormalizer.VariantNormalizerConfig variantNormalizerConfig
= (new VariantNormalizer.VariantNormalizerConfig())
.setReuseVariants(true)
.setNormalizeAlleles(false)
.setDecomposeMNVs(true);
.setNormalizeAlleles(true)
.setDecomposeMNVs(false);

if (genomeSequenceFilePath != null) {
logger.info("Enabling left aligning by using sequence at {}", genomeSequenceFilePath.toString());
Expand Down Expand Up @@ -231,92 +230,4 @@ protected void addHaplotypeProperty(List<EvidenceEntry> evidenceEntryList, List<
}
}
}

class SequenceLocation {
private String chromosome;
private int start;
private int end;
private String reference;
private String alternate;
private String strand;

SequenceLocation() {
}

SequenceLocation(String chromosome, int start, int end, String reference, String alternate) {
this(chromosome, start, end, reference, alternate, "+");
}

SequenceLocation(String chromosome, int start, int end, String reference, String alternate, String strand) {
this.chromosome = chromosome;
this.start = start;
this.end = end;
this.reference = reference;
this.alternate = alternate;
this.strand = strand;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("SequenceLocation{");
sb.append("chromosome='").append(chromosome).append('\'');
sb.append(", start=").append(start);
sb.append(", end=").append(end);
sb.append(", reference='").append(reference).append('\'');
sb.append(", alternate='").append(alternate).append('\'');
sb.append(", strand='").append(strand).append('\'');
sb.append('}');
return sb.toString();
}

public String getChromosome() {
return chromosome;
}

public int getStart() {
return start;
}

public int getEnd() {
return end;
}

public String getReference() {
return reference;
}

public String getAlternate() {
return alternate;
}

public String getStrand() {
return strand;
}

public void setChromosome(String chromosome) {
this.chromosome = chromosome;
}

public void setStart(int start) {
this.start = start;
}

public void setEnd(int end) {
this.end = end;
}

public void setReference(String reference) {
this.reference = reference;
}

public void setAlternate(String alternate) {
this.alternate = alternate;
}

public void setStrand(String strand) {
this.strand = strand;
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import org.opencb.biodata.models.variant.Variant;
import org.opencb.biodata.models.variant.avro.VariantAnnotation;
import org.opencb.cellbase.core.exception.CellBaseException;
import org.opencb.cellbase.core.serializer.CellBaseSerializer;
import org.opencb.cellbase.lib.EtlCommons;
import org.opencb.cellbase.lib.builders.CellBaseBuilder;
Expand Down Expand Up @@ -99,7 +100,7 @@ public ClinicalVariantBuilder(Path clinvarXMLFile, Path clinvarSummaryFile, Path
this.assembly = assembly;
}

public void parse() throws IOException, RocksDBException {
public void parse() throws IOException, RocksDBException, CellBaseException {

RocksDB rdb = null;
Options dbOption = null;
Expand Down
Loading
Loading