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

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

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

行番号 
1#!/usr/bin/python2.6
2
3"""
4Read a MAF from standard input and print the fraction of gap columns in
5each block.
6
7usage: %prog < maf > out
8"""
9
10from __future__ import division
11
12import sys
13import bx.align.maf
14
15
16def main():   
17    for m in bx.align.maf.Reader( sys.stdin ): 
18        gaps = 0       
19        for col in m.column_iter():
20            if ( '-' in col ): gaps += 1         
21        print gaps / m.text_size
22
23if __name__ == "__main__": main()
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。