annotate extract_mmvc_consensus @ 1:853065b53ee6 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'-dirty
author rdvelazquez
date Fri, 15 Mar 2019 13:34:54 -0400
parents c5c1faa433e4
children 4ca91bf87f1f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
1 #!/usr/bin/env python3
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
2
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
3 import json
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
4 import sys
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
5
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
6 # first argument is script name; second should be mmvcOutput path; third should be name for fasta header; the fourth argument should be the path to save the fasta at
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
7 mmvcOutput = sys.argv[1]
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
8 fastaHeaderName = sys.argv[2]
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
9 fastaFilePath = sys.argv[3]
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
10
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
11 with open(mmvcOutput) as f:
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
12 data = json.load(f)
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
13 consensus = data["consensus"]
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
14 consensusFasta = ">" + fastaHeaderName + "\n" + consensus
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
15 f = open(fastaFilePath, "w")
c5c1faa433e4 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
rdvelazquez
parents:
diff changeset
16 f.write(consensusFasta)