Skip to content

2.1. Manual: running JUM (v2.0)

Qingqing Wang edited this page Aug 22, 2018 · 1 revision

Running JUM

  1. Under your working folder (/user/home/AS_analysis), you should have the following input files ready for JUM analysis ("*" indicates ctrl1, ctrl2, ctrl3, treat1, treat2 and treat3):
    • *Aligned.out.sam files
    • *SJ.out.tab files
    • *Aligned.out_sorted.bam files

Let us also assume that you have downloaded the JUM software package version 2.0 under your home directory and unzipped, so all the scripts are now in /user/home/JUM_2.0).

  1. Run JUM_2-1.sh:

    $ bash /user/home/JUM_2.0/JUM_2-1.sh
  2. Create subdirectories for each condition. For example, control and treatment:

    $ mkdir control
    $ mkdir treatment
  3. Copy files with suffix SJ.out.tab_strand_symbol_scaled from the current directory to the corresponding condition subdirectories, respectively:

    $ cp ctrl1SJ.out.tab_strand_symbol_scaled control/
    $ cp ctrl2SJ.out.tab_strand_symbol_scaled control/
    $ cp ctrl3SJ.out.tab_strand_symbol_scaled control/
    $ cp treat1SJ.out.tab_strand_symbol_scaled treatment/
    $ cp treat2SJ.out.tab_strand_symbol_scaled treatment/
    $ cp treat3SJ.out.tab_strand_symbol_scaled treatment/
  4. Copy the file UNION_junc_coor_with_junction_ID.txt to each of the condition subdirectories:

    $ cp UNION_junc_coor_with_junction_ID.txt control/
    $ cp UNION_junc_coor_with_junction_ID.txt treatment/
  5. In each of the subdirectories, run JUM-2-2.sh as follows and then return to the current/main directory:

    $ bash /user/home/JUM_2.0/JUM_2-2.sh --Folder "directory" --Threshold "junction_read_threshold" --Filenum "file_number" --Condition "condition"
    #--Folder: path of the downloaded JUM package
    #--Threshold - for junction filtering: JUM will filter for splice junctions that have more than this # of unique reads mapped to it in at least #file_number samples out of all replicates under the condition as valid junctions for downstream analysis
    #--Filenum - for junction filtering: JUM will filter for splice junctions that have more than #read_threshold of unique reads mapped to it in at least this # samples out of all replicates under the condition as valid junctions for downstream analysis
    #--Condition: the name of the condition, for example, control

    for example:

    $ cd control
    $ bash /user/home/JUM_2.0/JUM_2-2.sh --Folder /user/home/JUM_2.0 --Threshold 5 --Filenum 2 --Condition control
    $ cd ..
    $ cd treatment
    $ bash /user/home/JUM_2.0/JUM_2-2.sh --Folder /user/home/JUM_2.0 --Threshold 5 --Filenum 2 --Condition treatment
    $ cd ..

    NOTES

    For #--Threshold and #--Filenum, users need to choose based on the RNA-seq sequencing depth and number of replicates they have for each condition. Below are a few examples and general rule of thumb:

    • If users have 3 replicates that are relatively deeply sequenced (~30M+ for drosophila and ~50M+ for human samples, for example), it is reasonable to filter for junctions that have more than 5 (or 10) reads in 2 replicates of one condition, or all 3 replicates of one condition.
    • If users only have two replicates, it is reasonable to filter for junctions that have more than 5 (or 10) reads in both replicates of one condition.
    • If users have 4 or even more replicates, it is reasonable to filter for junctions that have more than 5 (or 10) reads in at least (total # replicates - 1) samples of one condition.
    • users can choose different #--Filenum for each condition, depends on how many replicates each condition has.
  6. Copy the files with suffix junction_counts.txt and formatted.txt from each of the condition subdirectories to the main/parent directory:

    $ cp control/*junction_counts.txt .
    $ cp treatment/*junction_counts.txt .
    $ cp control/*formatted.txt .
    $ cp treatment/*formatted.txt .
  7. Run JUM_2-3.sh under the main directory:

    $ bash /user/home/JUM_2.0/JUM_2-3.sh --Folder "directory" --Threshold "junction_read_threshold" --Filenum "file_number" --IRthreshold "IR_read_threshold" --Readlength "read_length" --Thread "thread_num"
      #--Folder: path of the downloaded JUM package.
      #--Threshold: as in step 5
      #--Filenum: as in step 5.  In the situation when this parameter is different for different conditions, choose the bigger number
      #--IRthreshold - IR filter: JUM will filter for IR events that have more than this # of unique reads mapped to the upstream exon-intron and downstream intron-exon boundaries in as potential true IR events
      #--Readlength: the length of the RNA-seq reads
      #--Thread: number of threads for multi-threading processing of sam/bam files

    for example:

    bash /user/home/JUM_2.0/JUM_2-3.sh --Folder /user/home/JUM_2.0 --Threshold 5 --Filenum 2 --IRthreshold 5 --Readlength 100 --Thread 3

    NOTES

    • Step 7 will generate a new folder called JUM_diff/ in the main directory with the results.
  8. Enter the JUM_diff/ folder and run the R script with a user-provided experiment design file (txt format; a template is provided in the package) for differential AS analysis.

    $ cd JUM_diff/
    $ Rscript /user/home/JUM_2.0/R_script_JUM.R experiment_design.txt > outputFile.Rout 2> errorFile.Rout

    An example experiment_design.txt file is shown below:

          Condition
    ctrl1 control
    ctrl2 control
    ctrl3 control
    treat1 treatment
    treat2 treatment
    treat3 treatment

    NOTES

    • It is important to make sure that in the experiment_design.txt file the sample naming and condition naming are in the same alphabetic order. For example, here control samples (ctrl1,2,3) all start with "c" so they are alphabatically before the treatment samples (treat1,2,3) that all start with "t"; accordingly, the condition name "control" for control samples is also alphabatically before the condition name "treatment" for treatment samples.
    • R_script_JUM.R will output a file called AS_differential.txt. Make sure that Step 8 successfully generates a new file called AS_differential.txt in the JUM_diff/ folder. Otherwise you can refer to the file errorFile.Rout for troubleshooting.
  9. Now run JUM_3.sh in the JUM_diff/ folder as follows:

    $ bash /user/home/JUM_2.0/JUM_3.sh --Folder "directory" --Test "pvalue|adjusted_pvalue" --Cutoff "stat_threshold" --Totalnum "#samples" --Smallnum "#control|treated_samples"
      #--Folder: path of the downloaded JUM package
      #--Test - choice of statistical measure for significance test: type "pvalue" or "adjusted_pvalue"
      #--Cutoff: a number, threshold for statistical cutoff
      #--Totalnum: the number of total samples from all conditions
      #--Smallnum: the number of control samples or the number of treated samples, whichever is smaller

    for example:

    $ bash /user/home/JUM_2.0/JUM_3.sh --Folder /user/home/JUM_2.0 --Test pvalue --Cutoff 0.05 --Totalnum 6 --Smallnum 3

    NOTES

    • We recommend the users run one round using pvalue 0.05 at this step. This is the most generous statistical setting to profile for significantly differentially spliced AS events and it will be handy to keep a version of this result around, especially when users are still experimenting with the optimal statistical cutoff. In this case, when in need of more strict statistical cutoffs, users can easily filter the pvalue 0.05 analysis results using simple commands of linux that searches for AS events satisfying more strict cutoffs, instead of running step 9 again.
    • JUM_3.sh will generate a new folder called FINAL_JUM_OUTPUT_$Test_$Cutoff that contains all the results.
  10. Run JUM_4.sh in the folder FINAL_JUM_OUTPUT_$Test_$Cutoff as follows:

    $ cd FINAL_JUM_OUTPUT
    $ bash /user/home/JUM_2.0/JUM_4.sh --Folder "directory" --Test "pvalue|adjusted_pvalue" --Cutoff "stat_threshold" --condition1num "sample_#_condition_1" --condition2num "sample_#_condition_2" --REF "refFlat"
      #--Folder
      #--Test: as in step 9
      #--Cutoff: as in step 9
      #--condition1num: the number of samples for condition 1 that is alphabetically listed first in the `experiment_design.txt` file
      #--condition2num: the number of samples for condition 2 that is alphabetically listed second in the `experiment_design.txt` file
      #--REF: a `refFlat.txt` file (a type of transcriptome annotation file, also called genePred format).  

    For example:

    bash /user/home/JUM_2.0/JUM_4.sh --Folder /user/home/JUM_2.0 --Test pvalue --Cutoff 0.05 --condition1num 3 --condition2num 3 --REF refFlat.txt

    JUM_4.sh will output files with the suffix: *_final_simplified.txt and *_final_detailed.txt. These are the final output files from JUM.

    NOTES

    • The --REF refFlat.txt file should be available from UCSC genome browser for different organisms and users can download it to the current working directory. If users only have other formats of annotation such as gff3 and gff files, users can easily convert these into the genePred format by binary scripts such as the gff3ToGenePred converter from the UCSC genome browser website: http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/. Note, JUM does NOT depend on any priori knowledge of annotation to perform AS analysis. This file here is for associating the final differential AS results from JUM to known genes for the convenience of users. If an AS event is not mapped to any known gene, it will be marked as "NONE" in the associated gene track.