elsasserlab / labcode

Utils to perform frequent data analyses in the lab.
GNU General Public License v3.0
0 stars 1 forks source link

[plot] igv profile alternative #10

Closed shaorray closed 4 years ago

shaorray commented 4 years ago

Many papers made nicer coverage plots directly from bam/bw within a genome interval, not just screen shot of igv interface.

I have a relevant script, now can only plot the average profile of input genes. It's better to include the utility to make an alternative.

cnluzon commented 4 years ago

I agree with this, I have also been playing with this Gviz library in the past. The only problem is that this kind of plot changes a lot every time depending on what you want to show: bigWig tracks only, BED file annotations... I guess we could add something standard for just a set of bigWig and a set of BED, which is what we usually have on publications. For something more specific maybe it's best to just use Gviz, or another alternative which may be better, which library do you use?

shaorray commented 4 years ago

Last time I split the panel and added barplot for coverage and gene model with ggbio::autoplot.

R basic barplot is the most often choice I can tell from its y axis style, and flexible to append gene boxes/element blocks at the lower part.

I need to think about how to simplify the script as a utility.

simonelsasser commented 4 years ago

I wish there was just a more modern IGV browser. Coding something that generates a similar output is almost equivalent effort than coding a new genome browser. The Gviz seems like a reasonable start but its still quite coding intense to create a complex genome picture as we do in IGV.

cnluzon commented 4 years ago

I feel the same way, I guess we all try to look out for these tools because we'd like something that looks better, in terms of figure quality, than a IGV screenshot, but then IGV flexibility beats the effort it takes. And the ability to browse and provide IGV sessions for the tracks.

I still think there is room for these kind of libraries in the cases where you want to plot something specific, or overlay something more complex, like I don't know, a scatter plot on top of a track, something like this. But this would be a specific case and in that case I would just code an ad-hoc plot, I don't think it would be worth to generalize.

Eventually, somebody should do a purely web version of IGV, but that would be a full-on application that would take a dedicated team. I'd love to see that happen, though.

shaorray commented 4 years ago

Rplot

shaorray commented 4 years ago

ChIP signals are easier to plot with normalized bw files, but it's still a good add-on to have a plotting tool that adapted to certain aims, which I encountered when plot with RNA coverage.

For TT-seq's purpose, starting with stranded and pair-ended bam files, it requires size factor normalization also combining replicates. IGV cannot provide the functionality.

So I arranged the plotting script I made for my half-time seminar. Though it's mainly for TT-seq, any suggestion is welcomed.

shaorray commented 4 years ago

Fig1_view_coverage.zip

simonelsasser commented 4 years ago

@cnluzon @shaorray can this be included in elsasserlib for easy calling? Looks really nice!

shaorray commented 4 years ago

The function uses basically the same bioconducter packages, will be easy to incorporate.

The inputs have a list of size factors for each particular bam file, also many other lists, e.g. annotations, since only using one function interface to take all file paths and parameters.

It can be an alternative to IGV (extra scaling and smoothing), which I will plot with after having found good intervals.

For instance, Myc attenuated in 2i https://www.cell.com/cell/pdf/S0092-8674(15)01697-9.pdf image

It may also be able to plot "footprints" on genome coverage, with isize instead of stack of reads. But then it's binned genome coverage, rather than directly retrieves from interval reads coverage.