| 1 | #!/usr/bin/python2.6 |
|---|
| 2 | |
|---|
| 3 | """ |
|---|
| 4 | Randomly shuffle the columns of each block of a maf file. Note that this does |
|---|
| 5 | not change any other features of the maf block, thus the text of each row no |
|---|
| 6 | longer will match the sequence refered to by the other row attributes! |
|---|
| 7 | |
|---|
| 8 | usage: %prog < maf > maf |
|---|
| 9 | """ |
|---|
| 10 | |
|---|
| 11 | import psyco_full |
|---|
| 12 | |
|---|
| 13 | import sys |
|---|
| 14 | |
|---|
| 15 | import sys |
|---|
| 16 | from bx import align |
|---|
| 17 | |
|---|
| 18 | def __main__(): |
|---|
| 19 | |
|---|
| 20 | maf_reader = align.maf.Reader( sys.stdin ) |
|---|
| 21 | maf_writer = align.maf.Writer( sys.stdout ) |
|---|
| 22 | |
|---|
| 23 | for m in maf_reader: |
|---|
| 24 | |
|---|
| 25 | align.shuffle_columns( m ) |
|---|
| 26 | |
|---|
| 27 | maf_writer.write( m ) |
|---|
| 28 | |
|---|
| 29 | if __name__ == "__main__": __main__() |
|---|