merenlab / anvio

An analysis and visualization platform for 'omics data
http://merenlab.org/software/anvio
GNU General Public License v3.0
423 stars 144 forks source link

anvi-populate-genes-table error #234

Closed bowmanjeffs closed 8 years ago

bowmanjeffs commented 8 years ago

Meren et al, I recently updated Anvio (v1.2.1) on Ubuntu and am re-running some old analysis. A funny error is popping up during anvi-populate-genes-table that I can't figure out. Call and error message(s) are:

anvi-populate-genes-table -c contigs.db -p myrast_cmdline_dont_use -i svr_assign_to_dna_using_figfams.txt

Traceback (most recent call last):
  File "/home/jeff/anaconda/bin/anvi-populate-genes-table", line 82, in <module>
    main(args)
  File "/home/jeff/anaconda/bin/anvi-populate-genes-table", line 54, in main
    tables_for_genes.create(genes_dict, args.parser)
  File "/home/jeff/anaconda/lib/python2.7/site-packages/anvio/dbops.py", line 1264, in create
    self.sanity_check()
  File "/home/jeff/anaconda/lib/python2.7/site-packages/anvio/dbops.py", line 1305, in sanity_check
    contig_names_in_db  = set(self.contigs_info.keys())
AttributeError: 'NoneType' object has no attribute 'keys'

Prior to running anvi-populate-genes-table I ran:

anvi-gen-annotation-database -f contigs.fasta -o contigs.db
svr_assign_to_dna_using_figfams < contigs.fasta > svr_assign_to_dna_using_figfams.txt

The test script does not reproduce this error.

Thanks! Jeff

meren commented 8 years ago

It seems to me your contigs database has not been generated properly, since self.contigs_info should never be NoneType. Can you please regenerate your contigs.db from scratch and send the entire commandline output?

Thanks.

bowmanjeffs commented 8 years ago

anvi-gen-annotation-database -f PAL_03040507assembly_1Kb_deflines.fasta -o pal_assembly.db produces:

Annotation database ..........................: A new database, pal_assembly.db, has been created.
Number of contigs ............................: 30,490
Number of splits .............................: 30,517
Total number of nucleotides ..................: 68,074,907
Split length .................................: 20,000

anvi-populate-genes-table produces the same error

meren commented 8 years ago

Understood. Would that be possible for you to make that PAL_03040507assembly_1Kb_deflines.fasta and svr_assign_to_dna_using_figfams.txt files available to me so I can reproduce the problem?

Thanks.

bowmanjeffs commented 8 years ago

Not a problem. Will email offline after I get them up.

meren commented 8 years ago

I have been looking at the files you sent. I just realized that you are generating "annotation databases", which is clear even from the output here.

I don't know how this is possible since we left annotation databases behind, and switched to contigs databases since v1.1.0:

https://github.com/meren/anvio/releases/tag/v1.1.0

I think you should uninstall anvi'o, and reinstall it from scratch to make sure you don't have files from previous installations around, because the anvi'o you are using is definitely not v1.2.1. Since v1.1.0, there is no program called anvi-gen-annotation-database, and it is replaced by anvi-gen-contigs-database.

When I run this command on your database this is what I see:

$ sqlite3 pal_assembly.db 'select value from self where key="db_type";'
annotation

When I create the database from scratch using anvi'o v1.2.1 and anvi-gen-contigs-database, this is what I see:

$ sqlite3 pal_assembly-NEW.db 'select value from self where key="db_type";'
conitgs

I hope this helps.

Best,