Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
seq-analysis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HPC - JGU - Life Sciences
seq-analysis
Commits
ed3b2c3e
Commit
ed3b2c3e
authored
Mar 06, 2019
by
Christian Meesters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first modularization: splitter script now outsourced and addressed by variable
parent
e24c6be6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
44 deletions
+1
-44
blast/parallel_BLAST/parallel_BLAST
blast/parallel_BLAST/parallel_BLAST
+1
-44
blast/parallel_BLAST/splitter.py
blast/parallel_BLAST/splitter.py
+0
-0
No files found.
blast/parallel_BLAST/parallel_BLAST
View file @
ed3b2c3e
...
...
@@ -532,49 +532,6 @@ if [[ ! $SCRIPT == /* ]]; then
SCRIPT
=
"
$PWD
/
$SCRIPT
"
;
fi
### check if this script is on node by checking env-variable $LSB_JOBID, else send it to LSF with given parameters and exit
SPLITUPSCRIPT
=
$(
cat
<<
'
EOF
'
# dummy line to introduce a line break
import pip
# will take little time, if dependency is already satisfied
pip.main(['install', 'biopython'])
from Bio import SeqIO
import sys
import os
fasta_file = sys.argv[1]
# number of sequences per scratch output file
nlines = int(sys.argv[2])
print('Going to split: >%s<' % fasta_file)
print('Going to split in %s lines per output file.' % nlines)
record_iter = SeqIO.parse(open(fasta_file),'fasta')
group = 0
batch = list()
for pos, entry in enumerate(record_iter):
if pos == 0:
group += 1
filename = 'group_%s.fasta' % group
handle = open(os.path.join('scratch', filename), 'w')
if (pos % nlines == 0 and pos != 0):
count = SeqIO.write(batch, handle, 'fasta')
#print('Wrote %s records to %s' % (count, filename))
handle.close()
batch = list()
group += 1
filename = 'group_%s.fasta' % group
handle = open(os.path.join('scratch', filename), 'w')
batch.append(entry)
# take care of the rest
count = SeqIO.write(batch, handle, 'fasta')
print('Wrote %s records to %s' % (count, filename))
handle.close()
EOF
)
### check if this script is on node by checking env-variable $SLURM_JOB_ID, else send it to SLURM with given parameters and exit
if
[
-z
"
$SLURM_JOB_ID
"
]
;
then
submit_call
=
"sbatch --no-requeue -o
${
JOBTAG
}
_%j.out -J
$JOBTAG
-p
$_arg_queue
-A
$_arg_assoc
-t
$_arg_runlimit
-N
$_arg_nodes
-n
$((
64
*
$_arg_nodes
/
$_arg_blast_threads
))
--mem=
$_arg_mem
--ramdisk=
${
_arg_ramdisk
}
-c
$_arg_blast_threads
--reservation=
$_arg_reservation
$SCRIPT
--partition
$_arg_queue
--account
$_arg_assoc
--nodes
$_arg_nodes
--time
$_arg_runlimit
--reservation=
$_arg_reservation
--threads
$_arg_blast_threads
--splitup
$_arg_splitup_per_queryfile
--blastparams=
\"
$BLASTPARAMS
\"
--executable=
$_arg_executable
$FASTA
$DATABASE
"
...
...
@@ -636,7 +593,7 @@ if [ ! -d "$WORKDIR/$SPLITFILEDIR" ]; then
mkdir
-p
"
$WORKDIR
/output"
||
exit
1
;
cd
"
$WORKDIR
"
echo
"executing scratch generator on
$FASTA
(
$_arg_splitup_per_queryfile
entries per file)"
eval
"
python -c
\"
$SPLITUPSCRIPT
\"
$FASTA
$_arg_splitup_per_queryfile
"
&
# splitup queryfile
eval
"
${
SCRIPT_PATH
}
/splitter.py
$FASTA
$_arg_splitup_per_queryfile
"
&
# splitup queryfile
PID
=
$!
queue
$PID
fi
...
...
blast/parallel_BLAST/splitter.py
100644 → 100755
View file @
ed3b2c3e
File mode changed from 100644 to 100755
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