Skip to content

scShiba usage

After installing with Conda, activate the environment and run:

1
scshiba.py -p 4 config.yaml

For source execution and the SHIBA_HOME used by internal-script examples, see Locating scripts and workflows. The step scripts below are internal tools, not separate commands on PATH.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
usage: scshiba.py [-h] [-p PROCESS] [-s START_STEP] [-v] config

scShiba - Pipeline for identification of differential RNA splicing in single-cell RNA-seq data

Step 1: gtf2event.py
    - Converts GTF files to event format.
Step 2: sc2junc.py
    - Counts junction and RI boundary reads from BAM/CRAM files with Tosa.
Step 3: scpsi.py
    - Calculates PSI values and performs differential analysis.
Step 4: plots.py
    - Generates an interactive summary.html report.

positional arguments:
  config                Config file in yaml format

options:
  -h, --help            show this help message and exit
  -p PROCESS, --process PROCESS
                        Number of processors to use (default: 1)
  -s START_STEP, --start-step START_STEP
                        Start the pipeline from the specified step (default: 0, run all steps)
  -v, --verbose         Verbose mode

Please check the Quick start to learn how to prepare the config.yaml.

The above command will run the following steps:

  1. gtf2event.py
  2. sc2junc.py
  3. scpsi.py
  4. plots.py

Step1: gtf2event.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
usage: gtf2event.py [-h] -i GTF [-r REFERENCE_GTF] -o OUTPUT [-p NUM_PROCESS] [-v]

Extract alternative splicing events from GTF file

optional arguments:
  -h, --help            show this help message and exit
  -i GTF, --gtf GTF     Input GTF file
  -r REFERENCE_GTF, --reference-gtf REFERENCE_GTF
                        Reference GTF file
  -o OUTPUT, --output OUTPUT
                        Output directory
  -p NUM_PROCESS, --num-process NUM_PROCESS
                        Number of processors to use
  -v, --verbose         Verbose output

Example of EVENT_SE.txt:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
event_id  pos_id  exon  intron_a  intron_b  intron_c  strand  gene_id  gene_name  label
SE_1  SE@GL456354.1@84521-85111@83560-85765  GL456354.1:84521-85111  GL456354.1:83560-84521  GL456354.1:85111-85765  GL456354.1:83560-85765  -  ENSMUSG00000094337  Gm3286  annotated
SE_2  SE@chr10@100080857-100080940@100080130-100087347  chr10:100080857-100080940  chr10:100080130-100080857  chr10:100080940-100087347  chr10:100080130-100087347  +  ENSMUSG00000019966  Kitl  annotated
SE_3  SE@chr10@100485051-100485125@100478022-100487162  chr10:100485051-100485125  chr10:100478022-100485051  chr10:100485125-100487162  chr10:100478022-100487162  -  ENSMUSG00000036676  Tmtc3  annotated
SE_4  SE@chr10@100485051-100485185@100478022-100487162  chr10:100485051-100485185  chr10:100478022-100485051  chr10:100485185-100487162  chr10:100478022-100487162  -  ENSMUSG00000036676  Tmtc3  annotated
SE_5  SE@chr10@100495641-100495661@100494954-100495823  chr10:100495641-100495661  chr10:100494954-100495641  chr10:100495661-100495823  chr10:100494954-100495823  +  ENSMUSG00000019971  Cep290  annotated
SE_6  SE@chr10@100578315-100578431@100577358-100583914  chr10:100578315-100578431  chr10:100577358-100578315  chr10:100578431-100583914  chr10:100577358-100583914  -  ENSMUSG00000046567  4930430F08Rik  annotated
SE_7  SE@chr10@100582263-100582322@100578431-100583914  chr10:100582263-100582322  chr10:100578431-100582263  chr10:100582322-100583914  chr10:100578431-100583914  -  ENSMUSG00000046567  4930430F08Rik  annotated
SE_8  SE@chr10@100594537-100594656@100592429-100595035  chr10:100594537-100594656  chr10:100592429-100594537  chr10:100594656-100595035  chr10:100592429-100595035  +  ENSMUSG00000056912  1700017N19Rik  annotated
SE_9  SE@chr10@100610596-100610715@100609254-100612429  chr10:100610596-100610715  chr10:100609254-100610596  chr10:100610715-100612429  chr10:100609254-100612429  +  ENSMUSG00000056912  1700017N19Rik  annotated
...

