3
3
4
4
"""usage: blobtools plot --i <BLOBDB> [--p <MAXTAX>] [--l <LEN>] [--c] [--n] [--x]
5
5
[--o <PREFIX>] [--m] [--sort <ORDER>] [--hist <HIST>] [--title]
6
- [--rank <RANK>] [--taxrule <TAXRULE>] [--cluster <GROUPS>...]
6
+ [--rank <RANK>] [--taxrule <TAXRULE>] [--label <GROUPS>...]
7
7
[--h|--help]
8
8
9
9
Options:
27
27
(Supported: species, genus, family, order, phylum, superkingdom)
28
28
--taxrule <TAXRULE> Taxrule which has been used for computing taxonomy
29
29
(Supported: bestsum, bestsumorder) [default: bestsum]
30
- --cluster <GROUPS>... Cluster taxonomic groups together ,
31
- e.g. "Contaminants =Actinobacteria,Proteobacteria"
30
+ --label <GROUPS>... Relabel taxonomic groups,
31
+ e.g. "Bacteria =Actinobacteria,Proteobacteria"
32
32
"""
33
33
34
34
from __future__ import division
59
59
hist_type = args ['--hist' ]
60
60
plot_title = args ['--title' ]
61
61
ignore_contig_length = args ['--x' ]
62
- clusters = args ['--cluster ' ]
62
+ labels = args ['--label ' ]
63
63
64
64
# Does blobdb_f exist ?
65
65
if not isfile (blobdb_f ):
79
79
if taxrule not in TAXRULES :
80
80
BtLog .error ('8' , taxrule )
81
81
82
- # compute clusters if supplied
83
- cluster_d = {}
84
- if (clusters ):
82
+ # compute labels if supplied
83
+ label_d = {}
84
+ if (labels ):
85
85
try :
86
- for cluster in clusters :
86
+ for cluster in labels :
87
87
name , groups = cluster .split ("=" )
88
88
for group in groups .split ("," ):
89
89
if (group ):
90
- if group in cluster_d :
90
+ if group in label_d :
91
91
BtLog .error ('17' , group )
92
- cluster_d [group ] = name
92
+ label_d [group ] = name
93
93
except :
94
- BtLog .error ('16' , clusters )
94
+ BtLog .error ('16' , labels )
95
95
96
96
# Load BlobDb
97
97
print BtLog .status_d ['9' ] % blobdb_f
107
107
BtLog .error ('11' , taxrule , blobDB .taxrules )
108
108
109
109
# blobDB.getArrays(rank, c_index, min_length, multiplot, hide_nohits, out_prefix, max_taxa_plot, sort_order, taxrule, hist_type, plot_title)
110
- data_array , cov_arrays , summary_dict = blobDB .getArrays (rank , min_length , hide_nohits , taxrule , c_index , cluster_d )
110
+ data_array , cov_arrays , summary_dict = blobDB .getArrays (rank , min_length , hide_nohits , taxrule , c_index , label_d )
111
111
plot_order = BtPlot .getPlotOrder (summary_dict , sort_order , max_taxa_plot )
112
112
colour_dict = BtPlot .getColourDict (plot_order )
113
113
min_cov , max_cov = BtPlot .getMinMaxCov (cov_arrays )
121
121
out_f = "%s.%s" % (out_prefix , out_f )
122
122
if c_index :
123
123
out_f = "%s.%s" % (out_f , "c_index" )
124
- if clusters :
125
- out_f = "%s.%s" % (out_f , "cluster_ " + "_" .join (set ([name for name in cluster_d .values ()])))
124
+ if labels :
125
+ out_f = "%s.%s" % (out_f , "label_ " + "_" .join (set ([name for name in label_d .values ()])))
126
126
out_f = "%s.%s.%s" % (out_f , min_length , taxrule )
127
127
BtPlot .plot (data_array , cov_array , summary_dict , plot_order , colour_dict , min_cov , max_cov , multiplot , hist_type , plot_title , out_f , ignore_contig_length , info )
128
128
info = 0
0 commit comments