dms-vep / dms-vep-pipeline

Pipeline for analyzing deep mutational scanning (DMS) of viral entry proteins (VEPs)
Other
1 stars 0 forks source link

Save figures as pdfs #46

Closed Bernadetadad closed 2 years ago

Bernadetadad commented 2 years ago

Currently non-altair figures (such as the ones in build_codon_variants notebook ) are saved as .png indocs/_images. Can we export figures as .pdf (or .svg) instead, this allows them to be subsequently modified in illustrator/inkskape as a vector graphic.

jbloom commented 2 years ago

Making a note, this may be helpful when trying to sort this out: https://nbsphinx.readthedocs.io/en/0.8.9/code-cells.html#Plots

jbloom commented 2 years ago

@Bernadetadad, I can't get this to work in a general way for all plots. What are specific plots of interest here?

Bernadetadad commented 2 years ago

I'm mostly thinking about Fig1 for paper so I think Average mutations per variant and functional score distributions is what I need.

Bernadetadad commented 2 years ago

@jbloom could you have a look at this, I'm currently writing the first section and would be good to have these for making figures.

jbloom commented 2 years ago

@Bernadetadad, does something like attached work for average mutations? Screen Shot 2022-07-28 at 4 28 13 PM

For the functional scores, I sort of think a ridgeline plot might be better than a violin plot as it won't emphasize the outliers so much. Would you agree on that?

Bernadetadad commented 2 years ago

yes on both points, I'll probably still play them up in illustrator but this works

jbloom commented 2 years ago

@Bernadetadad, for the functional scores, what about a ridgeline plot like this?

I have just made on per-library (averaging over all replicates for library), as I thought that might (?) be better way to show for paper. Does this seem about right?

Screen Shot 2022-07-29 at 1 49 15 PM

I typically don't like to use irrelevant color scales, but we could also color in the following ways:

Arbitrary colors per category:

Screen Shot 2022-07-29 at 1 51 43 PM

Colored according to the mean effect of mutations:

Screen Shot 2022-07-29 at 2 05 03 PM

I sort of like the last coloring scheme (mean effect of mutations) best, but what do you think?

Bernadetadad commented 2 years ago

So much better than the violin plots we had! Is it possible to add a legend for colors in the the bottom one?

jbloom commented 2 years ago

I could add a legend like this (cleaning up the label). Do you think that is helpful? I can't quite decide: it's sort of intuitive without and maybe we don't need to know the mean. But perhaps it is nice to show this if people want to sort of be able to see what the mean is for each. I'll add it if you think helpful.

Screen Shot 2022-07-29 at 2 14 55 PM

jbloom commented 2 years ago

I'll add a legend, and you can always remove it in Illustrator if you want.

Bernadetadad commented 2 years ago

I kind of like the legend because then you don't need to read the text to know what the colour scheme is calculated on, it might be obvious for us that it's mean but not necessarily for people seeing this the first time.