References: Virus - AndreaRP/METAGENOMICS GitHub Wiki

Virus

Create a directory named VIRUS_GENOME_REFERENCES/ and go inside it.

[Whole Genome] (ftp://ftp.ncbi.nlm.nih.gov/genomes/refseq/viral/)

  1. Create a directory VIRUS_GENOME_REFERENCES/WG/ and go inside it.

  2. Download the assembly summary file, with a list of all the virus sequences included.

    curl 'ftp://ftp.ncbi.nlm.nih.gov/genomes/refseq/viral/assembly_summary.txt' > assembly_summary_virus.txt

  3. Get a list of complete and latest sequences.

    awk -F "\t" '$12=="Complete Genome" && $11=="latest"{print $1,$20}' assembly_summary_virus.txt > ftpdirpaths_complete_latest.txt

  4. 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_virus_complete_latest.sh (create download script)

    bash wget_all_virus_complete_latest.sh (execute 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.

  5. Create the multifasta file with the genomic data.

    find VIRUS_GENOME_REFERENCE/WG/all_genomes/ ! -name '*from_genomic.fna.gz' -name '*_genomic.fna.gz' -exec zcat {} \; > VIRUS_GENOME_REFERENCE/WG/virus_genome_all.fna

  6. Create multifasta file with proteomic data.

    find VIRUS_GENOME_REFERENCE/WG/all_genomes/ -name '*_protein.faa.gz' -exec zcat {} \; > VIRUS_GENOME_REFERENCE/WG/virus_protein_all.faa

  7. Get length of each sequence

    samtools faidx VIRUS_GENOME_REFERENCE/WG/virus_genome_all.fna (generates index: virus_genome_all.fna.fai)

    cut -f1-2 VIRUS_GENOME_REFERENCE/WG/virus_genome_all.fna.fai > VIRUS_GENOME_REFERENCE/WG/genome_length.txt

  8. Create Bowtie2 genome index

`bowtie2-build REFERENCES/VIRUS_GENOME_REFERENCE/WG/virus_genome_all.fna REFERENCES/VIRUS_GENOME_REFERENCE/WG/bwt2/virus_all`
  1. Create BLAST files - BLASTn
`makeblastdb -in REFERENCES/VIRUS_GENOME_REFERENCE/WG/virus_genome_all.fna -parse_seqids -dbtype nucl -out /REFERENCES/VIRUS_GENOME_REFERENCE/BLAST/blastn/VIRUS_blastn`

- BLASTx

`makeblastdb -in /REFERENCES/VIRUS_GENOME_REFERENCE/WG/virus_protein_all.faa -parse_seqids -dbtype prot -out VIRUS_blastx`