Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ download_log.json



.claude
6 changes: 3 additions & 3 deletions cellbase-app/app/cloud/docker/cellbase-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG TAG
FROM opencb/cellbase-base:$TAG
ARG TAG=latest
FROM opencb/cellbase-base:${TAG}

LABEL org.label-schema.vendor="OpenCB" \
org.label-schema.name="cellbase-builder" \
Expand Down Expand Up @@ -32,4 +32,4 @@ RUN cd /opt/ensembl && \
## Give writting permissions to allow the script ensembl_canonical.pl to create sub-folder for cache purposes
RUN chmod -R 777 /opt/cellbase/scripts/ensembl-scripts/

ENV PERL5LIB=$PERL5LIB:/opt/ensembl/bioperl-live:/opt/ensembl/ensembl/modules:/opt/ensembl/ensembl-variation/modules:/opt/ensembl/ensembl-funcgen/modules:/opt/ensembl/ensembl-compara/modules:/opt/ensembl/lib/perl/5.18.2:/opt/cellbase/scripts/ensembl-scripts:/opt/ensembl/biomart-perl/lib
ENV PERL5LIB=/opt/ensembl/bioperl-live:/opt/ensembl/ensembl/modules:/opt/ensembl/ensembl-variation/modules:/opt/ensembl/ensembl-funcgen/modules:/opt/ensembl/ensembl-compara/modules:/opt/ensembl/lib/perl/5.18.2:/opt/cellbase/scripts/ensembl-scripts:/opt/ensembl/biomart-perl/lib
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@
print "Generating the JSON file for the Sift version.\n";
$jsonVersion->{"id"} = "sift";
$jsonVersion->{"name"} = "Sift";
open(FILE, ">".$outdir."/siftVersion.json") || die "error opening file\n";
open(FILE, ">".$outdir."/siftVersion.json") || die "error opening file [$outdir/siftVersion.json]: $!\n";
print FILE to_json($jsonVersion) . "\n";
close(FILE);

# PolyPhen version file
print "Generating the JSON file for the PolyPhen version\n";
$jsonVersion->{"id"} = "polyphen";
$jsonVersion->{"name"} = "PolyPhen";
open(FILE, ">".$outdir."/polyphenVersion.json") || die "error opening file\n";
open(FILE, ">".$outdir."/polyphenVersion.json") || die "error opening file [$outdir/polyphenVersion.json]: $!\n";
print FILE to_json($jsonVersion) . "\n";
close(FILE);

Expand Down Expand Up @@ -158,7 +158,8 @@
#my @all_chroms = @{$slice_adaptor->fetch_all('chromosome')};
foreach my $chr(@chromosomes) {
my @transcripts = @{$chr->get_all_Transcripts()};
open(FILE, ">".$outdir."/prot_func_pred_chr_".$chr->seq_region_name.".json") || die "error opening file\n";
my $filename = $outdir."/prot_func_pred_chr_".$chr->seq_region_name.".json";
open(FILE, ">".$filename) || die "error opening file [$filename]: $!\n";
print @transcripts." transcripts fetched!\n";
foreach my $trans(@transcripts) {
if($trans->biotype eq 'protein_coding') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.opencb.cellbase.app.cli.admin.AdminCliOptionsParser;
import org.opencb.cellbase.core.config.SpeciesConfiguration;
import org.opencb.cellbase.core.exception.CellBaseException;
import org.opencb.cellbase.core.models.DataSource;
import org.opencb.cellbase.core.models.Release;
import org.opencb.cellbase.core.result.CellBaseDataResult;
import org.opencb.cellbase.core.utils.DatabaseNameUtils;
Expand Down Expand Up @@ -354,22 +355,34 @@ private void loadConservation() throws IOException, CellBaseException {
private void loadProteinFunctionalPrediction() throws NoSuchMethodException, InterruptedException, ExecutionException,
InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException,
IOException, CellBaseException, LoaderException {
// Check if SIFT/POLYPHEN source has already been loaded
checkSourceAlreadyLoaded(SIFT_DATA);
checkSourceAlreadyLoaded(POLYPHEN_DATA);

loadData(input.resolve(PROTEIN_SUBSTITUTION_PREDICTION_DATA).resolve(PROTEIN_FUNCTIONAL_PREDICTION_DATA),
PROTEIN_SUBSTITUTION_PREDICTION_DATA, "prot_func_pred_");
}

private void loadRevel() throws CellBaseException {
// Check if REVEL source has already been loaded
checkSourceAlreadyLoaded(REVEL_DATA);

HashMap<String, String> collectionMap = new HashMap<>();
collectionMap.put(PROTEIN_SUBSTITUTION_PREDICTION_DATA, REVEL_DATA + JSON_GZ_EXTENSION);

loadData(input.resolve(PROTEIN_SUBSTITUTION_PREDICTION_DATA).resolve(REVEL_DATA), collectionMap);
Path revelPath = input.resolve(PROTEIN_SUBSTITUTION_PREDICTION_DATA).resolve(REVEL_DATA);
loadData(revelPath, collectionMap);
}

private void loadAlphaMissense() throws CellBaseException {
// Check if AlphaMissense source has already been loaded
checkSourceAlreadyLoaded(ALPHAMISSENSE_DATA);

HashMap<String, String> collectionMap = new HashMap<>();
collectionMap.put(PROTEIN_SUBSTITUTION_PREDICTION_DATA, ALPHAMISSENSE_DATA + JSON_GZ_EXTENSION);

loadData(input.resolve(PROTEIN_SUBSTITUTION_PREDICTION_DATA).resolve(ALPHAMISSENSE_DATA), collectionMap);
Path alphaMissensePath = input.resolve(PROTEIN_SUBSTITUTION_PREDICTION_DATA).resolve(ALPHAMISSENSE_DATA);
loadData(alphaMissensePath, collectionMap);
}

private void loadClinical() throws FileNotFoundException {
Expand Down Expand Up @@ -677,4 +690,16 @@ private Release getDataReleaseForLoading(DataReleaseManager dataReleaseManager)
}
return lastDataRelease;
}

private void checkSourceAlreadyLoaded(String sourceId) throws CellBaseException {
Release release = getDataReleaseForLoading(dataReleaseManager);
if (release.getSources() != null) {
for (DataSource source : release.getSources()) {
if (sourceId.equalsIgnoreCase(source.getId())) {
throw new CellBaseException("Loading data '" + sourceId + "' with release " + dataRelease
+ " failed: source '" + sourceId + "' already loaded previously");
}
}
}
}
}
Loading