Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
MPBA
INF
Commits
610a7d3f
Commit
610a7d3f
authored
Feb 04, 2020
by
Marco Chierici
Browse files
Added random seed as variable
parent
ced6744b
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/prepare_BRCA.R
View file @
610a7d3f
...
...
@@ -16,6 +16,7 @@ OUTROOT <- DATADIR
tumor
<-
"Breast"
targets
<-
list
(
ER
=
"clin:breast_carcinoma_estrogen_receptor_status"
,
subtypes
=
"clin:PAM50Call"
)
task
<-
"ER"
base.seed
<-
78
# use 78 to (re)generate the "main" set of splits
# task-independent: generate a merged file from available omics layers
mergedFile
<-
file.path
(
OUTROOT
,
tumor
,
"merged.txt"
)
...
...
@@ -77,8 +78,7 @@ foreach(split.id=seq(0, 9), .verbose=FALSE) %dopar% {
outdir
<-
file.path
(
OUTROOT
,
tumor
,
"INF"
,
ifelse
(
task
==
"ER"
,
"breast_ER"
,
task
),
split.id
)
if
(
!
dir.exists
(
outdir
))
dir.create
(
outdir
,
recursive
=
TRUE
)
# make it so that the 1st split is for set.seed(78), which was the one created previously
set.seed
(
78
+
split.id
)
set.seed
(
base.seed
+
split.id
)
train.idx
<-
caret
::
createDataPartition
(
y
=
y
,
p
=
0.7
,
list
=
FALSE
)
train.data
<-
mrg.sub
[
train.idx
,]
train.lab
<-
y
[
train.idx
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment