Skip to content

Commit

Permalink
Merge pull request #713 from opencb/TASK-7097
Browse files Browse the repository at this point in the history
TASK-7097 - Port Patch 6.3.0 -> 7.0.0 Xetabase 2.3.0 -> 3.0.0
  • Loading branch information
juanfeSanahuja authored Oct 21, 2024
2 parents 6aeead1 + 7625f39 commit eaf3244
Show file tree
Hide file tree
Showing 10 changed files with 290 additions and 651 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-approved.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
chmod +x ./.github/workflows/scripts/get-xetabase-branch.sh
echo "github.event.pull_request.base.ref: ${{ github.event.pull_request.base.ref }}"
echo "github.event.pull_request.head.ref: ${{ github.event.pull_request.head.ref }}"
xetabase_branch=$(./.github/workflows/scripts/get-xetabase-branch.sh ${{ github.event.pull_request.head.ref }})
xetabase_branch=$(./.github/workflows/scripts/get-xetabase-branch.sh ${{ github.event.pull_request.base.ref }})
echo "__Xetabase ref:__ \"${xetabase_branch}\"" | tee -a ${GITHUB_STEP_SUMMARY}
echo "xetabase_branch=${xetabase_branch}" >> $GITHUB_OUTPUT
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/scripts/get-xetabase-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ get_xetabase_branch() {
return 0
fi

# Check if the branch name starts with "release-" and follows the patterns "release-a.b.x" or "release-a.b.c.x"
if [[ "$input_branch" =~ ^release-([0-9]+)\.([0-9]+)\.x$ ]] || [[ "$input_branch" =~ ^release-([0-9]+)\.([0-9]+)\.([0-9]+)\.x$ ]]; then
# Check if the branch name starts with "release-" and follows the patterns "release-a.x.x" or "release-a.b.x"
if [[ "$input_branch" =~ ^release-([0-9]+)\.x\.x$ ]] || [[ "$input_branch" =~ ^release-([0-9]+)\.([0-9]+)\.x$ ]]; then
# Extract the MAJOR part of the branch name
MAJOR=${BASH_REMATCH[1]}
# Calculate the XETABASE_MAJOR by subtracting 3 from MAJOR
# Calculate the XETABASE_MAJOR by subtracting 4 from MAJOR of cellbase
XETABASE_MAJOR=$((MAJOR - 4))
# Check if the XETABASE_MAJOR is negative
if (( XETABASE_MAJOR < 0 )); then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ public CellBaseException(String msg) {
super(msg);
}

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

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

13 changes: 0 additions & 13 deletions cellbase-core/src/main/resources/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,6 @@ download:
clinvar:
# host: https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/ClinVarFullRelease_2021-07.xml.gz
# host: https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/ClinVarFullRelease_2022-02.xml.gz
<<<<<<< HEAD
host: https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/ClinVarFullRelease_2022-11.xml.gz
clinvarVariation:
# host: https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/clinvar_variation/ClinVarVariationRelease_2021-07.xml.gz
# host: https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/clinvar_variation/ClinVarVariationRelease_2022-02.xml.gz
host: https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/clinvar_variation/ClinVarVariationRelease_2022-11.xml.gz
=======
# host: https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/ClinVarFullRelease_2022-11.xml.gz
host: https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/RCV_xml_old_format/ClinVarFullRelease_2024-05.xml.gz
version: 2024-05
Expand All @@ -122,7 +115,6 @@ download:
# host: https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/clinvar_variation/ClinVarVariationRelease_2022-11.xml.gz
host: https://ftp.ncbi.nlm.nih.gov/pub/clinvar/xml/VCV_xml_old_format/ClinVarVariationRelease_2024-05.xml.gz
version: 2024-05
>>>>>>> release-6.2.x
clinvarSummary:
host: http://ftp.ncbi.nlm.nih.gov/pub/clinvar/tab_delimited/variant_summary.txt.gz
clinvarVariationAllele:
Expand All @@ -147,15 +139,10 @@ download:
genomicSuperDups:
host: http://hgdownload.cse.ucsc.edu/goldenPath
gwasCatalog:
<<<<<<< HEAD
host: http://resources.opencb.org/opencb/cellbase/data/gwas/gwas_catalog_v1.0.2-associations_e106_r2022-05-17.tsv
version: "1.0.2 associations_e106_r2022-05-17"
=======
#host: http://resources.opencb.org/opencb/cellbase/data/gwas/gwas_catalog_v1.0.2-associations_e106_r2022-05-17.tsv
host: "https://ftp.ebi.ac.uk/pub/databases/gwas/releases/2024/05/20/gwas-catalog-associations_ontology-annotated.tsv"
#version: "1.0.2 associations_e106_r2022-05-17"
version: "2024-05-20"
>>>>>>> release-6.2.x
hpo:
host: https://ci.monarchinitiative.org/view/hpo/job/hpo.annotations/lastSuccessfulBuild/artifact/rare-diseases/util/annotation/phenotype_to_genes.txt
disgenet:
Expand Down
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 @@ -230,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

0 comments on commit eaf3244

Please sign in to comment.