igvteam / igv

Integrative Genomics Viewer. Fast, efficient, scalable visualization tool for genomics data and annotations
https://igv.org
MIT License
647 stars 386 forks source link

Scaling exons and introns for sashimi plots #530

Open yimmieg opened 6 years ago

yimmieg commented 6 years ago

For long genes, the sashimi plots produced are hard to visualize. Anyway those plots could be scaled to reduce the intron width vs exon width?

jrobinso commented 6 years ago

Not currently, but that's a good idea. The most difficult part would be scaling the other tracks on the plot. Perhaps in this mode only exon data would be drawn for the other tracks.

yimmieg commented 6 years ago

hey jim,

nice to hear from you! i’m referring to the pop-up sashimi plot window. as far as i can tell, the only other track on there is the gene/transcript annotation track so it wouldn’t necessarily require rescaling of other user specific tracks.

best,

~jimmie

On Apr 6, 2018, at 8:16 AM, Jim Robinson notifications@github.com wrote:

Not currently, but that's a good idea. The most difficult part would be scaling the other tracks on the plot. Perhaps in this mode only exon data would be drawn for the other tracks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv/issues/530#issuecomment-379285438, or mute the thread https://github.com/notifications/unsubscribe-auth/AEUMf_ohvSnpsxyYVKfnMQCAO07PkecPks5tl4bCgaJpZM4TKI3B.

jrobinso commented 6 years ago

Hi jimmie, I thought that was you :). Yes, you are correct, I had forgotten that you can't load arbitrary tracks there. One more question -- in this mode should the exons be scaled relative to their own length, or all exons appear the same width?

I've often thought of doing this but no one has asked for it that I recall until now. I'm pretty busy, but if this doesn't happen in a reasonable amount of time ping this issue again.

yimmieg commented 6 years ago

i think it’d be nice if exons and introns are scaled relative to their own length. this is similar to the options available in the python sashimi_plot package.

really appreciate you looking into this. i have a reviewer asking for sashimi_plots for 10 genes for bams aggregated by genotype from > 500 people. many of those genes have > 10 exons. sashimi_plot simply doesn’t scale for this and igv is really my only option.

best,

~jimmie

On Apr 6, 2018, at 10:08 AM, Jim Robinson notifications@github.com wrote:

Hi jimmie, I thought that was you :). Yes, you are correct, I had forgotten that you can't load arbitrary tracks there. One more question -- in this mode should the exons be scaled relative to their own length, or all exons appear the same width?

I've often thought of doing this but no one has asked for it that I recall until now. I'm pretty busy, but if this doesn't happen in a reasonable amount of time ping this issue again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv/issues/530#issuecomment-379316473, or mute the thread https://github.com/notifications/unsubscribe-auth/AEUMf9mDTjhbLaEKCjMx1lPuofYjUUonks5tl6EPgaJpZM4TKI3B.

jrobinso commented 6 years ago

Hi, I plan to add this but this tool might be a better option for what you are doing. I haven't used it at all, and no nothing about it except what's in the readme: https://github.com/guigolab/ggsashimi

jrobinso commented 6 years ago

WRT length scaling, you mention the sashimi_plot package, but I can't find any options for that here: http://miso.readthedocs.io/en/fastmiso/sashimi.html#visualizing-and-plotting-miso-output. Is there some other site that describes scaling options?

One simple option would be to just set a maximum % of total width that the sum of the intron lengths can occupy, then scale them proportionally.

yimmieg commented 6 years ago

here you go:

http://miso.readthedocs.io/en/fastmiso/sashimi.html http://miso.readthedocs.io/en/fastmiso/sashimi.html

here’s the default settings file:

[data]

directory where BAM files are

bam_prefix = ./test-data/bam-data/

directory where MISO output is

miso_prefix = ./test-data/miso-data/

bam_files = [ "heartWT1.sorted.bam", "heartWT2.sorted.bam", "heartKOa.sorted.bam", "heartKOb.sorted.bam"]

miso_files = [ "heartWT1", "heartWT2", "heartKOa", "heartKOb"]

[plotting]

Dimensions of figure to be plotted (in inches)

fig_width = 7 fig_height = 5

Factor to scale down introns and exons by

intron_scale = 30 exon_scale = 4

Whether to use a log scale or not when plotting

logged = False font_size = 6

Max y-axis

ymax = 150

Whether to plot posterior distributions inferred by MISO

show_posteriors = True

Whether to show posterior distributions as bar summaries

bar_posteriors = False

Whether to plot the number of reads in each junction

number_junctions = True

resolution = .5 posterior_bins = 40 gene_posterior_ratio = 5

List of colors for read denisites of each sample

colors = [ "#CC0011", "#CC0011", "#FF8800", "#FF8800"]

Number of mapped reads in each sample

(Used to normalize the read density for RPKM calculation)

coverages = [ 6830944, 14039751, 4449737, 6720151]

Bar color for Bayes factor distribution

plots (--plot-bf-dist)

Paint them blue

bar_color = "b"

Bayes factors thresholds to use for --plot-bf-dist

bf_thresholds = [0, 1, 2, 5, 10, 20]

~j

On May 2, 2018, at 9:12 PM, Jim Robinson notifications@github.com wrote:

WRT length scaling, you mention the sashimi_plot package, but I can't find any options for that here:http://miso.readthedocs.io/en/fastmiso/sashimi.html#visualizing-and-plotting-miso-output http://miso.readthedocs.io/en/fastmiso/sashimi.html#visualizing-and-plotting-miso-output. Is there some other site that describes scaling options?

One simple option would be to just set a maximum % of total width that the sum of the intron lengths can occupy, then scale them proportionally.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/igvteam/igv/issues/530#issuecomment-386187111, or mute the thread https://github.com/notifications/unsubscribe-auth/AEUMfz05wn822G2m56cABFuCNAvobR0Sks5tuoOigaJpZM4TKI3B.