Skip to content

Commit ae89628

Browse files
committed
app: allow users to load polyphen/sift, revel and alphamissense scores independently, #TASK-8163
1 parent fc14c9b commit ae89628

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

cellbase-app/src/main/java/org/opencb/cellbase/app/cli/admin/executors/LoadCommandExecutor.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ private void loadConservation() throws IOException, CellBaseException {
355355
private void loadProteinFunctionalPrediction() throws NoSuchMethodException, InterruptedException, ExecutionException,
356356
InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException,
357357
IOException, CellBaseException, LoaderException {
358+
// Check if SIFT/POLYPHEN source has already been loaded
359+
checkSourceAlreadyLoaded(SIFT_DATA);
360+
checkSourceAlreadyLoaded(POLYPHEN_DATA);
361+
358362
loadData(input.resolve(PROTEIN_SUBSTITUTION_PREDICTION_DATA).resolve(PROTEIN_FUNCTIONAL_PREDICTION_DATA),
359363
PROTEIN_SUBSTITUTION_PREDICTION_DATA, "prot_func_pred_");
360364
}
@@ -364,7 +368,7 @@ private void loadRevel() throws CellBaseException {
364368
checkSourceAlreadyLoaded(REVEL_DATA);
365369

366370
HashMap<String, String> collectionMap = new HashMap<>();
367-
collectionMap.put(MISSENSE_VARIATION_SCORE_DATA, REVEL_DATA + JSON_GZ_EXTENSION);
371+
collectionMap.put(PROTEIN_SUBSTITUTION_PREDICTION_DATA, REVEL_DATA + JSON_GZ_EXTENSION);
368372

369373
Path revelPath = input.resolve(PROTEIN_SUBSTITUTION_PREDICTION_DATA).resolve(REVEL_DATA);
370374
loadData(revelPath, collectionMap);
@@ -375,7 +379,7 @@ private void loadAlphaMissense() throws CellBaseException {
375379
checkSourceAlreadyLoaded(ALPHAMISSENSE_DATA);
376380

377381
HashMap<String, String> collectionMap = new HashMap<>();
378-
collectionMap.put(MISSENSE_VARIATION_SCORE_DATA, ALPHAMISSENSE_DATA + JSON_GZ_EXTENSION);
382+
collectionMap.put(PROTEIN_SUBSTITUTION_PREDICTION_DATA, ALPHAMISSENSE_DATA + JSON_GZ_EXTENSION);
379383

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

cellbase-lib/src/main/java/org/opencb/cellbase/lib/loader/MongoDBCellBaseLoader.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
import java.util.concurrent.BlockingQueue;
5252
import java.util.stream.Collectors;
5353

54-
import static org.opencb.cellbase.lib.EtlCommons.MISSENSE_VARIATION_SCORE_DATA;
54+
import static org.opencb.cellbase.lib.EtlCommons.PROTEIN_SUBSTITUTION_PREDICTION_DATA;
5555

5656
/**
5757
* Created by parce on 18/02/15.
@@ -140,10 +140,10 @@ private String getCollectionName() throws LoaderException {
140140
+ " are: " + StringUtils.join(releases, ","));
141141
}
142142

143-
// Sanity check don't populate collections already populated
144-
// Missense variation score data (i.e., revel and alphaMissense) is checked later, since revel and alphamissense are loaded
143+
// Sanity check don't populate collections already populated, one exception:
144+
// Protein substitution prediction data (i.e., polyphen, sift, revel and alphaMissense) is checked later, since they are loaded
145145
// in the same collection but independently
146-
if (!data.equalsIgnoreCase(MISSENSE_VARIATION_SCORE_DATA)) {
146+
if (!data.equalsIgnoreCase(PROTEIN_SUBSTITUTION_PREDICTION_DATA)) {
147147
for (Release dr : result.getResults()) {
148148
if (dr.getRelease() == dataRelease) {
149149
if (dr.getCollections().containsKey(data) && dr.getCollections().get(data).equals(collectionName)) {

0 commit comments

Comments
 (0)