Mercurial > repos > jjjjia > cpo_prediction
comparison cpo_galaxy_prediction.py @ 6:cabceaa239e4 draft
planemo upload
author | jjjjia |
---|---|
date | Thu, 23 Aug 2018 12:21:15 -0400 |
parents | 698579246d0d |
children | a14b12a71a53 |
comparison
equal
deleted
inserted
replaced
5:698579246d0d | 6:cabceaa239e4 |
---|---|
24 import collections | 24 import collections |
25 import json | 25 import json |
26 import numpy | 26 import numpy |
27 | 27 |
28 | 28 |
29 debug = True #debug skips the shell scripts and also dump out a ton of debugging messages | 29 debug = False #debug skips the shell scripts and also dump out a ton of debugging messages |
30 | 30 |
31 if not debug: | 31 if not debug: |
32 #parses some parameters | 32 #parses some parameters |
33 parser = optparse.OptionParser("Usage: %prog [options] arg1 arg2 ...") | 33 parser = optparse.OptionParser("Usage: %prog [options] arg1 arg2 ...") |
34 #required | 34 #required |
594 for item in output: | 594 for item in output: |
595 out.write("%s\n" % item) | 595 out.write("%s\n" % item) |
596 | 596 |
597 | 597 |
598 #TSV output | 598 #TSV output |
599 lindaOut = [] | |
599 tsvOut = [] | 600 tsvOut = [] |
600 tsvOut.append("ID\tExpected Species\tMLST Species\tSequence Type\tMLST Scheme\tCarbapenem Resistance Genes\tOther AMR Genes\tTotal Plasmids\tPlasmids ID\tNum_Contigs\tPlasmid Length\tPlasmid RepType\tPlasmid Mobility\tNearest Reference\tDefinitely Plasmid Contigs\tLikely Plasmid Contigs") | 601 lindaOut.append("new\tID\tQUALITY\tExpected Species\tMLST Scheme\tSequence Type\tMLST_ALLELE_1\tMLST_ALLELE_2\tMLST_ALLELE_3\tMLST_ALLELE_4\tMLST_ALLELE_5\tMLST_ALLELE_6\tMLST_ALLELE_7\tSEROTYPE\tK_CAPSULE\tPLASMID_1_FAMILY\tPLASMID_1_BEST_MATCH\tPLASMID_1_COVERAGE\tPLASMID_1_SNVS_TO_BEST_MATCH\tPLASMID_1_CARBAPENEMASE\tPLASMID_1_INC_GROUP\tPLASMID_2_RFLP\tPLASMID_2_FAMILY\tPLASMID_2_BEST_MATCH\tPLASMID_2_COVERAGE\tPLASMID_2_SNVS_TO_BEST_MATCH\tPLASMID_2_CARBAPENEMASE\tPLASMID_2_INC_GROUP") |
602 | |
603 tsvOut.append("new\tID\tExpected Species\tMLST Species\tSequence Type\tMLST Scheme\tCarbapenem Resistance Genes\tOther AMR Genes\tTotal Plasmids\tPlasmids ID\tNum_Contigs\tPlasmid Length\tPlasmid RepType\tPlasmid Mobility\tNearest Reference\tDefinitely Plasmid Contigs\tLikely Plasmid Contigs") | |
601 #start with ID | 604 #start with ID |
602 temp = "" | 605 temp = "\t" |
603 temp += (ID + "\t") | 606 temp += (ID + "\t") |
604 temp += expectedSpecies + "\t" | 607 temp += expectedSpecies + "\t" |
605 | 608 |
606 #move into MLST | 609 #move into MLST |
607 temp += mlstHit.species + "\t" | 610 temp += mlstHit.species + "\t" |