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
0ab756c6
Commit
0ab756c6
authored
5 years ago
by
Francesco Sabatini
Browse files
Options
Downloads
Patches
Plain Diff
cli and submit
parents
Branches
leftover
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cli_01b.r
+81
-0
81 additions, 0 deletions
cli_01b.r
submit_01b.sh
+32
-0
32 additions, 0 deletions
submit_01b.sh
with
113 additions
and
0 deletions
cli_01b.r
0 → 100644
+
81
−
0
View file @
0ab756c6
library
(
optparse
)
# ------------------------------------------------------------------------------
# defaults
# ------------------------------------------------------------------------------
default.max.inter.t
<-
1
default.nperm
<-
99
# ------------------------------------------------------------------------------
# parsing arguments
# ------------------------------------------------------------------------------
options
<-
list
(
make_option
(
opt_str
=
c
(
"-m"
,
"--max.inter.t"
),
dest
=
"max.inter.t"
,
type
=
"integer"
,
default
=
default.max.inter.t
,
help
=
"Max number of interactions for traits"
,
metavar
=
"4"
),
make_option
(
opt_str
=
c
(
"-n"
,
"--chunkn"
),
dest
=
"chunkn"
,
type
=
"integer"
,
default
=
1
,
help
=
"How many chunks?"
,
metavar
=
"4"
),
make_option
(
opt_str
=
c
(
"-i"
,
"--chunk.i"
),
dest
=
"chunk.i"
,
type
=
"integer"
,
default
=
NA
,
help
=
"Which chunk?"
,
metavar
=
"4"
),
make_option
(
opt_str
=
c
(
"-p"
,
"--nperm"
),
dest
=
"nperm"
,
type
=
"integer"
,
default
=
default.nperm
,
help
=
"How many permutations?"
,
metavar
=
"4"
)
)
parser
<-
OptionParser
(
usage
=
"Rscript %prog [options] data dt_beals header output"
,
option_list
=
options
,
description
=
"\nan awesome R script"
,
epilogue
=
"use with caution, the awesomeness might slap you in the face!"
)
cli
<-
parse_args
(
parser
,
positional_arguments
=
4
)
# ------------------------------------------------------------------------------
# assign a few shortcuts
# ------------------------------------------------------------------------------
species.path
<-
cli
$
args
[
1
]
traits.path
<-
cli
$
args
[
2
]
output
<-
cli
$
args
[
3
]
myfunction
<-
cli
$
args
[
4
]
max.inter.t
<-
cli
$
options
$
max.inter.t
chunkn
<-
cli
$
options
$
chunkn
chunk.i
<-
cli
$
options
$
chunk.i
nperm
<-
cli
$
options
$
nperm
# ------------------------------------------------------------------------------
# actual program
# ------------------------------------------------------------------------------
source
(
"01b_MesobromionCluster.R"
)
Mesobromion
(
species.path
,
traits.path
,
output
,
myfunction
,
max.inter.t
,
chunkn
,
chunk.i
,
nperm
)
This diff is collapsed.
Click to expand it.
submit_01b.sh
0 → 100644
+
32
−
0
View file @
0ab756c6
#!/bin/bash
#$ -S /bin/bash
#$ -N HIDDEN
#$ -o /work/$USER/$JOB_NAME-$JOB_ID-$TASK_ID.log
#$ -j y
#$ -l h_rt=00:30:00:00
#$ -l h_vmem=1G
#$ -pe smp 1-1
#$ -cwd
#$ -t 1-1
module load R
output
=
/data/splot/HIDDEN/output/HIDDEN
Rscript
\
cli_01b.r
\
--max
.inter.t 2
\
--chunk
.i
$SGE_TASK_ID
\
--chunkn
399
\
--nperm
99
\
/data/splot/HIDDEN/species.out.10perc.txt
\
/data/splot/HIDDEN/traits.out.10perc.txt
\
"
$output
"
\
"get.corXY"
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