Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@meren
Created April 13, 2017 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meren/a1c7b3cd7f0e54af47131a6732f19d87 to your computer and use it in GitHub Desktop.
Save meren/a1c7b3cd7f0e54af47131a6732f19d87 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
if [ "$#" -ne 1 ]; then
echo "You need to give a project name as an argument to this script (and it better be a single, short and descriptive word without funny characters). For instance, CMX_PAN_v5 would be a good one."
exit -1
fi
PROJECT=$1
######################################################################
# This script iteratively takes all fastas in a folder that conform #
# to anvio's rules for fasta headers which file extensions are '*.fa'#
# and generates the TSV file for pangenome analysis #
######################################################################
echo "name contigs_db_path" > external-genomes.txt
for genome in $(ls *.fa)
do
echo "Anvi-FASTA-to-contigs-db running on ${genome%.*}..."
anvi-script-FASTA-to-contigs-db $genome
echo "Starting COG annotation with blastp..."
anvi-run-ncbi-cogs -c ${genome%.*}.db -T 20
echo "${genome%.*} $(pwd)/${genome%.*}.db" >> external-genomes.txt
done
###########Genome Storage file creation######
anvi-gen-genomes-storage -e external-genomes.txt -o $PROJECT-GENOMES.h5
######Now run pan genome analysis with NCBI blast#######################
anvi-pan-genome -g $PROJECT-GENOMES.h5 --use-ncbi-blast -J $PROJECT -o $PROJECT -T 20 --min-occurrence 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment