Search…
ANI Calculation
The quickest way to calculate ANI is with FastANI. It is available as a module. To load:
1
module use /mod/scgc
2
module load fastani
Copied!
FastANI instructions:
1
$ fastANI --help
2
-----------------
3
fastANI is a fast alignment-free implementation for computing whole-genome
4
Average Nucleotide Identity (ANI) between genomes
5
-----------------
6
Example usage:
7
$ fastANI -q genome1.fa -r genome2.fa -o output.txt
8
$ fastANI -q genome1.fa --rl genome_list.txt -o output.txt
9
10
Available options
11
-----------------
12
-h, --help
13
Print this help page
14
15
-r <value>, --ref <value>
16
reference genome (fasta/fastq)[.gz]
17
18
--refList <value>, --rl <value>
19
a file containing list of reference genome files, one genome per line
20
21
-q <value>, --query <value>
22
query genome (fasta/fastq)[.gz]
23
24
--ql <value>, --queryList <value>
25
a file containing list of query genome files, one genome per line
26
27
-k <value>, --kmer <value>
28
kmer size <= 16 [default : 16]
29
30
-t <value>, --threads <value>
31
thread count for parallel execution [default : 1]
32
33
--fragLen <value>
34
fragment length [default : 3,000]
35
36
--minFrag <value>
37
minimum matched fragments for trusting ANI [default : 50]
38
39
--visualize
40
output mappings for visualization, can be enabled for single genome to
41
single genome comparison only [disabled by default]
42
43
--matrix
44
also output ANI values as lower triangular matrix (format inspired from
45
phylip). If enabled, you should expect an output file with .matrix
46
extension [disabled by default]
47
48
-o <value>, --output <value> [required]
49
output file name
Copied!
Another way to calculate ANI is by using pyani, which is a BLAST-based method. pyani is installed within SCGC's anaconda3 module, and can be run on c1 and c2.
To run pyani:
  1. 1.
    place all fasta files that you'd like to compare into a directory
  2. 2.
    Load SCGC's anaconda3 module
1
module use /mod/scgc
2
3
module load anaconda3
4
module load blast
Copied!
  1. 1.
    Run pyani:
1
average_nucleotide_identity.py -o {outfile} -i {contig_directory} -m {choose_method, we use ANIb} --workers {threads}
Copied!
Example PBS script:
1
#!/bin/bash
2
3
## set name of PBS job
4
#PBS -N pyani
5
6
## set the queue
7
#PBS -q scgc-route
8
#PBS -l walltime=96:00:00
9
#PBS -l mem=10G
10
11
#PBS -l ncpus=30
12
13
#PBS -j oe
14
#PBS -o /home/julia/out/180724_pyani.out
15
16
17
module unload anaconda
18
module load anaconda3
19
20
indir=/mnt/scgc/simon/simonsproject/contigs/
21
outdir = /mnt/scgc/simon/simonsproject/ani_out/
22
23
mkdir $outdir
24
25
average_nucleotide_identity.py -o ${outdir} \
26
-i ${indir} -m ANIb --workers 30
Copied!
Last modified 2yr ago
Export as PDF
Copy link