Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HIDDEN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sPlot
HIDDEN
Commits
4798a781
Commit
4798a781
authored
5 years ago
by
Francesco Sabatini
Browse files
Options
Downloads
Patches
Plain Diff
Added new argument start.round
parent
69338819
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
01b_MesobromionCluster.R
+11
-6
11 additions, 6 deletions
01b_MesobromionCluster.R
cli_01b.r
+2
-1
2 additions, 1 deletion
cli_01b.r
session.R
+3
-2
3 additions, 2 deletions
session.R
submit_01b.sh
+2
-1
2 additions, 1 deletion
submit_01b.sh
with
18 additions
and
10 deletions
01b_MesobromionCluster.R
+
11
−
6
View file @
4798a781
...
@@ -55,7 +55,8 @@ get.best <- function(x, N){
...
@@ -55,7 +55,8 @@ get.best <- function(x, N){
Mesobromion
<-
function
(
species.path
,
traits.path
,
output
,
myfunction
=
"get.corXY.bootstrap"
,
Mesobromion
<-
function
(
species.path
,
traits.path
,
output
,
myfunction
=
"get.corXY.bootstrap"
,
combinations
=
c
(
"all"
,
"sequential"
),
max.inter.t
,
chunkn
,
chunk.i
,
nperm
=
199
,
ncores
){
combinations
=
c
(
"all"
,
"sequential"
),
start.round
=
NA
,
max.inter.t
,
chunkn
,
chunk.i
,
nperm
=
199
,
ncores
){
if
(
ncores
>
1
){
if
(
ncores
>
1
){
require
(
parallel
)
require
(
parallel
)
...
@@ -72,9 +73,9 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
...
@@ -72,9 +73,9 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
species
<-
read_delim
(
species.path
,
delim
=
"\t"
)
%>%
species
<-
read_delim
(
species.path
,
delim
=
"\t"
)
%>%
as.data.frame
()
as.data.frame
()
traits
<-
read_delim
(
traits.path
,
delim
=
"\t"
)
%>%
traits
<-
read_delim
(
traits.path
,
delim
=
"\t"
)
%>%
as.data.frame
()
%>%
as.data.frame
()
#
%>%
### TEMPORARY FOR TESTING!
### TEMPORARY FOR TESTING!
dplyr
::
select
(
1
:
11
)
#
dplyr::select(1:11)
traits
<-
traits
%>%
traits
<-
traits
%>%
...
@@ -115,8 +116,11 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
...
@@ -115,8 +116,11 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
if
(
combinations
==
"sequential"
){
if
(
combinations
==
"sequential"
){
corXY.ci
<-
NULL
if
(
!
is.na
(
start.round
)){
for
(
nround
in
1
:
max.inter.t
){
print
(
paste
(
"Load data from previous round="
,
start.round
-1
))
load
(
file
=
paste
(
output
,
"_round_"
,
start.round
-1
,
".RData"
,
sep
=
""
))
}
else
{
corXY.ci
<-
NULL
}
for
(
nround
in
start.round
:
max.inter.t
){
corXY.output
<-
NULL
corXY.output
<-
NULL
## select combination of traits based on best
## select combination of traits based on best
if
(
nround
==
1
)
{
if
(
nround
==
1
)
{
...
@@ -211,8 +215,9 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
...
@@ -211,8 +215,9 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
}
else
{
print
(
paste
(
"no new best at round="
,
nround
))}
}
else
{
print
(
paste
(
"no new best at round="
,
nround
))}
}
}
print
(
paste
(
"save intermediate results at round"
,
nround
))
print
(
paste
(
"save intermediate results at round"
,
nround
))
save
(
corXY.output
,
file
=
paste
(
output
,
"_round_"
,
nround
,
".RData"
,
sep
=
""
))
save
(
corXY.output
,
best
,
traits.sign.alone
,
corXY.ci
,
file
=
paste
(
output
,
"_round_"
,
nround
,
".RData"
,
sep
=
""
))
}
}
}
}
if
(
ncores
>
1
){
stopCluster
(
cl
)}
if
(
ncores
>
1
){
stopCluster
(
cl
)}
}
}
This diff is collapsed.
Click to expand it.
cli_01b.r
+
2
−
1
View file @
4798a781
...
@@ -65,7 +65,7 @@ parser <- OptionParser(
...
@@ -65,7 +65,7 @@ parser <- OptionParser(
epilogue
=
"use with caution, the awesomeness might slap you in the face!"
epilogue
=
"use with caution, the awesomeness might slap you in the face!"
)
)
cli
<-
parse_args
(
parser
,
positional_arguments
=
5
)
cli
<-
parse_args
(
parser
,
positional_arguments
=
6
)
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# assign a few shortcuts
# assign a few shortcuts
...
@@ -76,6 +76,7 @@ traits.path <- cli$args[2]
...
@@ -76,6 +76,7 @@ traits.path <- cli$args[2]
output
<-
cli
$
args
[
3
]
output
<-
cli
$
args
[
3
]
myfunction
<-
cli
$
args
[
4
]
myfunction
<-
cli
$
args
[
4
]
combinations
<-
cli
$
args
[
5
]
combinations
<-
cli
$
args
[
5
]
start.round
<-
cli
$
args
[
6
]
max.inter.t
<-
cli
$
options
$
max.inter.t
max.inter.t
<-
cli
$
options
$
max.inter.t
chunkn
<-
cli
$
options
$
chunkn
chunkn
<-
cli
$
options
$
chunkn
chunk.i
<-
cli
$
options
$
chunk.i
chunk.i
<-
cli
$
options
$
chunk.i
...
...
This diff is collapsed.
Click to expand it.
session.R
+
3
−
2
View file @
4798a781
...
@@ -6,11 +6,12 @@ myfunction <- "get.corXY.bootstrap"
...
@@ -6,11 +6,12 @@ myfunction <- "get.corXY.bootstrap"
max.inter.t
<-
3
max.inter.t
<-
3
chunk.i
<-
NA
chunk.i
<-
NA
nperm
<-
20
nperm
<-
20
ncores
<-
1
0
ncores
<-
1
chunkn
<-
3
*
ncores
chunkn
<-
3
*
ncores
combinations
<-
"sequential"
combinations
<-
"sequential"
start.round
<-
4
source
(
"01b_MesobromionCluster.R"
)
source
(
"01b_MesobromionCluster.R"
)
#Mesobromion(species.path, traits.path, output, myfunction, max.inter.t, chunkn, chunk.i, nperm)
#Mesobromion(species.path, traits.path, output, myfunction, max.inter.t, chunkn, chunk.i, nperm)
Mesobromion
(
species.path
,
traits.path
,
output
,
myfunction
,
combinations
,
max.inter.t
,
Mesobromion
(
species.path
,
traits.path
,
output
,
myfunction
,
combinations
,
start.round
,
max.inter.t
,
chunkn
,
chunk.i
,
nperm
,
ncores
)
chunkn
,
chunk.i
,
nperm
,
ncores
)
This diff is collapsed.
Click to expand it.
submit_01b.sh
+
2
−
1
View file @
4798a781
...
@@ -29,4 +29,5 @@ Rscript \
...
@@ -29,4 +29,5 @@ Rscript \
/data/splot/HIDDEN/traits.out.10perc.txt
\
/data/splot/HIDDEN/traits.out.10perc.txt
\
"
$output
"
\
"
$output
"
\
"get.corXY.bootstrap"
\
"get.corXY.bootstrap"
\
"sequential"
"sequential"
\
4
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment