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, 453 bytes (コミッタ: kohda, 15 年 前) |
|---|
| 行番号 | |
|---|---|
| 1 | #!/usr/bin/python2.6 |
| 2 | |
| 3 | """ |
| 4 | Read a MAF from standard input and print the fraction of gap columns in |
| 5 | each block. |
| 6 | |
| 7 | usage: %prog < maf > out |
| 8 | """ |
| 9 | |
| 10 | from __future__ import division |
| 11 | |
| 12 | import sys |
| 13 | import bx.align.maf |
| 14 | |
| 15 | |
| 16 | def 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 | |
| 23 | if __name__ == "__main__": main() |
Note: リポジトリブラウザについてのヘルプは TracBrowser
を参照してください。
![(trac.ini の [header_logo] セクションを設定してください)](/bh10.10/chrome/site/your_project_logo.png)