Skip to content

Commit 7edfabe

Browse files
authored
Merge pull request #28 from uclahs-cds/jarbet-cluster-paths
remove cluster paths
2 parents 5889684 + f5b6813 commit 7edfabe

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
# Step 3: Cache R packages
2626
- name: Cache R packages
27-
uses: actions/cache@v2
27+
uses: actions/cache@v3
2828
with:
2929
path: ~/.cache/R
3030
key: ${{ runner.os }}-R-${{ hashFiles('**/*.R') }}

inst/example.data.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
devtools::load_all();
2+
source('config.R') # see project PRAD-000101-MethySubtypes/PrCaMethy/config.R
23
library(impute);
3-
path.data <- '/hot/project/disease/ProstateTumor/PRAD-000101-MethySubtypes/data/2024-07-16_pooled_tumour_normal_all_cpgs_all_cohorts.rds';
44

5-
example.data <- readRDS(path.data);
5+
example.data <- readRDS(arg$path.example.methy.data);
66
rownames(example.data) <- example.data$patient.id;
77
example.data <- subset(example.data, subset = cohort == 'TCGA', select = - c(patient.id, cohort));
88

inst/gene.promoter.cpgi.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
devtools::load_all();
2+
source('config.R') # see project PRAD-000101-MethySubtypes/PrCaMethy/config.R
23

34
data(cpg.annotation);
45
#data(example.data);
56
#methy <- example.data; # methylation data with patient ids as rownames, CpGs as columns
6-
path.data <- '/hot/project/disease/ProstateTumor/PRAD-000101-MethySubtypes/data/2024-07-16_pooled_tumour_normal_all_cpgs_all_cohorts.rds';
7-
methy <- readRDS(path.data);
7+
methy <- readRDS(arg$path.example.methy.data);
88
print.progress <- TRUE;
99
methy.cpgs <- colnames(methy)[grep('^cg', colnames(methy))];
1010
methy <- NULL;

inst/save.models.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1+
source('config.R') # see project PRAD-000101-MethySubtypes/PrCaMethy/config.R
12
compress <- 'xz';
23
test.mode <- FALSE;
34

4-
path.ml.res <- '/hot/project/disease/ProstateTumor/PRAD-000101-MethySubtypes/output/prediction/2025-02-05_F72-predict-clinical-and-drivers_gene-methy_association-filter_discrete-methyFALSE_updated.RData';
5-
path.final.models <- '/hot/project/disease/ProstateTumor/PRAD-000101-MethySubtypes/output/prediction/2025-02-05_PrCaMethy_final_models.rds';
6-
load(path.ml.res);
7-
final.models <- readRDS(path.final.models);
5+
load(arg$path.ml.res);
6+
final.models <- readRDS(arg$path.final.models);
87

98
# extract date from path.ml.res
10-
res.date <- gsub('.*/output/prediction/(\\d{4}-\\d{2}-\\d{2}).*', '\\1', path.ml.res);
9+
res.date <- gsub('.*/output/prediction/(\\d{4}-\\d{2}-\\d{2}).*', '\\1', arg$path.ml.res);
1110
res.date;
1211

1312
outcomes <- unique(ml.res.params$outcome);
@@ -67,11 +66,11 @@ models <- lapply(
6766
ml.res.params$top.features == final.model$top.features
6867
);
6968

70-
file <- file.path(dirname(path.ml.res), paste0(res.date, '_F72-predict-clinical-and-drivers_discrete-methyFALSE_models-', mod.id, '-', outcome, '-', final.model$top.features, '.RData'));
69+
file <- file.path(dirname(arg$path.ml.res), paste0(res.date, '_F72-predict-clinical-and-drivers_discrete-methyFALSE_models-', mod.id, '-', outcome, '-', final.model$top.features, '.RData'));
7170

7271
if (!file.exists(file)) {
7372
res.date2 <- as.Date(res.date) - 1;
74-
file <- file.path(dirname(path.ml.res), paste0(res.date2, '_F72-predict-clinical-and-drivers_discrete-methyFALSE_models-', mod.id, '-', outcome, '-', final.model$top.features, '.RData'));
73+
file <- file.path(dirname(arg$path.ml.res), paste0(res.date2, '_F72-predict-clinical-and-drivers_discrete-methyFALSE_models-', mod.id, '-', outcome, '-', final.model$top.features, '.RData'));
7574
}
7675
stopifnot(file.exists(file));
7776

inst/save.models.explore.model.size.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
devtools::load_all();
2-
res.date <- '2025-01-13';
2+
source('config.R') # see project PRAD-000101-MethySubtypes/PrCaMethy/config.R
33

4-
discrete.methy <- FALSE;
54
compress <- 'xz';
65
test.mode <- FALSE;
76

8-
path.ml.res <- paste0('/hot/project/disease/ProstateTumor/PRAD-000101-MethySubtypes/output/prediction/', res.date, '_F72-predict-clinical-and-drivers_gene-methy_association-filter_discrete-methy', discrete.methy, '.RData');
7+
arg$path.ml.res <- arg$path.ml.res;
8+
res.date <- regmatches(arg$path.ml.res, regexpr('\\d{4}-\\d{2}-\\d{2}', arg$path.ml.res));
99
tolerances <- c(0, 0.01, 0.02, 0.03, 0.04, 0.05) # use smallest model within __ of best model
1010

1111
model.size <- lapply(
1212
X = seq_along(tolerances),
1313
FUN = function(z) {
1414
tolerance <- tolerances[z];
1515

16-
load(path.ml.res);
16+
load(arg$path.ml.res);
1717

1818
outcomes <- unique(ml.res.params$outcome);
1919

@@ -80,11 +80,11 @@ model.size <- lapply(
8080

8181
mod.id <- which(ml.res.params$outcome == outcome & ml.res.params$top.features == res$top.features);
8282

83-
file <- file.path(dirname(path.ml.res), paste0(res.date, '_F72-predict-clinical-and-drivers_discrete-methyFALSE_models-', mod.id, '-', outcome, '-', res$top.features, '.RData'));
83+
file <- file.path(dirname(arg$path.ml.res), paste0(res.date, '_F72-predict-clinical-and-drivers_discrete-methyFALSE_models-', mod.id, '-', outcome, '-', res$top.features, '.RData'));
8484

8585
if (!file.exists(file)) {
8686
res.date2 <- as.Date(res.date) - 1;
87-
file <- file.path(dirname(path.ml.res), paste0(res.date2, '_F72-predict-clinical-and-drivers_discrete-methyFALSE_models-', mod.id, '-', outcome, '-', res$top.features, '.RData'));
87+
file <- file.path(dirname(arg$path.ml.res), paste0(res.date2, '_F72-predict-clinical-and-drivers_discrete-methyFALSE_models-', mod.id, '-', outcome, '-', res$top.features, '.RData'));
8888
}
8989
stopifnot(file.exists(file));
9090

inst/subtype.model.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
path.subtype.model <- '/hot/project/disease/ProstateTumor/PRAD-000101-MethySubtypes/data/2024-11-13_example-data_for-predicting-subtypes.Rdata';
2-
3-
load(path.subtype.model);
1+
source('config.R') # see project PRAD-000101-MethySubtypes/PrCaMethy/config.R
2+
load(arg$path.subtype.model);
43

54
subtype.model <- model.for.predicting.subtypes;
65
subtype.model.required.cpgs <- rownames(subtype.model$centroids);

0 commit comments

Comments
 (0)