Skip to content

Commit 2e764a4

Browse files
committed
lib: update loader for Revel data, #TASK-5441, #TASK-5388
1 parent 9229576 commit 2e764a4

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ public class LoadCommandOptions {
190190
public CommonCommandOptions commonOptions = commonCommandOptions;
191191

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

197197
@Parameter(names = {"-i", "--input"}, required = true, arity = 1,

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

+7-6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.opencb.cellbase.core.models.DataRelease;
2525
import org.opencb.cellbase.core.result.CellBaseDataResult;
2626
import org.opencb.cellbase.lib.EtlCommons;
27+
import org.opencb.cellbase.lib.builders.RevelScoreBuilder;
2728
import org.opencb.cellbase.lib.impl.core.CellBaseDBAdaptor;
2829
import org.opencb.cellbase.lib.indexer.IndexManager;
2930
import org.opencb.cellbase.lib.loader.LoadRunner;
@@ -198,16 +199,16 @@ public void execute() throws CellBaseException {
198199
}
199200
case EtlCommons.MISSENSE_VARIATION_SCORE_DATA: {
200201
// Load data
201-
loadIfExists(input.resolve("missense_variation_functional_score.json.gz"),
202-
"missense_variation_functional_score");
202+
Path path = input.resolve(EtlCommons.PROTEIN_SUBSTITUTION_PREDICTION_DATA);
203+
loadIfExists(path.resolve(EtlCommons.MISSENSE_VARIATION_SCORE_JSON_FILENAME),
204+
EtlCommons.PROTEIN_SUBSTITUTION_PREDICTION_DATA);
203205

204206
// Create index
205-
createIndex("missense_variation_functional_score");
207+
createIndex(EtlCommons.PROTEIN_SUBSTITUTION_PREDICTION_DATA);
206208

207209
// Update release (collection and sources)
208-
List<Path> sources = new ArrayList<>(Collections.singletonList(input.resolve("revelVersion.json")));
209-
dataReleaseManager.update(dataRelease, "missense_variation_functional_score",
210-
EtlCommons.MISSENSE_VARIATION_SCORE_DATA, sources);
210+
dataReleaseManager.update(dataRelease, EtlCommons.PROTEIN_SUBSTITUTION_PREDICTION_DATA,
211+
RevelScoreBuilder.SOURCE, Collections.singletonList(path.resolve(EtlCommons.REVEL_VERSION_FILENAME)));
211212
break;
212213
}
213214
case EtlCommons.ALPHAMISSENSE_DATA: {

cellbase-lib/src/main/java/org/opencb/cellbase/lib/EtlCommons.java

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ public class EtlCommons {
9797
public static final String PROTEIN_FUNCTIONAL_PREDICTION_DATA = "protein_functional_prediction";
9898
// Revel
9999
public static final String MISSENSE_VARIATION_SCORE_DATA = "missense_variation_functional_score";
100+
public static final String MISSENSE_VARIATION_SCORE_JSON_FILENAME = "missense_variation_functional_score.json.gz";
101+
public static final String REVEL_VERSION_FILENAME = "revelVersion.json";
100102
// AlphaMissense
101103
public static final String ALPHAMISSENSE_DATA = "alphamissense";
102104
public static final String ALPHAMISSENSE_RAW_FILENAME = "AlphaMissense_hg38.tsv.gz";

cellbase-lib/src/main/java/org/opencb/cellbase/lib/builders/RevelScoreBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
public class RevelScoreBuilder extends CellBaseBuilder {
3535

3636
private Path revelFilePath = null;
37-
private static final String SOURCE = "revel";
37+
public static final String SOURCE = "revel";
3838

3939
public RevelScoreBuilder(Path revelDirectoryPath, CellBaseSerializer serializer) {
4040
super(serializer);

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ private String getCollectionName() throws LoaderException {
151151
if (dr.getCollections().containsKey(data)) {
152152
String collectionName = CellBaseDBAdaptor.buildCollectionName(data, dataRelease);
153153
if (dr.getCollections().get(data).equals(collectionName)) {
154-
throw new LoaderException("Impossible load data " + data + " with release " + dataRelease + " since it"
155-
+ " has already been done.");
154+
logger.warn("Loading new data " + data + " with release " + dataRelease + " (already populated previously)");
156155
}
157156
}
158157
}

0 commit comments

Comments
 (0)