comparison EURL_VTEC_WGS_PT.py @ 4:32b5625795ea draft

planemo upload commit 906fafe94520fdbabb0fb94cdbe93ffeab43867a
author iss
date Thu, 19 Oct 2023 19:07:24 +0000
parents 444b0421bbdc
children fd9093b9368f
comparison
equal deleted inserted replaced
3:0506503db01d 4:32b5625795ea
119 subprocess.call("(head -n 1 pathotyper_rep_tot_tab && tail -n +2 pathotyper_rep_tot_tab | sort -k 2rn) > " + args.virulotyper, shell=True) 119 subprocess.call("(head -n 1 pathotyper_rep_tot_tab && tail -n +2 pathotyper_rep_tot_tab | sort -k 2rn) > " + args.virulotyper, shell=True)
120 log.write("\n\nViruloTyper\n===========\npatho_typing v1.0\n") 120 log.write("\n\nViruloTyper\n===========\npatho_typing v1.0\n")
121 log.write("parameters: minGeneCoverage=90, minGeneIdentity=90, minGeneDepth=15\n\n") 121 log.write("parameters: minGeneCoverage=90, minGeneIdentity=90, minGeneDepth=15\n\n")
122 log.write(os.popen("cat " + TOOL_DIR + "/data/ViruloTyping_db.txt").read()) 122 log.write(os.popen("cat " + TOOL_DIR + "/data/ViruloTyping_db.txt").read())
123 # SEQUENCETYPER 123 # SEQUENCETYPER
124 subprocess.call("mlst --legacy --scheme ecoli " + args.contigs + " | cut -f3,4,5,6,7,8,9,10 > " + args.mlstsevenloci, shell=True) 124 subprocess.call("mlst --legacy --scheme ecoli_4 " + args.contigs + " | cut -f3,4,5,6,7,8,9,10 > " + args.mlstsevenloci, shell=True)
125 sequence_typing = openFileAsTable(args.mlstsevenloci) 125 sequence_typing = openFileAsTable(args.mlstsevenloci)
126 log.write("\n\nSequence Typer\n==============\n") 126 log.write("\n\nSequence Typer\n==============\n")
127 log.write(os.popen("mlst -v").read()) 127 log.write(os.popen("mlst -v").read())
128 log.write("\n") 128 log.write("\n")
129 log.write(os.popen("cat " + TOOL_DIR + "/data/SequenceTyping_db.txt").read()) 129 log.write(os.popen("cat " + TOOL_DIR + "/data/SequenceTyping_db.txt").read())
202 else: 202 else:
203 report.write("ST%s" % sequence_typing[1][0]) 203 report.write("ST%s" % sequence_typing[1][0])
204 report.write("</p>\n") 204 report.write("</p>\n")
205 if args.virulotyping: 205 if args.virulotyping:
206 subprocess.call("sort " + args.virulotyper + " | awk '/eae_|stx1._|stx2._|ehxa_/ && $2>50 && !seen[substr($1, 1, index($1, \"_\")-2)]++ { printf(\"%s%s\",sep,substr($1, 1, index($1, \"_\")-1));sep=\", \" }END{print \"\"}' > virulotyper_rep", shell=True) 206 subprocess.call("sort " + args.virulotyper + " | awk '/eae_|stx1._|stx2._|ehxa_/ && $2>50 && !seen[substr($1, 1, index($1, \"_\")-2)]++ { printf(\"%s%s\",sep,substr($1, 1, index($1, \"_\")-1));sep=\", \" }END{print \"\"}' > virulotyper_rep", shell=True)
207 for line in fileinput.input("virulotyper_rep", inplace=True): 207 # for line in fileinput.input("virulotyper_rep", inplace=True):
208 print(line.replace("1a", "1"),) 208 # print(line.replace("1a", "1"),)
209 for line in fileinput.input("virulotyper_rep", inplace=True): 209 # for line in fileinput.input("virulotyper_rep", inplace=True):
210 print(line.replace("2a", "2"),) 210 # print(line.replace("2a", "2"),)
211 for line in fileinput.input("virulotyper_rep", inplace=True): 211 # for line in fileinput.input("virulotyper_rep", inplace=True):
212 print(line.replace("1b", "1"),) 212 # print(line.replace("1b", "1"),)
213 for line in fileinput.input("virulotyper_rep", inplace=True): 213 # for line in fileinput.input("virulotyper_rep", inplace=True):
214 print(line.replace("2b", "2"),) 214 # print(line.replace("2b", "2"),)
215 report.write("<p>Virulotypes: ") 215 report.write("<p>Virulotypes: ")
216 insertFile("virulotyper_rep", report) 216 insertFile("virulotyper_rep", report)
217 report.write("</p>\n") 217 report.write("</p>\n")
218 if args.shigatoxintyping: 218 if args.shigatoxintyping:
219 report.write("<p>Stx Subtypes: ") 219 report.write("<p>Stx Subtypes: ")