References: Invertebrate - AndreaRP/METAGENOMICS GitHub Wiki
Invertebrate
Create a directory named INVERTEBRATE_GENOME_REFERENCES/ and go inside it.
[Whole Genome] (ftp://ftp.ncbi.nlm.nih.gov/genomes/refseq/invertebrate/)
-
Create a directory INVERTEBRATE_GENOME_REFERENCES/WG/ and go inside it.
-
Download the assembly summary file, with a list of all the virus sequences included.
curl 'ftp://ftp.ncbi.nlm.nih.gov/genomes/refseq/invertebrate/assembly_summary.txt' > assembly_summary_invertebrate.txt -
Get a list of complete and latest sequences.
awk -F "\t" '{print $1,$20}' assembly_summary_invertebrate.txt > ftpdirpaths_complete_latest.txt -
Download the fasta sequences.
cat ftpdirpaths_complete_latest.txt | while read line; do dir='echo $line | cut -d " " -f 1 ';mkdir -p $dir;url='echo $line | cut -d " " -f 2';echo "wget -P $dir $url/*" ; done >> wget_all_invertebrate.sh(creates download script)bash REFERENCES/INVERTEBRATE_GENOME_REFERENCE/WG/wget_all_invertebrate.sh(executes download script)WARNING! This step will create a folder per genome and download several files into it, including nucleotide and protein sequences. Before executing this command please make sure you have sufficient storage space. We advise you create a new directory and execute this command from inside it, that will keep your working space well organized. In this example we have created the folder all_genomes for the download.
-
Create the multifasta file with the genomic data.
find REFERENCES/PROTOZOO_GENOME_REFERENCE/WG/all_genomes ! -name '*from_genomic.fna.gz' -name '*_genomic.fna.gz' -exec zcat {} \; > WG/invertebrate_wg_all.fna -
Get length of each sequence
samtools faidx REFERENCES/INVERTEBRATE_GENOME_REFERENCE/WG/invertebrate_wg_all.fna(generates index: invertebrate_wg_all.fna.fai)cut -f1-2 REFERENCES/INVERTEBRATE_GENOME_REFERENCE/WG/invertebrate_wg_all.fna.fai > REFERENCES/INVERTEBRATE_GENOME_REFERENCE/WG/genome_length.txt -
Create Bowtie2 genome index
`bowtie2-build REFERENCES/INVERTEBRATE_GENOME_REFERENCE/WG/invertebrate_wg_all.fna REFERENCES/INVERTEBRATE_GENOME_REFERENCE/WG/bwt2/invertebrate_all`
- Create BLAST files - BLASTn
`makeblastdb -in REFERENCES/INVERTEBRATE_GENOME_REFERENCE/WG/invertebrate_wg_all.fna -parse_seqids -dbtype nucl -out REFERENCES/INVERTEBRATE_GENOME_REFERENCE/BLAST/blastn/INVERTEBRATE_blastn`