Step2: sc2junc.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
usage: sc2junc.py [-h] -i INPUT -r RI_EVENT -o OUTPUT -g GTF [-p PROCESSORS] [-a ANCHOR] [-b BOUNDARY_ANCHOR] [-m MIN_INTRON] [-M MAX_INTRON] [-s STRAND] [-v]

Count single-cell junction and RI boundary reads from tagged BAM/CRAM files with Tosa.

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        sample/alignment/barcode experiment table
  -r RI_EVENT, --ri-event RI_EVENT
                        EVENT_RI.txt
  -o OUTPUT, --output OUTPUT
                        Shiba junctions.bed
  -g GTF, --gtf GTF     GTF used to generate events
  -p PROCESSORS, --processors PROCESSORS
  -a ANCHOR, --anchor ANCHOR
  -b BOUNDARY_ANCHOR, --boundary-anchor BOUNDARY_ANCHOR
                        Bases required on each side of an RI boundary (default: 6)
  -m MIN_INTRON, --min-intron MIN_INTRON
  -M MAX_INTRON, --max-intron MAX_INTRON
  -s STRAND, --strand STRAND
                        XS, RF, FR, or unstranded
  -v, --verbose         Verbose mode

Step3: scpsi.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
usage: scpsi.py [-h] [-p NUM_PROCESS] [-f FDR] [-d PSI] [-r REFERENCE] [-a ALTERNATIVE] [-m MINIMUM_READS] [--onlypsi] [--excel] [-v] junctions event output

PSI calculation for alternative splicing events in scRNA-seq data

positional arguments:
  junctions             A bed file of junction and RI boundary counts generated by sc2junc.py
  event                 Directory that contains text files of alternative splicing events generated by gtf2event.py
  output                Directory for output files

optional arguments:
  -h, --help            show this help message and exit
  -p NUM_PROCESS, --num-process NUM_PROCESS
                        Number of processors to use (default: 1)
  -f FDR, --fdr FDR     FDR for detecting differential events (default: 0.05)
  -d PSI, --psi PSI     Threshold of delta PSI for detecting differential events (default: 0.1)
  -r REFERENCE, --reference REFERENCE
                        Reference group for detecting differential events (default: None)
  -a ALTERNATIVE, --alternative ALTERNATIVE
                        Alternative group for detecting differential events (default: None)
  -m MINIMUM_READS, --minimum-reads MINIMUM_READS
                        Minumum value of total reads for each junction for detecting differential events (default: 10)
  --onlypsi             Just calculate PSI for each sample, not perform statistical tests (default: False)
  --excel               Make result files in excel format (default: False)
  -v, --verbose         Verbose output (default: False)

Interactive summary report

The workflow automatically creates plots/summary.html in the work directory. This self-contained HTML uses the same interactive style as Shiba: enlarged text, muted colors, hover labels, zoom/pan, legend toggling, and Arial with browser-default font fallback. It includes the analysis command, differential-event counts, and volcano and PSI scatter plots for all eight event types, including RI. PNG, PDF, and SVG exports are saved alongside the report.

Single-cell PSI values are aggregated by cell group. This report does not add biological replication or change the Fisher tests. Bulk TPM/PSI PCA panels are not included. With only_psi: True, the report instead shows up to 200 rows per event type and explicitly states that no differential testing was performed.

To regenerate the report from existing results:

1
python "$SHIBA_HOME/src/plots.py" --single-cell -i /path/to/workdir/results -o /path/to/workdir/plots

Add --only-psi for PSI-only results. The command is retrieved from the saved report.json; use -s 'original analysis command' to supply it explicitly.