Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
metaclade2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Riccardo Vicedomini
metaclade2
Commits
cf450ee5
Commit
cf450ee5
authored
May 09, 2020
by
Riccardo Vicedomini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
given the possibility to remove temporary files and specify output file
parent
d3d1fb93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
metaclade2
metaclade2
+25
-9
No files found.
metaclade2
View file @
cf450ee5
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
trap
ctrl_c INT TERM ERR
;
function
ctrl_c
()
{
exit
5
;
}
trap
ctrl_c INT TERM ERR
;
function
ctrl_c
()
{
exit
5
;
}
trap
'kill 0'
EXIT
trap
'kill 0'
EXIT
CMD_DIR
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
CMD_DIR
=
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
CMD_NAME
=
$(
basename
"
${
BASH_SOURCE
[0]
}
"
)
CMD_NAME
=
$(
basename
"
${
BASH_SOURCE
[0]
}
"
)
SCRIPTS_DIR
=
"
${
CMD_DIR
}
"
/scripts
SCRIPTS_DIR
=
"
${
CMD_DIR
}
"
/scripts
...
@@ -34,6 +33,8 @@ DAMA_OLPMAXDOM=50
...
@@ -34,6 +33,8 @@ DAMA_OLPMAXDOM=50
MCLADE_USEDAMA
=
false
MCLADE_USEDAMA
=
false
MCLADE_USESGE
=
false
MCLADE_USESGE
=
false
MCLADE_WORKDIR
=
${
PWD
}
MCLADE_WORKDIR
=
${
PWD
}
MCLADE_OUTFILE
=
""
MCLADE_RMTMP
=
false
NTHREADS
=
1
NTHREADS
=
1
NJOBS
=
16
NJOBS
=
16
...
@@ -41,11 +42,13 @@ function print_usage() {
...
@@ -41,11 +42,13 @@ function print_usage() {
echo
-en
"
\n
USAGE:
${
CMD_NAME
}
-i <input_fasta> -N <name> [options]
\n
"
echo
-en
"
\n
USAGE:
${
CMD_NAME
}
-i <input_fasta> -N <name> [options]
\n
"
echo
-en
"
\n
"
echo
-en
"
\n
"
echo
-en
" MANDATORY OPTIONS:
\n
echo
-en
" MANDATORY OPTIONS:
\n
-N, --name <str>
\t
Dataset/job name and name of the directory used to
\t
store intermediate results
\n
-i, --input <path>
\t
Input file of AA sequences in FASTA format
\n
-i, --input <path>
\t
Input file of AA sequences in FASTA format
\n
-N, --name <str>
\t
Dataset/job name
\n
"
| column
-t
-s
$'
\t
'
"
| column
-t
-s
$'
\t
'
echo
-en
"
\n
"
echo
-en
"
\n
"
echo
-en
" MetaCLADE OPTIONS:
\n
echo
-en
" MetaCLADE2 OPTIONS:
\n
-o, --output <path>
\t
Output file of domain architecture
\n
-a, --arch
\t
Use DAMA to properly compute domain architectures
\n
-a, --arch
\t
Use DAMA to properly compute domain architectures
\n
\t
(useful only for long protein sequences)
\n
\t
(useful only for long protein sequences)
\n
-d, --domain-list <str>
\t
Comma-spearated list of Pfam accession numbers of
\n
-d, --domain-list <str>
\t
Comma-spearated list of Pfam accession numbers of
\n
...
@@ -53,7 +56,8 @@ function print_usage() {
...
@@ -53,7 +56,8 @@ function print_usage() {
\t
(e.g.,
\"
PF00875,PF03441
\"
)
\n
\t
(e.g.,
\"
PF00875,PF03441
\"
)
\n
-D, --domain-file <path>
\t
File that contains the Pfam accession numbers
\n
-D, --domain-file <path>
\t
File that contains the Pfam accession numbers
\n
\t
of the domains to be considered (one per line)
\n
\t
of the domains to be considered (one per line)
\n
-W, --work-dir <path>
\t
Working directory, where jobs and results are saved
\n
-W, --work-dir <path>
\t
Working directory (default:current directory)
\n
--remove-temp
\t
Remove temporary intermediate files, keeping only results and logs
\n
"
| column
-t
-s
$'
\t
'
"
| column
-t
-s
$'
\t
'
echo
-en
"
\n
"
echo
-en
"
\n
"
echo
-en
" DAMA OPTIONS:
\n
echo
-en
" DAMA OPTIONS:
\n
...
@@ -85,8 +89,8 @@ function print_usage() {
...
@@ -85,8 +89,8 @@ function print_usage() {
# retrieve provided arguments
# retrieve provided arguments
opts
=
"
i:N
:ad:D:e:E:W:t:j:hV"
opts
=
"
N:i:o
:ad:D:e:E:W:t:j:hV"
longopts
=
"
input:,name:,arch,domain-list:,domain-file:,evalue-cutoff:,evalue-cutconf:,overlappingAA:,overlappingMaxDomain:,work-dir
,threads:,jobs:,help,version,sge,pe:,queue:,time-limit:"
longopts
=
"
name:,input:,output:,arch,domain-list:,domain-file:,evalue-cutoff:,evalue-cutconf:,overlappingAA:,overlappingMaxDomain:,work-dir,remove-temp
,threads:,jobs:,help,version,sge,pe:,queue:,time-limit:"
ARGS
=
$(
getopt
-o
"
${
opts
}
"
-l
"
${
longopts
}
"
-n
"
${
CMD_NAME
}
"
--
"
${
@
}
"
)
ARGS
=
$(
getopt
-o
"
${
opts
}
"
-l
"
${
longopts
}
"
-n
"
${
CMD_NAME
}
"
--
"
${
@
}
"
)
if
[
$?
-ne
0
]
||
[
$#
-eq
0
]
;
then
# do not change the order of this test!
if
[
$?
-ne
0
]
||
[
$#
-eq
0
]
;
then
# do not change the order of this test!
print_usage
print_usage
...
@@ -96,13 +100,17 @@ eval set -- "${ARGS}"
...
@@ -96,13 +100,17 @@ eval set -- "${ARGS}"
while
[
-n
"
${
1
}
"
]
;
do
while
[
-n
"
${
1
}
"
]
;
do
case
${
1
}
in
case
${
1
}
in
-N
|
--name
)
shift
MCLADE_JOBNAME
=
${
1
}
;;
-i
|
--input
)
-i
|
--input
)
shift
shift
INPUT_FASTA
=
${
1
}
INPUT_FASTA
=
${
1
}
;;
;;
-
N
|
--name
)
-
o
|
--output
)
shift
shift
MCLADE_
JOBNAM
E
=
${
1
}
MCLADE_
OUTFIL
E
=
${
1
}
;;
;;
-a
|
--arch
)
-a
|
--arch
)
MCLADE_USEDAMA
=
true
MCLADE_USEDAMA
=
true
...
@@ -135,6 +143,9 @@ while [ -n "${1}" ]; do
...
@@ -135,6 +143,9 @@ while [ -n "${1}" ]; do
shift
shift
MCLADE_WORKDIR
=
${
1
}
MCLADE_WORKDIR
=
${
1
}
;;
;;
--remove-temp
)
MCLADE_RMTMP
=
true
;;
-t
|
--threads
)
-t
|
--threads
)
shift
shift
NTHREADS
=
${
1
}
NTHREADS
=
${
1
}
...
@@ -249,12 +260,15 @@ if [ $? -ne 0 ]; then
...
@@ -249,12 +260,15 @@ if [ $? -ne 0 ]; then
fi
fi
print_status
"MetaCLADE working directory:
${
MCLADE_WORKDIR
}
"
print_status
"MetaCLADE working directory:
${
MCLADE_WORKDIR
}
"
if
[
-z
"
${
MCLADE_OUTFILE
}
"
]
;
then
MCLADE_OUTFILE
=
"
${
MCLADE_WORKDIR
}
"
/
"
${
MCLADE_JOBNAME
}
"
.arch.txt
;
fi
print_status
"output will be saved to:
${
MCLADE_OUTFILE
}
"
# Create MetaCLADE scripts
# Create MetaCLADE scripts
print_status
"creating MetaCLADE script/job files"
print_status
"creating MetaCLADE script/job files"
python3
"
${
SCRIPTS_DIR
}
/mclade_create_jobs.py"
\
python3
"
${
SCRIPTS_DIR
}
/mclade_create_jobs.py"
\
-i
"
${
INPUT_FASTA
}
"
-N
"
${
MCLADE_JOBNAME
}
"
${
MCLADE_DOMARG
}
-W
"
${
MCLADE_WORKDIR
}
"
\
-i
"
${
INPUT_FASTA
}
"
-N
"
${
MCLADE_JOBNAME
}
"
${
MCLADE_DOMARG
}
-W
"
${
MCLADE_WORKDIR
}
"
\
-e
"
${
MCLADE_EVALUECUTOFF
}
"
-E
"
${
MCLADE_EVALUECUTCONF
}
"
--overlappingAA
${
DAMA_OLPAA
}
--overlappingMaxDomain
${
DAMA_OLPMAXDOM
}
${
MCLADE_DAMAARG
}
\
-e
"
${
MCLADE_EVALUECUTOFF
}
"
-E
"
${
MCLADE_EVALUECUTCONF
}
"
--overlappingAA
${
DAMA_OLPAA
}
--overlappingMaxDomain
${
DAMA_OLPMAXDOM
}
${
MCLADE_DAMAARG
}
\
-j
"
${
NJOBS
}
"
-j
"
${
NJOBS
}
"
>
"
${
MCLADE_WORKDIR
}
/log/mclade_create_jobs.out"
2>
"
${
MCLADE_WORKDIR
}
/log/mclade_create_jobs.err"
# Run MetaCLADE scripts (possibly using SGE)
# Run MetaCLADE scripts (possibly using SGE)
...
@@ -328,6 +342,8 @@ else
...
@@ -328,6 +342,8 @@ else
${
PEXEC_CMD
}
${
f
}
2>
"
${
MCLADE_WORKDIR
}
/log/arch.out"
>
"
${
MCLADE_WORKDIR
}
/log/arch.err"
${
PEXEC_CMD
}
${
f
}
2>
"
${
MCLADE_WORKDIR
}
/log/arch.out"
>
"
${
MCLADE_WORKDIR
}
/log/arch.err"
cmdret
=
$?
;
if
((
cmdret
!=
0
))
;
then
print_error
"architecture job failed (exit status:
${
cmdret
}
)"
;
exit
1
;
fi
cmdret
=
$?
;
if
((
cmdret
!=
0
))
;
then
print_error
"architecture job failed (exit status:
${
cmdret
}
)"
;
exit
1
;
fi
fi
fi
cp
"
${
MCLADE_WORKDIR
}
/results/3_arch/
${
MCLADE_JOBNAME
}
.arch.txt"
"
${
MCLADE_OUTFILE
}
"
print_status
"architecture job finished successfully"
print_status
"architecture job finished successfully"
if
[
"
${
MCLADE_RMTMP
}
"
=
true
]
;
then
print_status
"removing temporary files"
;
rm
-r
"
${
MCLADE_WORKDIR
}
"
/
{
results,jobs,temp
}
;
fi
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