Collection of scripts for computing PSI of junction clusters
Python Shell R
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Junckey is a collection of scripts for the calculation of PSI (Proportion Spliced Index) values of junctions clusters. This pipeline is adpated for using STAR (

1. Format STAR output

This pipeline uses the files generated with STAR. It is necessary to specify to the next code the path to the STAR samples, with each execution in a separated folder. Also, is necesary a gtf annotation of the transcriptome: <path_to_STAR_samples> <gtf_annotation>

This script generates two files, with the samples in the columns and the junctions in the rows:

  • all the unique read counts computed with STAR. Per junction we obtain the overlap with genes and the type of the junction:
    • 1: Fully annotated junction
    • 2: Junction overlapping with known exons, but new connection
    • 3: Alternative donor site
    • 4: Alternative acceptor site
    • 5: Novel junction, neither donor nor acceptor site is annotated
  • normalizated rpkm values from the read counts. For the following steps we will just use the readCounts file

If the processing of lots of samples is needed and a cluster system is available, there is an adapted version for paralelizing jobs. The pipeline is splited into 2 parts:

  • part1: run a job per sample
qsub -b y " <path_to_STAR_samples> <gtf_annotation>"
  • part2: once all the jobs created by part1 have finished, run part2 in order to gather all the data
qsub -b y " <path_to_STAR_samples>"

2. Clustering

For computing the PSI of the junctions, we propose to do it according to the relative inclusion of the nearby junctions. In order to achieve this, we can calculate clusters of our junctions using LeafCutter (

First, we need to split the readCounts file in .junc files (one per sample). The next script will generate this files in the same provided path and the corresponding index file (index_juncfiles.txt):

python <path_to_STAR_samples>/

Now we are ready for running LeafCutter. Here we show an example of execution, but there are several options in the github website for tuning the execution. It's necessary to provide the previous generated index_juncfiles.txt file:

python leafcutter-master/clustering/ -p 0.01 -j <path_to_STAR_samples>/index_juncfiles.txt -o <output_path_LeafCutter>

3. PSI Calculation

The next script calculate the PSI inclusion of each junction in relation to the clusters. It returns a sigle file with all the PSI values together, removing those clusters with NA values

python <output_path_LeafCutter> <path_to_STAR_samples>/