Error while using make_rarefaction_plots.py with prefs_otus.txt

21 views
Skip to first unread message

Arnold Rodríguez-Hilario

unread,
Apr 26, 2017, 9:46:51 AM4/26/17
to Qiime 1 Forum
I have been using a pref file to adjust the colors that matplotlib uses on different plots with no problem until recently I got the following error:

Traceback (most recent call last):
  File "/macqiime/anaconda/bin/make_rarefaction_plots.py", line 229, in <module>
    main()
  File "/macqiime/anaconda/bin/make_rarefaction_plots.py", line 219, in main
    generate_average_tables=generate_average_tables)
  File "/macqiime/anaconda/lib/python2.7/site-packages/qiime/make_rarefaction_plots.py", line 667, in make_averages
    metric_name, output_type)
  File "/macqiime/anaconda/lib/python2.7/site-packages/qiime/make_rarefaction_plots.py", line 46, in save_ave_rarefaction_plots
    data_colors[colors[o]].toHex(), elinewidth=1, lw=2, capsize=4)
  File "/macqiime/anaconda/lib/python2.7/site-packages/matplotlib/pyplot.py", line 2766, in errorbar
    errorevery=errorevery, capthick=capthick, **kwargs)
  File "/macqiime/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 2870, in errorbar
    l.set_color(ecolor)
  File "/macqiime/anaconda/lib/python2.7/site-packages/matplotlib/collections.py", line 1136, in set_color
    self.set_edgecolor(c)
  File "/macqiime/anaconda/lib/python2.7/site-packages/matplotlib/collections.py", line 625, in set_edgecolor
    self._edgecolors = mcolors.colorConverter.to_rgba_array(c, self._alpha)
  File "/macqiime/anaconda/lib/python2.7/site-packages/matplotlib/colors.py", line 422, in to_rgba_array
    result[i] = self.to_rgba(cc, alpha)
  File "/macqiime/anaconda/lib/python2.7/site-packages/matplotlib/colors.py", line 376, in to_rgba
    'to_rgba: Invalid rgba arg "%s"\n%s' % (str(arg), exc))
ValueError: to_rgba: Invalid rgba arg "#"
to_rgb: Invalid rgb arg "#"
invalid hex color string "#"


Here is the pref file:


{
'background_color':'black',

'sample_coloring':
    {
        'Sampling_Site':
        {
            'column':'Sampling_Site',
            'colors':
                {"Posterior_fornix":('deepskyblue',(0,191,255)),"Introitus":('indigo',(75,0,130))}},
        'Biopsy':
        {
            'column':'Biopsy',
            'colors':
                {"No Lesion":('olive',(128,128,0)),"CIN1":('gold',(255,215,0)),"CIN3":('orangered',(255,69,0))}},
        'Age':
        {
            'column':'Age',
            'colors':
                {"20-25":('yellowgreen',(154,205,50)),"26-30":('sandybrown',(244,164,96)),"31-35":('chocolate',(210,105,30)),"36-50":('rosybrown',(188,143,143))}},
    }
}


Am I missing something?

Thanks

Jai Ram Rideout

unread,
Apr 26, 2017, 7:33:06 PM4/26/17
to Qiime 1 Forum
Hello,

Can you post the output from running print_qiime_config.py -t ? The version of matplotlib you have installed may not be compatible with the way QIIME is specifying hex colors.

Best,
Jai
Reply all
Reply to author
Forward
0 new messages