Giter Site home page Giter Site logo

lkremer / cafe_fig Goto Github PK

View Code? Open in Web Editor NEW
59.0 2.0 16.0 507 KB

A tool to extract and visualize the results of CAFE (Computational Analysis of gene Family Evolution)

Python 100.00%
cafe gene-families evolution molecular-evolution ete3 phylogenetic-trees

cafe_fig's Introduction

Hi there

I'm Lukas, a postdoctoral researcher in the labs of Simon Anders and Ana Martin-Villalba in Heidelberg, Germany. I share Python and R code related to bioinformatics, data science, omics and the occasional fun code project.

Lukas' GitHub stats

Top Langs

cafe_fig's People

Contributors

lkremer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cafe_fig's Issues

ZeroDivisionError: float division by zero

Hi, @LKremer
I am trying to use CAFE_fig to visualize the results from CAFE, but I encountered some problems.
Here is my running: python3 ./CAFE_fig/CAFE_fig.py cafe_result.cafe -c asc=vL, da -pb 0.05 -pf 0.05 --dump test/ -g .pdf --count_all_expansions
And these are output:

Traceback (most recent call last):
File "./CAFE_fig/CAFE_fig.py", line 517, in
main(**vars(args))
File "./CAFE_fig/CAFE_fig.py", line 458, in main
c = CAFE_fig(report_cafe, families, clades, pb, pf, dump, gfx_output_format, count_all_expansions)
File "./CAFE_fig/CAFE_fig.py", line 86, in init
self.parse_tree()
File "./CAFE_fig/CAFE_fig.py", line 136, in parse_tree
self.parse_lambdas(line)
File "./CAFE_fig/CAFE_fig.py", line 209, in parse_lambdas
self.lambda_colors[i] = to_rgb(math.log(lambda_), min_l, max_l)
File "./CAFE_fig/CAFE_fig.py", line 62, in to_rgb
v = (v_abs - min_v) / (max_v - min_v) # scaled to a value between 0 and 1
ZeroDivisionError: float division by zero

Could you help with this? I appreciate your help. Thanks!
Fei

ETE: cannot connect to X server

Installation process and environment

conda create -n CAFE_fig -c etetoolkit 'ete3==3.0.0b35'
conda list

#
# Name                    Version                   Build  Channel
blas                      1.0                         mkl    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
cairo                     1.14.8                        0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
certifi                   2016.2.28                py35_0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
ete3                      3.0.0b35                 py35_0    http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
fontconfig                2.12.1                        3    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
freetype                  2.5.5                         2    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
glib                      2.50.2                        1    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
harfbuzz                  0.9.39                        2    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
libffi                    3.2.1                         1    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
libgfortran               3.0.0                         1    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
libiconv                  1.14                          0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
libpng                    1.6.30                        1    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
libxml2                   2.9.4                         0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
libxslt                   1.1.29                        0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
lxml                      3.8.0                    py35_0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
mkl                       2017.0.3                      0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
numpy                     1.13.1                   py35_0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
openssl                   1.0.2l                        0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
pango                     1.40.3                        1    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
pcre                      8.39                          1    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
pip                       9.0.1                    py35_1    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
pixman                    0.34.0                        0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
pyqt                      4.11.4                   py35_4    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
python                    3.5.4                         0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
qt                        4.8.7                         4    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
readline                  6.2                           2    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
scipy                     0.19.1              np113py35_0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
setuptools                36.4.0                   py35_1    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
sip                       4.18                     py35_0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
six                       1.10.0                   py35_0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
sqlite                    3.13.0                        0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
tk                        8.5.18                        0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
wheel                     0.29.0                   py35_0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
xz                        5.2.3                         0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free
zlib                      1.2.11                        0    http://mirrors.ustc.edu.cn/anaconda/pkgs/free

I tried the command:

python3 ./CAFE_fig.py example_result.cafe -c Isoptera=zne,mna -pb 0.05 -pf 0.05 --dump test/ -g .pdf --count_all_expansions
Parsing CAFE report... done!
        Writing test/summary.pdf
ETE: cannot connect to X server

AttributeError: 'CAFE_fig' object has no attribute 'lambdas'

Hi,
I tried parsing my CAFE resultfile, but got an attribute error. Here is the traceback:
Traceback (most recent call last):
File "../../scripts/CAFE_fig.py", line 509, in
main(**vars(args))
File "../../scripts/CAFE_fig.py", line 454, in main
c.summary_tree()
File "../../scripts/CAFE_fig.py", line 291, in summary_tree
min(self.lambdas.values()), max(self.lambdas.values()))
AttributeError: 'CAFE_fig' object has no attribute 'lambdas'

I am running python on a conda environment with:
pyqt 4.11.4
python 3.5.5
ete3 3.0.0b35

Thanks in advance!

Could not connect to any X display.

