root/galaxy-central/eggs/bx_python-0.5.0_dev_f74aec067563-py2.6-macosx-10.6-universal-ucs2.egg/EGG-INFO/scripts/maf_species_in_all_files.py @ 3

リビジョン 3, 0.5 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1#!/usr/bin/python2.6
2
3"""
4Takes a list of maf filenames on the command line and prints a comma separated
5list of the species that occur in all of the mafs.
6
7usage %prog maf1 maf2 ...
8"""
9
10import operator
11import sys
12import bx.align.maf
13
14files = sys.argv[1:]
15sets = []
16
17for file in files:
18    sys.stderr.write( "." )
19    s = set()
20    for block in bx.align.maf.Reader( open( file ) ):
21        for comp in block.components:
22            s.add( comp.src.split( '.' )[0] )
23    sets.append( s )
24
25inter = reduce( operator.and_, sets )
26print ",".join( inter )
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。