Skip to content

get.consensus.from.alignment.parallel.sh

Simon Crameri edited this page Apr 3, 2022 · 3 revisions

Description

Generate a FASTA file with a consensus sequence representing an alignment, for a batch of alignments in parallel.

Usage

get.consensus.from.alignment.parallel.sh -s <file> -d <directory> \
                                         -m <positive integer> -b <positive numeric> \
                                         -a <string> -z <string> -o <directory> \
                                         -w -h -t <positive integer> -gnv <flags>

Dependencies

get.consensus.from.alignment.R

# R packages
ape

Arguments

# Required
-s                  File with names of samples considered during consensus calculation (without header or '>').
-d                  Path to directory with alignments.

# Optional
-m   [0.05]         Minimum allele frequency to call a IUPAC ambiguity.
                    Interpreted as 'minimum allele count' if >1.
-b    [0.5]         Minimum base frequency to return a consensus (major allele or IUPAC ambiguity)
                    instead of a gap. Interpreted as 'minimum base count' if >1.
-g  [false]         FLAG, if turned on, then '-' characters will be ignored during consensus calculation.
-n  [false]         FLAG, if turned on, then 'N' characters will be ignored during consensus calculation.
-a  [false]         Prefix in consensus sequence name. If no prefix is desired, use 'FALSE' instead of ''.
-z  [false]         Suffix in consensus sequence name. If no suffix is desired, use 'FALSE' instead of ''.
-o  [see details]   Name of output directory.
-v  [false]         FLAG, if turned on, the alignment consensus will be visualized as a PDF
                    (recommended for few alignments only).
-w     [15]         Width of output PDF file.
-h      [7]         Height of output PDF file.
-t      [4]         Number of parallel threads.

Details

By default, the output directory is set to <input directory>.cons-${m}-${b} (-o option)

Value

Output directory containing a file for every alignment, with the consensus sequence.

Examples

# Consensus with IUPAC ambiguity codes (m = 0.2), gaps, Ns, but no visualization
get.consensus.from.alignment.parallel.sh -s samples.txt -d mafft.63.2396.c0.5.d0.25 -m 0.2 -b 0.01 -t 20

# Consensus of the major alleles (m = 1), no gaps, no Ns, but with visualization
get.consensus.from.alignment.parallel.sh -s samples.txt -d mafft.63.2396.c0.5.d0.25 -m 1 -b 0.01 -t 20 -gnv

Clone this wiki locally