[khmer] operation of khmer

C. Titus Brown ctb at msu.edu
Fri May 17 06:21:31 PDT 2013


On May 15, 2013, at 11:56 AM, sheerli kruger <sheerlik at yahoo.com> wrote:

> Hi Titus,
> Thank you for your quick response.

Welcome, and apologies for delayed response this time -- if you keep khmer at lists.idyll.org, then others can answer when I'm busy...

> we are using khmer to reduce the memory requirment for metagenome assembly. Our goal is to use Khmer and then to assemble our data in Metavelvet. When we tried to use Python 2.6.6:
> python /home/apps/khmer/khmer-2013-05-06/scripts/normalize-by-median.py -k 32 -C 20 -N 4 -x 4e9 -p Data/shuffle/21_shuffle.fastq
>  
> Traceback (most recent call last):
> File "/home/apps/khmer/khmer-2013-05-06/scripts/normalize-by-median.py", line 11, in <module>
> import sys, screed, os
> ImportError: No module named screed

Yes, you need to install screed.  Here are some installation instructions:

http://khmer.readthedocs.org/en/latest/install.html

although we're working on a making things more simple.

>  
> Python 2.7.3:
> /home/apps/python-2.7.3/bin/python /home/apps/khmer/khmer-2013-05-06/scripts/normalize-by-median.py
>  
> Traceback (most recent call last):
> File "/home/apps/khmer/khmer-2013-05-06/scripts/normalize-by-median.py", line 11, in <module>
> import sys, screed, os
> File "/home/apps/python-2.7.3/lib/python2.7/site-packages/screed-0.7-py2.7.egg/screed/__init__.py", line 24, in <module>
> from openscreed import ScreedDB, open_writer
> File "/home/apps/python-2.7.3/lib/python2.7/site-packages/screed-0.7-py2.7.egg/screed/openscreed.py", line 5, in <module>
> import sqlite3
> File "/home/apps/python-2.7.3/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
> from dbapi2 import *
> File "/home/apps/python-2.7.3/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module>
> from _sqlite3 import *
> ImportError: No module named _sqlite3

Your Python 2.7 installation is missing a module. sqlite3.  This is an optional component of Python that may require some extra work on the part of your admin to install.

> Python 3.2.3:
>  
> /home/apps/python-3.2.3/bin/python /home/apps/khmer/khmer-2013-05-06/scripts/normalize-by-median.py -k 32 -C 20 -N 4 -x 4e9 -p Data/shuffle/21_shuffle.fastq
>  
> File "/home/apps/khmer/khmer-2013-05-06/scripts/normalize-by-median.py", line 71
> print 'loading hashtable from', args.loadhash
> ^
> SyntaxError: invalid syntax

Ah-hah! Now I understand the syntax error :).  Python 3.x is not backwards compatible with Python 2.x, and khmer only runs in Python 2.x so far.

It looks to me like the simplest thing to do is install screed under Python 2.6.

> Additionly we have paired end sequences.Can we enter shuffled sequences?

Yes.  Then, you can run normalize-by-median with '-p' to retain both sequences if either end is retained, or you can omit -p and then split out those pairs that remain afterwards.  I can send you instructions on this a bit later if you want; don't have them handy.

cheers,
--titus





More information about the khmer mailing list