-
Notifications
You must be signed in to change notification settings - Fork 41
Tips and tricks
Several users have asked questions about running AMRFinderPlus and/or modifying the output in various ways. AMRFinderPlus hews to UNIX traditions for command-line programs so there are many ways to modify the way it is run. Most of these assume standard UNIX utilities and the bash shell.
When running AMRFinderPlus on many assemblies it is often useful to combine the output from many runs into one file with an additional column for an assembly identifier. There are a few ways to do this outlined in issue 25.
The following assumes the files you want to combine are named *.amrfinder
. It will create a file named combined.tsv that contains all of the AMRFinderPlus files combined.
h=$(head -1 $(ls *.amrfinder | head -1))
echo $'filename\t' "$h" > combined.tsv
grep -v '^Protein identifier' *.amrfinder | sed 's/:/\t/' >> combined.tsv
This assumes that you're using a consistent filename format with .assembly.fa as the extension on your assembly nucleotide FASTA files, and that you want to run AMRFinderPlus serially (one job after the other). See issue 32 for another example.
for assembly in *.assembly.fa
do
base=$(basename $assembly .assembly.fa)
amrfinder -n $assembly --threads 8 --plus > $base.amrfinder
done
Sometimes you want to collate the above output into a single file, prefixing each line by the filename. Here's one way to do that. This assumes that you want to combine all the AMRFinderPlus output files named with a .amrfinder extension (Inspired by Issue 25)
header=$( head -1 $( ls *.amrfinder | head -1 ) )
echo $'filename\t' "$header" > together.amrfinder.tab
grep '' *.amrfinder | grep -v 'Protein identifier\tContig id' \
| sed 's/:/\t/' >> together.amrfinder.tab
- New in AMRFinderPlus
- Documentation for AMRFinder v1 (Depricated)
- Overview
- Install with bioconda (recommended)
- Docker Image
- Install with binary
- Compile from source
- Test your installation
- Usage (syntax/options)
- --organism option
- Examples
- Input file formats
- Output format
- Common errors
- Known issues
- Tips and tricks
- Database updates
- Software upgrades
- Genotypes vs. Phenotypes
- Scope: plus vs. core
- AMRFinderPlus "Method" column
- Element type and Subtype
- Class and Subclass