I just went through figuring this out and I thought I would add my process, including the FASTA component, using Vibrio phage VP882 as my example and utilizing the gff strategy you mentioned in a comment to the other answer. Here is everything I did using an established snpEff installation. It worked when I ran my analysis using it, so this strategy is confirmed in my case:
#How to create a snpEff database using a gff3 and genomic DNA fasta file... (note, the chromosome names must match in the 2 files)
#NOTE: This uses /bin/tcsh...
setenv DBNAME Vibrio_phage_VP882
setenv GFF3 ~/Downloads/VibriophageVP882.gff3
setenv FASTA ~/Downloads/VibriophageVP882.fasta
#Go into the snpEff directory and create a directory for your files
cd /usr/local/snpEff
mkdir data/$DBNAME
#Copy the files into snpEff's directory structure
cp $GFF3 data/$DBNAME/genes.gff
cp $FASTA data/$DBNAME/sequences.fa
#Edit snpEff.config and insert your specific database information:
echo "$DBNAME.genome : $DBNAME" >> snpEff.config
#Build the database
java -jar snpEff.jar build -gff3 -v $DBNAME
I did not have any errors or warnings, so if you see anything untoward, you'll have to figure those things out.
You can set the 3 variable values at the top of this script and run the rest without changing it (unless your snpEff installation is in a different place.
And just for completeness, I downloaded the gff3 and fasta files directly from this page:
https://www.ncbi.nlm.nih.gov/nuccore/NC_009016
Using the complete record/file download option at the top right of the record, selecting gff and fasta in 2 separate downloads.
Rob
Thank you so much! The documentation for SNPeff is rather poor, and this was the first source I (finally) found that worked! Great, thanks!
I try to run the same commands but when I try to annotate my vcf snpEff tries to upload the database from sourceforge and ends up with an error. Should the build option create some database related files at directories? Directories and their contents remain unchanged and this is weird.
The problem was following: the memory argument -Xmx4G should be added before running build command.
the folder
/usr/local/snpEff/data
does not exist, you need to create it.