GangCaoLab / CoolBox

Jupyter notebook based genomic data visualization toolkit.
https://gangcaolab.github.io/CoolBox/index.html
GNU General Public License v3.0
224 stars 37 forks source link

Reuse plot codes of arcs, hicpeaks #21

Closed zhqu1148980644 closed 3 years ago

zhqu1148980644 commented 3 years ago

The data format of inputs of Arcs and Hicpeaks are very similar, if there is a way to reuse the plotting code in custom tracks instead of creating an intermediate bed/pairs file.

It's common to generate python data like [(start, end), ...] when calling custom loops in python.

And this situation is quite general, users only care about how to produce the final loop results(representation of ranges) for a specific genomic range.

possible solutions:

Nanguage commented 3 years ago

Yes indeed, the arcs and hicpeaks has similar data structure, just different form of visualization. It's need some intermediate representation, maybe the IntervalTree or pandas.Dataframe is suitable for this, I prefer the Dataframe. It can fast extact the data and can directly store to the csv/tsv file.

For solution, I prefer the second, just like we do in the hicmat.plot and hist.plot. User just inherit them to use, compare to the first solution, it's keep some uniformity in design.

zhqu1148980644 commented 3 years ago

first commit:

report error in gallery and add more test_data

fix error in gallery

fill docstring for all tracks

add/reference custom track in cli mod