$npx -y skills add GPTomics/bioSkills --skill sashimi-plotsCreates sashimi-style plots showing RNA-seq read coverage and splice junction counts using ggsashimi (general-purpose, condition-grouped overlays), rmats2sashimiplot (rMATS-output-aware), MAJIQ-VOILA (LSV posteriors interactive HTML), leafviz (leafcutter clusters Shiny), Jutils (
| 1 | ## Version Compatibility |
| 2 | |
| 3 | Reference examples tested with: ggsashimi 1.1+, rmats2sashimiplot 3.0+, MAJIQ 3.0+, leafcutter 0.2.9+, pyGenomeTracks 3.8+, ggplot2 3.5+, pandas 2.2+ |
| 4 | |
| 5 | Before using code patterns, verify installed versions match. If versions differ: |
| 6 | - Python: `pip show <package>` then `help(module.function)` to check signatures |
| 7 | - CLI: `<tool> --version` then `<tool> --help` to confirm flags |
| 8 | |
| 9 | If code throws ImportError, AttributeError, or TypeError, introspect the installed |
| 10 | package and adapt the example to match the actual API rather than retrying. |
| 11 | |
| 12 | # Sashimi Plot Visualization |
| 13 | |
| 14 | Visualize RNA-seq coverage tracks with splice junction arcs labeled by read count. Sashimi plots originated with MISO (Katz 2010 *Nat Methods*); modern tools differ in input handling, group aggregation logic, and customization. Tool choice is not interchangeable — some tools work only with specific upstream output formats. |
| 15 | |
| 16 | ## Tool Selection Matrix |
| 17 | |
| 18 | | Tool | Best for | Input | Strengths | Fails when | |
| 19 | |------|----------|-------|-----------|------------| |
| 20 | | ggsashimi | Publication-quality grouped overlays from any BAM | BAMs + region | `--overlay` aggregates samples within a group; clean PDFs | No native rMATS/MAJIQ integration; need to extract coords manually | |
| 21 | | rmats2sashimiplot | One-line plot from rMATS output | rMATS event file + BAMs | No manual coord extraction | rMATS-specific; doesn't handle leafcutter or MAJIQ | |
| 22 | | MAJIQ-VOILA | Interactive LSV browsing with posterior PSI distributions | MAJIQ build + psi/deltapsi | Splice-graph topology; LSV-aware; posterior violins | Static figures; non-academic license | |
| 23 | | leafviz | Cluster-level interactive browsing with NMD annotation | leafcutter differential output | Filter table + sashimi-like plots; NMD-aware | leafcutter-specific | |
| 24 | | Jutils | Unified output across rMATS, leafcutter, MntJULiP, MAJIQ | Tool-specific differential output | Heatmaps, Venn, sashimi tool-agnostically | Output less polished than ggsashimi | |
| 25 | | pyGenomeTracks | Multi-track publication figures (RNA-seq + ChIP/ATAC) | BigWig + BED + GTF | Combine RNA with chromatin tracks | Not splicing-specific; configure tracks manually | |
| 26 | | IGV (interactive) | Quick ad-hoc inspection | BAM + region | Scrollable, instant | Not for publication figures | |
| 27 | | MISO sashimi | Historical | MISO output | Original sashimi format | MISO unmaintained; no longer recommended | |
| 28 | |
| 29 | ## Decision Tree by Goal |
| 30 | |
| 31 | | Goal | Recommended tool | |
| 32 | |------|-------------------| |
| 33 | | Validate a specific rMATS hit | rmats2sashimiplot (one-line) or ggsashimi (custom) | |
| 34 | | Validate a leafcutter cluster | leafviz (interactive) or ggsashimi with cluster coordinates | |
| 35 | | Validate a MAJIQ LSV (complex topology) | MAJIQ-VOILA (only tool that shows full LSV graph) | |
| 36 | | Publication-quality two-condition comparison | ggsashimi `-O 3 -A mean_j` for grouped overlay | |
| 37 | | Multi-track figure (RNA-seq + H3K4me3 + ATAC) | pyGenomeTracks | |
| 38 | | Quick ad-hoc browsing during development | IGV sashimi | |
| 39 | | Tool-agnostic batch heatmap of significant events | Jutils | |
| 40 | | Interactive cohort-level filtering of leafcutter results | leafviz Shiny | |
| 41 | |
| 42 | ## ggsashimi for Publication Overlays |
| 43 | |
| 44 | **Goal:** Generate publication-quality sashimi plot for a region with samples grouped by condition and per-sample tracks aggregated. |
| 45 | |
| 46 | **Approach:** Define samples + groups + colors in a TSV (no header), then call ggsashimi with coordinates, GTF, and visual flags. |
| 47 | |
| 48 | ```python |
| 49 | import subprocess |
| 50 | import pandas as pd |
| 51 | |
| 52 | # ggsashimi input: col1 = sample id, col2 = BAM path, col3 = group (for -O/-C overlay/color) |
| 53 | groups = pd.DataFrame({ |
| 54 | 'sample_id': ['ctrl1', 'ctrl2', 'ctrl3', 'trt1', 'trt2', 'trt3'], |
| 55 | 'bam': ['ctrl1.bam', 'ctrl2.bam', 'ctrl3.bam', 'trt1.bam', 'trt2.bam', 'trt3.bam'], |
| 56 | 'group': ['Control', 'Control', 'Control', 'Treatment', 'Treatment', 'Treatment'] |
| 57 | }) |
| 58 | groups.to_csv('sashimi_groups.tsv', sep='\t', index=False, header=False) |
| 59 | |
| 60 | subprocess.run([ |
| 61 | 'ggsashimi.py', |
| 62 | '-b', 'sashimi_groups.tsv', |
| 63 | '-c', 'chr17:43094000-43125000', |
| 64 | '-o', 'BRCA1_sashimi', |
| 65 | '-M', '10', |
| 66 | '--alpha', '0.25', |
| 67 | '--height', '3', |
| 68 | '--width', '10', |
| 69 | '--shrink', |
| 70 | '--fix-y-scale', |
| 71 | '--ann-height', '4', |
| 72 | '-g', 'gencode_v45.gtf', |
| 73 | '--base-size', '14', |