-bash-4.2$ python3 ./CAFE_fig-master/CAFE_fig.py resultfie1.cafe -pb 0.05 -pf 0.05 --dump test/ -g pdf --count_all_expansions
The directory "test/" already exists. Overwrite it and delete all its contents? (y/n)? y
Parsing CAFE report... done!
Writing test/summary.pdf
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.

could you please help me, thank you very much!

qt.qpa.xcb: could not connect to display

Hello! When i run the script, i met a problem. The problem:
Parsing CAFE report... done!
Writing test/summary.pdf
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb.

Aborted (core dumped)

This is my code:python3 ./cafe_fig.py example_result.cafe -c Isoptera=zne,mna -pb 0.05 -pf 0.05 --dump test/ -g .pdf --count_all_expansions

The data i used the example.

Thank you very much!!

ValueError: could not convert string to float

Hi LKremer

I am trying to use CAFE_fig to visualize the results from CAFE, but I encountered some problems.
Here is my running: python3 ./CAFE_fig-master/CAFE_fig.py out.cafe
And these are output:
Traceback (most recent call last):
File "./CAFE_fig-master/CAFE_fig.py", line 520, in
main(**vars(args))
File "./CAFE_fig-master/CAFE_fig.py", line 461, in main
c = CAFE_fig(report_cafe, families, clades, pb, pf, dump, gfx_output_format, count_all_expansions)
File "./CAFE_fig-master/CAFE_fig.py", line 89, in init
self.parse_tree()
File "./CAFE_fig-master/CAFE_fig.py", line 163, in parse_tree
for family in self:
File "./CAFE_fig-master/CAFE_fig.py", line 334, in iter
yield Family(line, self)
File "./CAFE_fig-master/CAFE_fig.py", line 421, in init
self.pvalue = float(values[2])
ValueError: could not convert string to float: '((Smoellendorffii_1:364.624,(Athaliana_5:314.68,(Earvense_6:251.574,(Dchinensis_2:209.164,(Afokiensis_7:179.207,(((LW_3:55.6774,ZXDS_1:55.6774)_2:46.7325,RS119_1:102.41)_2:39.5235,(Pnudum_4:42.3447,Ttannensis_4:42.3447)_4:99.5887)_3:37.2738)_3:29.9567)_3:42.4098)_3:63.1059)_3:49.944)_3:29.8768,Pp_4:394.5)_3'
Could you help with this? I appreciate your help. Thanks!
Xia

module 'ete3' has no attribute 'TreeStyle'

Conmand line I used:

python ~/softwares/CAFE_fig/CAFE_fig.py -d cafe_fig pan_genome_remove_atalla.cafe

The ete3 information:

pip list
Package      Version 
------------ --------
asn1crypto   0.24.0  
certifi      2019.3.9
cffi         1.11.5  
chardet      3.0.4   
conda        4.6.14  
cryptography 2.4.2   
ete3         3.0.0b35

Any suggestions are appreciative !

No_color for the example data

Dear LKremer,
Thank you for this softeware, while when I run the example date, black and white figure output.

python ./CAFE_fig.py example_result.cafe -c Isoptera=zne,mna -pb 0.05 -pf 0.05 --dump test2/ -g .pdf --count_all_expansions

AttributeError: 'TreeNode' object has no attribute 'lambda_group'

Hi,
CAFE_fig is cool to plot a gene family tree. When I used CAFE_fig to plot my result of cafe (version=4.2.1), there was an error as follow:
Parsing CAFE report... done!
Writing test/summary.pdf
Traceback (most recent call last):
File "/CAFE_fig/CAFE_fig.py", line 520, in
main(**vars(args))
File "/CAFE_fig/CAFE_fig.py", line 465, in main
c.summary_tree()
File "/CAFE_fig/CAFE_fig.py", line 306, in summary_tree
self.show_or_dump_tree(tree_obj=t, tree_style=ts, fname='summary')
File "/CAFE_fig/CAFE_fig.py", line 410, in show_or_dump_tree
tree_obj.render(out_path, tree_style=tree_style)
File "/Anaconda3/lib/python3.8/site-packages/ete3/coretype/tree.py", line 1392, in render
return drawer.render_tree(self, file_name, w=w, h=h,
File "/Anaconda3/lib/python3.8/site-packages/ete3/treeview/drawer.py", line 104, in render_tree
tree_item, n2i, n2f = render(t, img)
File "/Anaconda3/lib/python3.8/site-packages/ete3/treeview/qt4_render.py", line 254, in render
set_style(n, layout_fn)
File "/Anaconda3/lib/python3.8/site-packages/ete3/treeview/qt4_render.py", line 777, in set_style
func(n)
File "/CAFE_fig/CAFE_fig.py", line 270, in fam_size_piechart_layout
circle_color = self.lambda_colors[node.lambda_group]
AttributeError: 'TreeNode' object has no attribute 'lambda_group'
What is the matter about my result of cafe? Thank you very much!
wang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.