BimberLab / cellhashR

An R package designed to demultiplex cell hashing data
27 stars 6 forks source link

Can plots from GenerateCellHashingCalls automatically be saved to pdf? #101

Closed lucygarner closed 2 years ago

lucygarner commented 2 years ago

Hi,

I really like all the plots generated by cellhashR but I would like to know if I can automatically save them to a pdf file? Otherwise, they are printed to screen in my Rmarkdown document and I can't easily save them.

Best wishes, Lucy

bbimber commented 2 years ago

See the example in the readme for writing to HTML:

CallAndGenerateReport(rawCountData = 'myCountDir/umi_count', reportFile = 'report.html', callFile = 'calls.txt', barcodeWhitelist = c('HTO-1', 'HTO-2', 'HTO-3'), title = 'Cell Hashing For Experiment 1')

That's how my lab typically runs it. This is passed to knitr/markdown, so possibly if you give it a PDF extension it would write to PDF? I've never tried that myself.

lucygarner commented 2 years ago

I have already run GenerateCellHashingCalls, so would I have to re-run the calling within CallAndGenerateReport? From my reading of the example usage, it looks like the answer is yes.

However, I don't seem to be able to add htodemux.positive.quantile = 0.99 to CallAndGenerateReport?

bbimber commented 2 years ago

yes, if you want to save an output with the plots you need to remake them (which means rerunning that code).

you might also be interested in

GetExampleMarkdown(dest = 'cellhashR_template.rmd')

which just lets you save the RMD file used internally by CallAndGenerateReport(). This would let you be more interactive and selective about what to run/re-run. You can save those plots of knit the result.

lucygarner commented 2 years ago

Thank you - is there a way to include the htodemux.positive.quantile = 0.99 argument to the CallAndGenerateReport function?

bbimber commented 2 years ago

Good question, if you include it does it get passed through?

lucygarner commented 2 years ago

No, it gave me an error that it was an unused argument.

Error in CallAndGenerateReport(rawCountData = "results/cellhashr_calls.csv", : unused argument (htodemux.positive.quantile = 0.99)

bbimber commented 2 years ago

Alright. I can think about supporting that, but in the meantime the function above to make it produce a template r markdown and then run this in rstudio is probably a reasonable way to do that.

lucygarner commented 2 years ago

Ok thank you.