centre-for-microbiome-research / GroopM

Metagenomic binning suite
GNU General Public License v3.0
29 stars 18 forks source link

GroopM parse issue: Random alignment retrieval only works for indexed files #22

Open sturne29 opened 8 years ago

sturne29 commented 8 years ago

I have my total assembly from Velvet, eight alignment files in .bam format (generated using BWA-MEM, then converted to .bam format using Samtools and sorted), and eight .bam.bai index files (generated by Samtools using the Index command). The .bam and .bam.bai files are identically named (except for the .bai extension) and contained in the same folder. As far as I know, this is what I need to run the program. However, when using the following command (on a Linux system)

groopm parse database.gm total_assembly.fa sample1.bam sample2.bam sample3.bam sample4.bam sample5.bam sample6.bam sample7.bam sample8.bam

I get the following output (after agreeing to overwrite the database.gm database):

Overwriting database database.gm
Parsing contigs
Parsing BAM files using 1 threads
Parsing file: [path]/sample1.bam
ERROR: Random alignment retrieval only works for indexed BAM or CRAM files.
Error creating database: database.gm <type 'exceptions.IndexError'>
Unexpected error: <type 'exceptions.IndexError>
Traceback (most recent call last):
  File "/usr/local/bin/groopm", line 421, in <module>
    GM_parser.parseOptions(args)
  File "/usr/local/lib/python2.7/dist-packages/groopm/groopm.py", line 117, in parseOptions
    threads=options.threads)
  File "/usr/local/lib/python2.7/dist-packages/groopm/mstore.py", line 275, in createDB
    threads)
  File "/usr/local/lib/python2.7/dist-packages/groopm/mstore.py", line 1734, in parse
    verbose=True)
  File "/usr/local/lib/python2.7/dist-packages/bamm/bamParser.py", line 393, in parseBams
    self.collapseBFIs(BFI_list)
  File "/usr/local/lib/python2.7/dist-packages/bamm/bamParser.py", line 493, in collapseBFIs
    self.BFI = BFI_list[baseBFI_index]
  File "<string>", line 2, in __getitem__
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 774, in _callmethod
    raise convert_to_error(kind, result)
IndexError: list index out of range

Any insight into this would be appreciated. As far as I know, all of the dependencies are correctly installed.

sturne29 commented 8 years ago

Well, I tried again with different file names ('sample' was just a placeholder, they were actually named like sample1.sorted.bam and sample1.sorted.bam.bai: I replaced the first period with an underscore in case there was some wonkiness). I'm not getting my previous error, but still getting an error. Any ideas about the new error?

Overwriting database database.gm
Parsing contigs
Parsing BAM files using 1 threads
Parsing file: path/sample1_sorted.bam
Error creating database: database.gm <type 'exceptions.IndexError'>
Unexpected error: <type 'exceptions.IndexError'>
Traceback (most recent call last):
  File "/usr/local/bin/groopm", line 421, in <module>
    GM_parser.parseOptions(args)
  File "/usr/local/lib/python2.7/dist-packages/groopm/groopm.py", line 117, in parseOptions
    threads=options.threads)
  File "/usr/local/lib/python2.7/dist-packages/groopm/mstore.py", line 275, in createDB
    threads)
  File "/usr/local/lib/python2.7/dist-packages/groopm/mstore.py", line 1734, in parse
    verbose=True)
  File "/usr/local/lib/python2.7/dist-packages/bamm/bamParser.py", line 393, in parseBams
    self.collapseBFIs(BFI_list)
  File "/usr/local/lib/python2.7/dist-packages/bamm/bamParser.py", line 493, in collapseBFIs
    self.BFI = BFI_list[baseBFI_index]
  File "<string>", line 2, in __getitem__
  File "/usr/lib/python2.7/multiprocessing/managers.py", line 774, in _callmethod
    raise convert_to_error(kind, result)
IndexError: list index out of range
timbalam commented 8 years ago

Hi sturne29,

Thanks for the report. I have been looking into the other error, but it is quite baffling. This looks to be along the same lines.

I will let you know if I can figure it out.

Cheers, Tim

On 1/07/2016 12:42 PM, sturne29 wrote:

Well, I tried again with different file names ('sample' was just a placeholder, they were actually named like sample1.sorted.bam and sample1.sorted.bam.bai: I replaced the first period with an underscore in case there was some wonkiness). I'm not getting my previous error, but still getting an error. Any ideas about the new error?

|Overwriting database database.gm Parsing contigs Parsing BAM files using 1 threads Parsing file: path/sample1_sorted.bam Error creating database: database.gm <type 'exceptions.IndexError'> Unexpected error: <type 'exceptions.IndexError'> Traceback (most recent call last): File "/usr/local/bin/groopm", line 421, in GM_parser.parseOptions(args) File "/usr/local/lib/python2.7/dist-packages/groopm/groopm.py", line 117, in parseOptions threads=options.threads) File "/usr/local/lib/python2.7/dist-packages/groopm/mstore.py", line 275, in createDB threads) File "/usr/local/lib/python2.7/dist-packages/groopm/mstore.py", line 1734, in parse verbose=True) File "/usr/local/lib/python2.7/dist-packages/bamm/bamParser.py", line 393, in parseBams self.collapseBFIs(BFI_list) File "/usr/local/lib/python2.7/dist-packages/bamm/bamParser.py", line 493, in collapseBFIs self.BFI = BFI_list[baseBFI_index] File "", line 2, in getitem File "/usr/lib/python2.7/multiprocessing/managers.py", line 774, in _callmethod raise convert_to_error(kind, result) IndexError: list index out of range |

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Ecogenomics/GroopM/issues/22#issuecomment-229840902, or mute the thread https://github.com/notifications/unsubscribe/AHD5ZfI9E5lMgud1-6JJh2IGTG3p1eHNks5qRH6RgaJpZM4I9VvA.