superFreq
superFreq copied to clipboard
Plotting only "LFC vs normals" or "SNP MAF" graph from the CNV figure
Hello, I apologize in advance if there are some mistakes or if my explanations is not clear. Please, do not hesitate to warn me if you have any questions. I am an engineer who recently started using superFreq in order to analyze the CNV (Copy Number Variations) for some patients diagnosed with the ovary cancer. I also use a lot the results of the superFreq library, especially the graphs in the CNV folder, with the variations for each gene. This graph is a concatenation of three graphs : "coverage LFC vs normals" graph in the top panel, the "SNP MAF" graph for the minor allele frequency in the middle panel and, lastly, the called clonality in the bottom panel. I can easily plot the two top panels with the argument "showClonality" or just by deleting the concerned columns from the CNAsegments.tsv and CNAbyGene.tsv files. However, I would like to plot and to save an image of only one graph or one panel at a time and it looks a bit more complicated. I would like to plot only the "coverage LFC vs normals" graph in one graph without cropping the original figure. But for now, I feel like the plotCR() function always creates two graphs to then draw both the LFC and the SNP MAF information. Would there be a way to plot only one or the other panel by modifying the function, without cropping the original image ? Thank you in advance for your help ! Sincerely,
Hi!
Happy to hear the package is seeing some use!
It's a reasonable request to plot only one panel, and indeed we often end up making plots of only read depth or only BAF for collaborators that go in their papers. I have some scripts that makes a bit more neat plots of only one panel (attached, first is total copy number, second is allelic balance, both are truncated to not show collaborators sample names or genes), a bit closer to publication grade figure, while the superFreq plots mostly are for exploratory analysis otherwise. I think it'd be good to polish up those scripts into a bit more flexible functions and add to the package.
I'm quite busy with support work at the moment though, as as this is more of a feature request rather than a bug rapport, I'd have a hard time putting this on top of my todo-list. I don't know how comfortable you are with R, but if I send you the scripts I have, would you be able to polish them up into functions that can be added to superFreq?
Otherwise I'll send you the scripts anyway, and hopefully you can adapt them for your use, and maybe at some point in the future I'll get to adding them to the package myself. :)
Alternatively, you can easily modify the plotCR
function to only do one panel by just deleting the part of the code that does the other panel. Type superFreq:::plotCR
, without the brackets, to see the code, copy-paste it somewhere and you can modify the function to plot only one panel. Not the pretiest solution, but probably the easiest.