Skip to content

Commit

Permalink
lib: update loader for Revel data, #TASK-5441, #TASK-5388
Browse files Browse the repository at this point in the history
  • Loading branch information
jtarraga committed Jan 11, 2024
1 parent 9229576 commit 2e764a4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ public class LoadCommandOptions {
public CommonCommandOptions commonOptions = commonCommandOptions;

@Parameter(names = {"-d", "--data"}, description = "Data model type to be loaded: genome, gene, variation,"
+ " conservation, regulation, protein, clinical_variants, repeats, regulatory_pfm, splice_score, pubmed, pharmacogenomics."
+ " 'all' loads everything", required = true, arity = 1)
+ " conservation, regulation, protein, clinical_variants, repeats, regulatory_pfm, splice_score, pubmed, pharmacogenomics,"
+ " missense_variation_functional_score, alphamissense; and 'all' loads everything", required = true, arity = 1)
public String data;

@Parameter(names = {"-i", "--input"}, required = true, arity = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.opencb.cellbase.core.models.DataRelease;
import org.opencb.cellbase.core.result.CellBaseDataResult;
import org.opencb.cellbase.lib.EtlCommons;
import org.opencb.cellbase.lib.builders.RevelScoreBuilder;
import org.opencb.cellbase.lib.impl.core.CellBaseDBAdaptor;
import org.opencb.cellbase.lib.indexer.IndexManager;
import org.opencb.cellbase.lib.loader.LoadRunner;
Expand Down Expand Up @@ -198,16 +199,16 @@ public void execute() throws CellBaseException {
}
case EtlCommons.MISSENSE_VARIATION_SCORE_DATA: {
// Load data
loadIfExists(input.resolve("missense_variation_functional_score.json.gz"),
"missense_variation_functional_score");
Path path = input.resolve(EtlCommons.PROTEIN_SUBSTITUTION_PREDICTION_DATA);
loadIfExists(path.resolve(EtlCommons.MISSENSE_VARIATION_SCORE_JSON_FILENAME),
EtlCommons.PROTEIN_SUBSTITUTION_PREDICTION_DATA);

// Create index
createIndex("missense_variation_functional_score");
createIndex(EtlCommons.PROTEIN_SUBSTITUTION_PREDICTION_DATA);

// Update release (collection and sources)
List<Path> sources = new ArrayList<>(Collections.singletonList(input.resolve("revelVersion.json")));
dataReleaseManager.update(dataRelease, "missense_variation_functional_score",
EtlCommons.MISSENSE_VARIATION_SCORE_DATA, sources);
dataReleaseManager.update(dataRelease, EtlCommons.PROTEIN_SUBSTITUTION_PREDICTION_DATA,
RevelScoreBuilder.SOURCE, Collections.singletonList(path.resolve(EtlCommons.REVEL_VERSION_FILENAME)));
break;
}
case EtlCommons.ALPHAMISSENSE_DATA: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ public class EtlCommons {
public static final String PROTEIN_FUNCTIONAL_PREDICTION_DATA = "protein_functional_prediction";
// Revel
public static final String MISSENSE_VARIATION_SCORE_DATA = "missense_variation_functional_score";
public static final String MISSENSE_VARIATION_SCORE_JSON_FILENAME = "missense_variation_functional_score.json.gz";
public static final String REVEL_VERSION_FILENAME = "revelVersion.json";
// AlphaMissense
public static final String ALPHAMISSENSE_DATA = "alphamissense";
public static final String ALPHAMISSENSE_RAW_FILENAME = "AlphaMissense_hg38.tsv.gz";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public class RevelScoreBuilder extends CellBaseBuilder {

private Path revelFilePath = null;
private static final String SOURCE = "revel";
public static final String SOURCE = "revel";

public RevelScoreBuilder(Path revelDirectoryPath, CellBaseSerializer serializer) {
super(serializer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ private String getCollectionName() throws LoaderException {
if (dr.getCollections().containsKey(data)) {
String collectionName = CellBaseDBAdaptor.buildCollectionName(data, dataRelease);
if (dr.getCollections().get(data).equals(collectionName)) {
throw new LoaderException("Impossible load data " + data + " with release " + dataRelease + " since it"
+ " has already been done.");
logger.warn("Loading new data " + data + " with release " + dataRelease + " (already populated previously)");
}
}
}
Expand Down

0 comments on commit 2e764a4

Please sign in to comment.