MaxLChao / gGnome

R API for browsing, analyzing, and manipulating reference-aligned genome graphs in a GenomicRanges framework
http://mskilab.com/gGnome/tutorial.html
MIT License
0 stars 0 forks source link

coverage addition is too specific #5

Open MaxLChao opened 1 year ago

MaxLChao commented 1 year ago

adding new plots is a bit difficult. I.e. if we want to add multiple coverage plots, we cannot with the current instance without a weird work around

i.e. we upload a tumor drycleaned cov plot with the ggraph. We run into an issue with the graphs and we want to diagnose with the normal coverage plot. How do we add this easily?

Have to do a workaround where we individually add the graph via something like this:

cov2arrowPGV(PGVpairs_dcn$normal_dryclean_cov[1], 
             field = "foreground",ref = "hg19", 
             output_file = paste0(PGVdb$data_folder, "/", 
                                  PGVpairs_dcn$pair[1], "/",
                                  PGVpairs_dcn$pair[1], "dcN-coverage.arrow"), 
             meta.js = "~/public_html/PGV_viz/public/settings.json")

ngraph = data.table(sample = PGVpairs_dcn$pair[1], type = "scatterplot", 
                    source = paste0(PGVpairs_dcn$pair[1], "dcN-coverage.arrow"),
                    title = paste0(PGVpairs_dcn$pair[1], "dcN Coverage Distribution"), 
                    visible = FALSE, 
                    patient.id = PGVpairs_dcn$pair[1], plot_id = NA)

PGVdb$plots = rbind(PGVdb$plots, ngraph)
push_PGV_db(PGVdb)
MaxLChao commented 1 year ago

perhaps when I move the object to R6 we just ask the user to provide a graph and we check for the types and then adds with a title I guess? hard to say.