view 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
line wrap: on
line source

#!/usr/bin/env python3

import json
import sys

# 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
mmvcOutput = sys.argv[1]
fastaHeaderName = sys.argv[2]
fastaFilePath = sys.argv[3]

with open(mmvcOutput) as f:
    data = json.load(f)
consensus = data["consensus"]
consensusFasta = ">" + fastaHeaderName + "\n" + consensus
f = open(fastaFilePath, "w")
f.write(consensusFasta)