SKILL.md
Version Compatibility
Reference examples tested with: ggplot2 3.5+, pandas 2.2+
Before using code patterns, verify installed versions match. If versions differ:
- Python:
pip show <package>thenhelp(module.function)to check signatures - CLI:
<tool> --versionthen<tool> --helpto confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Sashimi Plot Visualization
Create sashimi plots to visualize splicing events with read coverage and junction counts.
ggsashimi Usage
Goal: Generate sashimi plots showing read coverage and junction counts for a genomic region.
Approach: Define sample groupings in a TSV file, then run ggsashimi with genomic coordinates and annotation.
"Visualize a splicing event" -> Plot RNA-seq coverage tracks with splice junction arcs grouped by condition.
- Python/CLI:
ggsashimi.py(ggsashimi) - CLI:
rmats2sashimiplot(rMATS-specific)
import subprocess
import pandas as pd
# Create sample grouping file (TSV: path, group, color)
groups = pd.DataFrame({
'bam': ['sample1.bam', 'sample2.bam', 'sample3.bam', 'sample4.bam'],
'group': ['control', 'control', 'treatment', 'treatment'],
'color': ['#1f77b4', '#1f77b4', '#ff7f0e', '#ff7f0e']
})
groups.to_csv('sashimi_groups.tsv', sep='\t', index=False, header=False)
# Basic sashimi plot for a region
subprocess.run([
'ggsashimi.py',
'-b', 'sashimi_groups.tsv',
'-c', 'chr1:1000000-1010000', # Genomic coordinates
'-o', 'sashimi_output',
'-M', '10', # Minimum junction reads to show
'--alpha', '0.25', # Coverage transparency
'--height', '3',
'--width', '8',
'-g', 'annotation.gtf'
], check=True)
Batch Plotting Significant Events
Goal: Automatically generate sashimi plots for all significant differential splicing events.
