Skip to content
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

Plot saving in API mode #96

Open
DexinYang1998 opened this issue Apr 3, 2024 · 1 comment
Open

Plot saving in API mode #96

DexinYang1998 opened this issue Apr 3, 2024 · 1 comment

Comments

@DexinYang1998
Copy link

DexinYang1998 commented Apr 3, 2024

Hi,

Thanks for your wonderful tools. In practice, I can successfully plot the tracks in Notebook, and I am wondering whether there is a way to save the current plot in PDF format.

Thanks so much for your help!

HiC_frame = HiCMat(HiC, balance = False) + \
    Spacer(0.5) 

with highlights_locus, highlights_cebpa:
    bw_frame = Virtual4C(HiC, "chr7:3512000-35125000") + Title("Virtual4C") + \
        Spacer(0.5) + \
        BigWig(H3K27ac_bw) + MinValue(0) +  Vlines(locus) + Title("H3K27ac") + \
        Spacer(0.5) + \
        BigWig(ATAC_bw) + MinValue(0) +  Vlines(locus) + Title("ATAC") + \
        Spacer(0.5) + \
        BigWig(NKX2_1_bw) + MinValue(0) +  Vlines(locus) + Title("Nkx2-1") + \
        GTF(gtf_mm10)
#frame.plot("chr7:35104964-35161193") 

frame = HiC_frame + bw_frame + XAxis()
frame.plot("chr7:35010000-35200000")

image

Meanwhile, I try to use two different commands with the same genomics coordinates to save figures, but I encountered some errors.

fig = frame.plot("chr7:35010000-35200000")
fig.savefig(fname= "test.pdf")

image

bsr = Browser(frame, reference_genome = "mm10")
bsr.goto("chr7:35010000-35200000")
bsr.save("test.pdf")

image

@wbszhu
Copy link
Collaborator

wbszhu commented Apr 21, 2024

Hi, can you try as below:

bsr = Browser(frame, reference_genome = "mm10")
bsr.goto("chr7:35010000-35200000")
bsr.show()
bsr.save("test.pdf")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants