-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsequential.sh.jj2
57 lines (56 loc) · 2.02 KB
/
sequential.sh.jj2
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
{% if node_type %}
#SBATCH --job-name="{{job_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...'
{% for name, left, right in reads %}
flash {{files_directory}}{{left}} {{files_directory}}{{right}} -o {{name}}
{% endfor %}
echo 'DONE!'
### ORF filtering ###
echo 'ORFs filtering...'
{% for name, left, right in reads %}
agmfi.py {{files_directory}}{{name}}.extendedFrags.fastq --output {{files_directory}}{{name}}.extendedFrags.fasta
{% endfor %}
echo 'DONE!'
{% if concat_reference %}
### Concatenating with the reference ###
{% for name, left, right in reads %}
cat {{files_directory}}{{name}}.extendedFrags.fasta {{concat_reference}} > {{files_directory}}{{name}}.extendedFrags.concat.fasta
{% endfor %}
{% endif %}
### MAFFT alignment ###
echo 'Aligning...'
{% for name, left, right in reads %}
mafft --thread {{processors}} {{files_directory}}{{name}}.extendedFrags.{% if concat_reference %}concat.{% endif %}fasta > {{files_directory}}{{name}}.mafft
{% endfor %}
### Tree growing ###
echo 'Building tree...'
{% for name, left, right in reads %}
{{ml_software}} -s {{files_directory}}{{name}}.mafft -nt {{processors}}
{% endfor %}
{% if map_reference %}
echo 'Replacing reads names with dots'
{% for name, left, right in reads %}
agmfi.py {{files_directory}}{{name}}.mafft.treefile --output {{files_directory}}{{name}}.mafft.dot.treefile --dotize-only
{% endfor %}
echo 'Mapping tree on the reference'
{% for name, left, right in reads %}
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
{% endfor %}
{% endif %}
echo 'DONE!'
{% if notify_email %}
echo 'Sending notification...'
headnode_notifier.py {{notify_email}} --subject '{{job_name}} has finished'
{% endif %}