Jupyter notebook based genomic data visualization toolkit.

GangCaoLab, updated 🕥 2022-01-22 09:43:35


Binder Install with conda Install with PyPi Docker version Github release Documentation Version Downloads Downloads per week Build Status codecov biorxiv license

Flexible, user-friendly genomic data visualization toolkit.

Highlights:

  • Multi-omics data interactively visualization.
  • User-friendly API (ggplot2-like Python EDSL) and CLI.
  • Show within Jupyter notebook.
  • Ease to fetch data and in cooperation with other Python package.
  • Ease to implement/add custom track and integrate into CoolBox.

More details please read the documentation. Interactively online demo: binder

Develop

See CONTRIBUTING.md

Citation

@article{xu2021coolbox, title={CoolBox: A flexible toolkit for visual analysis of genomics data}, author={Xu, Weize and Zhong, Quan and Lin, Da and Zuo, Ya and Dai, Jinxia and Li, Guoliang and Cao, Gang}, journal={BMC bioinformatics}, volume={22}, number={1}, pages={1--9}, year={2021}, publisher={Springer} }

Thanks

Contributors

This project exists thanks to all the people who contribute.

Issues

joint view two different cool files

opened on 2023-03-02 12:07:53 by EnrichettaMileti

Hi! Is it possible to do the joint_center using two different cool file? To show the difference between the 2 contact maps?

Installation fail with pip python3.9

opened on 2022-11-18 03:30:21 by xunchen85

Can it be used on the MacOS M1 version?

Thanks

It got the following error: Screenshot 2022-11-18 at 12 29 31

Increase fontsize of GTF

opened on 2022-10-31 04:14:57 by gdolsten

Hi, the fontsize of the gene names in the GTF in the jointview is quite small relative to the HI-C matrix. Is there anyway this can be customized?

Change aspect ratio of jointview

opened on 2022-10-31 02:03:43 by gdolsten

Hi, I am plotting a jointview. However, I am plotting many fewer base pairs on the X axis than on the Y axis. How do I modify the aspect ratio to make each pixel square and the whole plot rectangular? Right now it is making the whole plot rectangular by stretching the matrix

Error when plotting SNP track with no SNPs in plot range

opened on 2022-10-24 13:48:44 by alexjcornish

Hi there, thanks for such a useful package.

I have encountered a bug when I try to plot a SNP track containing no SNPs in the plotted region.

If I am working with a TSV file:

chr4 15730398 1.6493369536091678e-05 chr4 15730146 1.6493369536091678e-05 chr4 15737348 1.3897495444980216e-05 chr4 15737101 1.3897495444980216e-05

And I try to plot a track like this:

``` import coolbox from coolbox.api import *

snp_path = 'data.snp.bgz'

test_range_no_error = 'chr4:15730000-15738000'

test_range_error = 'chr4:15720000-15728000'

frame = XAxis() + SNP(snp_path, col_chrom=0, col_pos=1, col_pval=2) frame.plot(test_range_error) ```

Then I get the error:

``` [ERROR:frame.py:215 - plot()] Error occured when plot track: track name: SNP.14 track type: Error: 'score' occurred in "/opt/conda/lib/python3.8/site-packages/coolbox/core/frame/frame.py", line 209 [ERROR:frame.py:222 - plot()] 'score' Traceback (most recent call last): File "/opt/conda/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3080, in get_loc return self._engine.get_loc(casted_key) File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 4554, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 4562, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'score'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/conda/lib/python3.8/site-packages/coolbox/core/frame/frame.py", line 209, in plot track.plot(ax, copy(gr), gr2=copy(gr2)) File "/opt/conda/lib/python3.8/site-packages/coolbox/core/track/hist/base.py", line 101, in plot data = self.fetch_plot_data(gr, **kwargs) File "/opt/conda/lib/python3.8/site-packages/coolbox/core/track/hist/snp.py", line 75, in fetch_plot_data df['score'] = self.transform_fn()(df['score']) File "/opt/conda/lib/python3.8/site-packages/pandas/core/frame.py", line 3024, in getitem indexer = self.columns.get_loc(key) File "/opt/conda/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3082, in get_loc raise KeyError(key) from err KeyError: 'score' ```

Ideally, plotting a range containing no SNPs would just return an empty track?

Missing arcs when plotting BEDPE file format

opened on 2022-07-15 11:20:16 by eafyounian

Hi! When plotting arcs for BEDPE file format, if the first coordinate comes after the second coordinate (i.e. start_x > start_y), the arc is not drawn. I have fixed this issue by swapping the first coordinate with the second coordinate (see figure where the first track after the gene track shows some features, the second track is how it looks after my fix, and the third track is before the fix where some arcs are missing). image Is there some other more elegant fixes?

By the way, I am using coolbox version 0.3.3. I quickly checked the source of the latest version (i.e. 0.3.8) but I did not immediately find any indication that this is addressed in the latest version (but of course I may have missed it 🙂).

Thank you in advance for your consideration and response! 🙂

Releases

2021-05-31 05:40:25

fix gtf lack of gene_name attribute error 2021-04-15 13:09:52

2021-03-17 10:11:27

2021-03-13 08:14:03

2021-03-09 03:28:21

2021-03-06 09:35:30