Mercurial > repos > rdvelazquez > mmvc
diff extract_mmvc_consensus @ 0:c5c1faa433e4 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mmvc/ commit b'f226ae444ad694bb8d4f8faa80ed541b41cbc993\n'
author | rdvelazquez |
---|---|
date | Fri, 15 Mar 2019 13:29:34 -0400 |
parents | |
children | 4ca91bf87f1f |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extract_mmvc_consensus Fri Mar 15 13:29:34 2019 -0400 @@ -0,0 +1,16 @@ +#!/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)