-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsubscript.sh.jj2
More file actions
43 lines (42 loc) · 1.66 KB
/
subscript.sh.jj2
File metadata and controls
43 lines (42 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
{% if node_type %}
#SBATCH --job-name="{{name}}"
{% if node_type == "N" %}
#SBATCH --partition=long
{% else %}
#SBATCH --partition=accel
{% endif %}
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --cpus-per-task={{processors}}
#SBATCH --exclude=gpu[1-8]
{% endif %}
### FLASH reads assembly ###
echo 'Assembling...'
flash {{files_directory}}{{left}} {{files_directory}}{{right}} -o {{name}}
echo 'DONE!'
### ORF filtering ###
echo 'ORFs filtering...'
agmfi.py {{files_directory}}{{name}}.extendedFrags.fastq --output {{files_directory}}{{name}}.extendedFrags.fasta
echo 'DONE!'
{% if concat_reference %}
### Concatenating with the reference ###
cat {{files_directory}}{{name}}.extendedFrags.fasta {{concat_reference}} > {{files_directory}}{{name}}.extendedFrags.concat.fasta
{% endif %}
### MAFFT alignment ###
echo 'Aligning...'
mafft --thread {{processors}} {{files_directory}}{{name}}.extendedFrags.{% if concat_reference %}concat.{% endif %}fasta > {{files_directory}}{{name}}.mafft
### Tree growing ###
echo 'Building tree...'
{{ml_software}} -s {{files_directory}}{{name}}.mafft -nt {{processors}}
{% if map_reference %}
echo 'Replacing reads names with dots'
agmfi.py {{files_directory}}{{name}}.mafft.treefile --output {{files_directory}}{{name}}.mafft.dot.treefile --dotize-only
echo 'Mapping tree on the reference'
mgremap -S {{map_reference}} -G {{files_directory}}{{name}}.mafft.dot.treefile -o {{files_directory}}{{name}}.mgremap -C {{files_directory}}{{name}}.csv -z {{files_directory}}{{name}}.dot
{% endif %}
echo 'DONE!'
{% if notify_email %}
echo 'Sending notification...'
headnode_notifier.py {{notify_email}} --subject '{{name}} has finished'
{% endif %}