reneshbedre / bioinfokit

Bioinformatics data analysis and visualization toolkit
MIT License
328 stars 77 forks source link

NameError: name 'color_result' is not defined #54

Open grace3999 opened 1 year ago

grace3999 commented 1 year ago

Error when trying to create PCA biplot with target label. Following this tutorial: https://www.reneshbedre.com/blog/principal-component-analysis.html

pca_scores = PCA().fit_transform(X_st) cluster.biplot(cscore=pca_scores, loadings=loadings, labels=X.columns.values, var1=round(pca_out.explained_varianceratio[0]100, 2), var2=round(pca_out.explained_varianceratio[1]100, 2), colorlist=target)


NameError Traceback (most recent call last)

in 7 pca_scores = PCA().fit_transform(X_st) 8 cluster.biplot(cscore=pca_scores, loadings=loadings, labels=X.columns.values, var1=round(pca_out.explained_variance_ratio_[0]*100, 2), ----> 9 var2=round(pca_out.explained_variance_ratio_[1]*100, 2), colorlist=target) ~/opt/anaconda3/envs/analysis/lib/python3.6/site-packages/bioinfokit/visuz.py in biplot(cscore, loadings, labels, var1, var2, var3, axlabelfontsize, axlabelfontname, figtype, r, show, markerdot, dotsize, valphadot, colordot, arrowcolor, valphaarrow, arrowlinestyle, arrowlinewidth, centerlines, colorlist, legendpos, datapoints, dim) 1604 1605 # only if y axis is positive -> 1606 if pv: 1607 if y_pos > 0: 1608 pv_symb = general.pvalue_symbol(pv[i], sign_symbol_opts['symbol']) NameError: name 'color_result' is not defined
reneshbedre commented 1 year ago

which version of bioinfokit you are using? Is it possible for you to share your data to replicate error?