merenlab / anvio

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

Getting AssertionError in anvio-profile command #404

Closed ShriramHPatel closed 8 years ago

ShriramHPatel commented 8 years ago

Hello,

I am getting following Error on running anvio-profile command:

[E::bam_hdr_read] error reading BGZF stream Traceback (most recent call last): File "/usr/local/bin/anvi-profile", line 68, in <module> profiler._run() File "/usr/local/lib/python2.7/dist-packages/anvio/profiler.py", line 192, in _run self.profile() File "/usr/local/lib/python2.7/dist-packages/anvio/profiler.py", line 651, in profile contig.analyze_auxiliary(self.bam, self.progress) File "/usr/local/lib/python2.7/dist-packages/anvio/contigops.py", line 120, in analyze_auxiliary report_variability_full=self.report_variability_full) File "/usr/local/lib/python2.7/dist-packages/anvio/contigops.py", line 165, in __init__ self.run(bam) File "/usr/local/lib/python2.7/dist-packages/anvio/contigops.py", line 171, in run for pileupcolumn in bam.pileup(self.split.parent, self.split.start, self.split.end): File "pysam/calignmentfile.pyx", line 1105, in pysam.calignmentfile.AlignmentFile.pileup (pysam/calignmentfile.c:11743) File "pysam/calignmentfile.pyx", line 2304, in pysam.calignmentfile.IteratorColumnRegion.__cinit__ (pysam/calignmentfile.c:23147) File "pysam/calignmentfile.pyx", line 2209, in pysam.calignmentfile.IteratorColumn.setupIteratorData (pysam/calignmentfile.c:22204) File "pysam/calignmentfile.pyx", line 1746, in pysam.calignmentfile.IteratorRowRegion.__init__ (pysam/calignmentfile.c:17915) File "pysam/calignmentfile.pyx", line 1703, in pysam.calignmentfile.IteratorRow.__init__ (pysam/calignmentfile.c:17529) AssertionError

I am using anvio-2.0.2.

I used following command:

anvio-profile -i 1-1.bam -c contigs.db -M 2000 -S Sample1-1 -o 1-1/

Can I get any help on this? I am unaware of Assertion Error.

Thank You,

Regards Shriram

meren commented 8 years ago

Hi Shriram, What happens when you run anvi-self-test?

ShriramHPatel commented 8 years ago

Hello,

I ran anvi-self-test and it completed succesfully. I used this in past many times, but never ran into such error. I did the following things in step by step manner, hope it can help.

  1. did assembly
  2. reformatted contigs file.
  3. build index using bowtie2
  4. mapped individual samples to it (output is sam)
  5. sam to raw_bam using samtools
  6. indexed bam file using ani-init-bam (after that both bam and bam.bai are in same folder).

Parallely,

  1. prepared contigs.db by using reformatted contigs file.
  2. performed anvi-run-hmm
  3. imported taxonomy using centrifuge parser

Now, I am runnin avni-profile for individual samples.

Thank You

meren commented 8 years ago

Hi,

Steps you followed make sense to me, and ifanvi-self-test is running without any errors, this is not a problem related to anvi'o or your system :/ I would look into the mapping results more carefully.

One or more of your BAM files may have no aligned reads in it (regardless of the size of the file), but I am not sure.

Best,