Mercurial > repos > crusoe > khmer
comparison filter-below-abund.py @ 60:fe697e0cb24a draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/blob/master/tools/khmer/ commit d8e0950d53e504e02ee5db43c0804142b14d7fd2-dirty
author | crusoe |
---|---|
date | Tue, 07 Jul 2015 11:59:39 -0400 |
parents | 0b238b083f77 |
children |
comparison
equal
deleted
inserted
replaced
59:08a599cf71d0 | 60:fe697e0cb24a |
---|---|
1 #! /usr/bin/env python2 | 1 #! /usr/bin/env python |
2 # | 2 # |
3 # This file is part of khmer, http://github.com/ged-lab/khmer/, and is | 3 # This file is part of khmer, https://github.com/dib-lab/khmer/, and is |
4 # Copyright (C) Michigan State University, 2009-2013. It is licensed under | 4 # Copyright (C) Michigan State University, 2009-2015. It is licensed under |
5 # the three-clause BSD license; see doc/LICENSE.txt. | 5 # the three-clause BSD license; see LICENSE. |
6 # Contact: khmer-project@idyll.org | 6 # Contact: khmer-project@idyll.org |
7 # | 7 # |
8 from __future__ import print_function | |
8 import sys | 9 import sys |
9 import screed.fasta | |
10 import os | 10 import os |
11 import khmer | 11 import khmer |
12 from khmer.thread_utils import ThreadedSequenceProcessor, verbose_fasta_iter | 12 from khmer.thread_utils import ThreadedSequenceProcessor, verbose_fasta_iter |
13 | 13 |
14 WORKER_THREADS = 8 | 14 WORKER_THREADS = 8 |
21 | 21 |
22 def main(): | 22 def main(): |
23 counting_ht = sys.argv[1] | 23 counting_ht = sys.argv[1] |
24 infiles = sys.argv[2:] | 24 infiles = sys.argv[2:] |
25 | 25 |
26 print 'file with ht: %s' % counting_ht | 26 print('file with ht: %s' % counting_ht) |
27 print '-- settings:' | 27 print('-- settings:') |
28 print 'N THREADS', WORKER_THREADS | 28 print('N THREADS', WORKER_THREADS) |
29 print '--' | 29 print('--') |
30 | 30 |
31 print 'making hashtable' | 31 print('making hashtable') |
32 ht = khmer.load_counting_hash(counting_ht) | 32 ht = khmer.load_counting_hash(counting_ht) |
33 K = ht.ksize() | 33 K = ht.ksize() |
34 | 34 |
35 for infile in infiles: | 35 for infile in infiles: |
36 print 'filtering', infile | 36 print('filtering', infile) |
37 outfile = os.path.basename(infile) + '.below' | 37 outfile = os.path.basename(infile) + '.below' |
38 | 38 |
39 outfp = open(outfile, 'w') | 39 outfp = open(outfile, 'w') |
40 | 40 |
41 def process_fn(record, ht=ht): | 41 def process_fn(record, ht=ht): |