-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BEDPE plotting #46
Comments
Hi, the FAN-C plotting classes all use standard matplotlib axes for plotting. Here is an example to get you started: import fanc
import fanc.plotting as fancplot
import matplotlib.pyplot as plt
from matplotlib.patches import Arc
# we use the Bonev et al. (2017) data, which you can find in the FAN-C example data
hic = fanc.load("examples/architecture/other-hic/bonev2017_esc_10kb.chr1.hic")
# Set up the figure with two panels that share an x axis
fig, axes = plt.subplots(2, 1, sharex=True)
# plot the Hi-C matrix (don't show the colorbar as otherwise the axes won't be aligned - you can also use more complicated layouts and put the colorbar in a separate panel using the "cax" argument)
p = fancplot.TriangularMatrixPlot(hic, ax=axes[0], show_colorbar=False)
p.plot('chr1:30.5mb-31.5mb')
# generate an arc
a = Arc((30960000, 0), 380000, 1, theta1=0, theta2=180, edgecolor='blue')
# add arc to the bottom panel
axes[1].add_patch(a)
# show the figure
plt.show() Obviously to do this automatically for BEDPE files you would have to calculate the midpoint between the two anchors for If you end up writing a class for this (you can use the Cheers, |
Closing due to inactivity |
Hello!
I'm interested in visualizing interactions (BEDPE files) with
fancplot
or through the Python API. It seems that it's currently possible to overlay them as circles on top of contact maps usingHicPeakPlot
. But I'm wondering if there are ways to plot them as curved lines between anchors on a separate panel (e.g., usingmatplotlib.patches.Arc
as pyGenomeTracks have done). Optionally, it'd be great to have to ability to vary the opacity/thickness of lines based on some "score" column.Would this be of interest to implement as a new plot class? Or perhaps there is a simpler way of adding them on top of existing panels through matplotlib directly? I tried looking into the latter option but had a hard time figuring out where to start.
Any pointers would be appreciated
The text was updated successfully, but these errors were encountered: