This is the Kids First RNA-Seq pipeline, which calculates gene and transcript isoform expression, detects fusions and splice junctions. We have transitioned to this current version which upgrades several software components. Our legacy workflow is still available as v3.0.1, and on CAVATICA, revision 8
This pipeline has an optional Cutadapt to trim adapters from the raw reads, alignment-to-FASTQ conversion if necessary, and passes the reads to STAR for alignment. The alignment output is used by RSEM for gene expression abundance estimation and rMATS for differential alternative splicing events detection. Additionally, Kallisto is used for quantification, but uses pseudoalignments to estimate the gene abundance from the raw data. Fusion calling is performed using Arriba and STAR-Fusion detection tools on the STAR alignment outputs. Filtering and prioritization of fusion calls is done by annoFuse. Metrics for the workflow are generated by RNA-SeQC. Junction files for the workflow are generated by rMATS.
If you would like to run this workflow using the CAVATICA public app, a basic primer on running public apps can be found here.
Alternatively, if you would like to run it locally using cwltool
, a basic primer on that can be found here and combined with app-specific info from the readme below.
This workflow is the current production workflow, equivalent to this CAVATICA public app.
Cutadapt v3.4 Cut adapter sequences from raw reads if needed.
STAR v2.7.10a RNA-Seq raw data alignment.
RSEM v1.3.1 Calculation of gene expression.
Kallisto v0.43.1 Raw data pseudoalignment to estimate gene abundance.
STAR-Fusion v1.10.1 Fusion detection for STAR
chimeric reads.
Arriba v2.2.1 Fusion caller that uses STAR
aligned reads and chimeric reads output.
annoFuse 0.92.0 Filter and prioritize fusion calls. For more information, please see the following paper.
RNA-SeQC v2.3.4 Generate metrics such as gene and transcript counts, sense/antisense mapping, mapping rates, etc
rMATS turbo v4.1.2 Computational tool to detect differential alternative splicing events from RNA-Seq data
T1k v1.0.5 Genotype highly polymorphic genes (e.g. HLA) with bulk RNA-seq data.
Based on a test set of five input BAMs, CAVATICA compute and storage estimates:
- Typical 2 hour run time, 10 hours is a higher end possibility
- Cost:
- Pure spot instances with no terminations: $2.37 mean
- Pure on-demand: $5.19 mean
- Warning: If spot instance kill rate is high, especially for
c5.9xlarge
instance type, the cost could end up greater than on-demand
- Storage:
- Total output size 6GB mean
- Storage estimate ~ $0.14 per month
Reads can be provided in both aligned/unaligned SAM/BAM/CRAM and FASTQ/FASTQ.GZ. These reads are provided through a series of lists:
input_alignment_reads
input_pe_reads
input_pe_mates
input_se_reads
All SAM/BAM/CRAM files should be provided via the input_alignment_reads
input.
All single end FASTQ files should be provided via the input_se_reads
input.
For paired end FASTQ files:
- Provide the R1 FASTQ files via the
input_pe_reads
input - Provide the R2 FASTQ files via the
input_pe_mates
input - Warning! These lists need to be in the same order! The first file in the
input_pe_reads
list should be the pair of the first file of theinput_pe_mates
list, and so on!
Users are encouraged to provide read group strings that correspond to their reads
files. For input_alignment_reads
inputs, this workflow uses the read groups already
present in the SAM/BAM/CRAM header. The only exception to this is that the sample id
SM
will be updated to whatever sample_name
the user provides the workflow.
Users can also provide some strandedness and paired information:
is_paired_end
: Are the reads paired end?wf_strand_param
: Describe the strandedness of the input data. 'default' for unstranded/auto, 'rf-stranded' if read1 in the FASTQ read pairs is reverse complement to the transcript, 'fr-stranded' if read1 same sense as transcript
If the user does not provide these values, the workflow will attempt to auto-detect the values. Sometimes the software is incapable of making a determination. If the user does not provide the value and the workflow is unable to guess the value, the workflow will fail. Please check the error message to see the cause of the failure and provide the necessary value.
Users should also provide any adapter information to the workflow. This information includes:
r1_adapter
: If the R1 reads still have adapters, supply the adapter sequence herer2_adapter
: If the R2 reads still have adapters, supply the adapter sequence heremin_len
: If trimming adapters, what is the minimum length reads should have post trimmingquality_base
: Phred scale used for quality scores of the readsquality_cutoff
: Quality trim cutoff, see https://cutadapt.readthedocs.io/en/v3.4/guide.html#quality-trimming for how 5' 3' is handled
At this time the workflow only accepts a single input for these options. If you have multiple read groups with unique trimming needs, we recommend pre-trimming the reads before running the workflow.
The workflow is designed to handle multiple read groups; however, not all tools are capable of handling a mix of single and paired end inputs.
When providing one ore more input_alignment_reads
inputs:
samtools_fastq_cores
: Cores for samtools fastq conversioncram_reference
: If input is CRAM, provide the reference FASTA used to build the CRAM
At this time the workflow only accepts a single input for cram_reference
. If
you have multiple CRAMs with different references, we recommend manually
converting them to BAM before running the workflow.
STAR Align has many options available to the user at runtime. For the most part users can leave these fields default. Kids First favors setting/overriding defaults with "arriba-heavy" specified in STAR docs, however if it is not a tumor sample, then GTEx is preferred. Here are all of the available options for STAR:
STARgenome
: TAR gzipped reference that will be unzipped at run timerunThreadN
: Adjust this value to change number of cores used.twopassMode
: Enable two pass mode to detect novel splice events. Default is basic (on).alignSJoverhangMin
: minimum overhang for unannotated junctions. ENCODE default used.outFilterMismatchNoverLmax
: alignment will be output only if its ratio of mismatches to mapped length is less than or equal to this valueoutFilterType
: type of filtering. Normal: standard filtering using only current alignment. BySJout (default): keep only those reads that contain junctions that passed filtering into SJ.out.tab.outFilterScoreMinOverLread
: alignment will be output only if its score is higher than or equal to this value, normalized to read length (sum of mate's lengths for paired-end reads)outFilterMatchNminOverLread
: alignment will be output only if the number of matched bases is higher than or equal to this value., normalized to the read length (sum of mates' lengths for paired-end reads)outReadsUnmapped
: output of unmapped and partially mapped (i.e. mapped only one mate of a paired end read) reads in separate file(s). none (default): no output. Fastx: output in separate FASTA/FASTQ files, Unmapped.out.mate1/2.limitSjdbInsertNsj
: maximum number of junction to be inserted to the genome on the fly at the mapping stage, including those from annotations and those detected in the 1st step of the 2-pass runoutSAMstrandField
: Cufflinks-like strand field flag. None: not used. intronMotif (default): strand derived from the intron motif. This option changes the output alignments: reads with inconsistent and/or non-canonical introns are filtered out.outFilterIntronMotifs
: filter alignment using their motifs. None (default): no filtering. RemoveNoncanonical: filter out alignments that contain non-canonical junctions RemoveNoncanonicalUnannotated: filter out alignments that contain non-canonical unannotated junctions when using annotated splice junctions database. The annotated non-canonical junctions will be kept.alignSoftClipAtReferenceEnds
: allow the soft-clipping of the alignments past the end of the chromosomes. Yes (default): allow. No: prohibit, useful for compatibility with CufflinksquantMode
: types of quantification requested. -: none. TranscriptomeSAM: output SAM/BAM alignments to transcriptome into a separate file GeneCounts: count reads per gene. Choices are additive, so default is 'TranscriptomeSAM GeneCounts'outSAMtype
: type of SAM/BAM output. None: no SAM/BAM output. Otherwise, first word is output type (BAM or SAM), second is sort type (Unsorted or SortedByCoordinate)outSAMunmapped
: output of unmapped reads in the SAM format. None: no output. Within (default): output unmapped reads within the main SAM file (i.e. Aligned.out.sam) Within KeepPairs: record unmapped mate for each alignment, and, in case of unsorted output, keep it adjacent to its mapped mate. Only affects multi-mapping readsgenomeLoad
: mode of shared memory usage for the genome file. In this context, the default value makes the most sense, the others are their as a courtesy.chimMainSegmentMultNmax
: maximum number of multi-alignments for the main chimeric segment. =1 will prohibit multimapping main segmentsoutSAMattributes
: a string of desired SAM attributes, in the order desired for the output SAM. Tags can be listed in any combination/order. Please refer to the STAR manual, as there are numerous combinations: https://raw.githubusercontent.com/alexdobin/star_2.7.10a/master/doc/STARmanual.pdfalignInsertionFlush
: how to flush ambiguous insertion positions. None (default): insertions not flushed. Right: insertions flushed to the right. STAR Fusion recommended (SF)alignIntronMax
: maximum intron size. SF recommends 100000alignMatesGapMax
: maximum genomic distance between mates, SF recommends 100000 to avoid readthru fusions within 100kalignSJDBoverhangMin
: minimum overhang for annotated junctions. SF recommends 10outFilterMismatchNmax
: maximum number of mismatches per pair, large number switches off this filteralignSJstitchMismatchNmax
: maximum number of mismatches for stitching of the splice junctions. Value '5 -1 5 5' improves SF chimeric junctions, also recommended by arriba (AR)alignSplicedMateMapLmin
: minimum mapped length for a read mate that is spliced. SF recommends 30alignSplicedMateMapLminOverLmate
: alignSplicedMateMapLmin normalized to mate length. SF recommends 0, AR 0.5chimJunctionOverhangMin
: minimum overhang for a chimeric junction. SF recommends 8, AR 10chimMultimapNmax
: maximum number of chimeric multi-alignments. SF recommends 20, AR 50.chimMultimapScoreRange
: the score range for multi-mapping chimeras below the best chimeric score. Only works with chimMultimapNmax > 1. SF recommends 3chimNonchimScoreDropMin
: int>=0: to trigger chimeric detection, the drop in the best non-chimeric alignment score with respect to the read length has to be greater than this value. SF recommends 10chimOutJunctionFormat
: formatting type for the Chimeric.out.junction file, value 1 REQUIRED for SFchimOutType
: type of chimeric output. Args are additive, and defined as such - Junctions: Chimeric.out.junction. SeparateSAMold: output old SAM into separate Chimeric.out.sam file WithinBAM: output into main aligned BAM files (Aligned.*.bam). WithinBAM HardClip: hard-clipping in the CIGAR for supplemental chimeric alignments WithinBAM SoftClip:soft-clipping in the CIGAR for supplemental chimeric alignmentschimScoreDropMax
: max drop (difference) of chimeric score (the sum of scores of all chimeric segments) from the read length. AR recommends 30chimScoreJunctionNonGTAG
: penalty for a non-GT/AG chimeric junction. default -1, SF recommends -4, AR -1chimScoreSeparation
: int>=0: minimum difference (separation) between the best chimeric score and the next one. AR recommends 1chimSegmentMin
: minimum length of chimeric segment length, if ==0, no chimeric output. REQUIRED for SF, 12 is their default, AR recommends 10chimSegmentReadGapMax
: maximum gap in the read sequence between chimeric segments. AR recommends 3outFilterMultimapNmax
: max number of multiple alignments allowed for a read: if exceeded, the read is considered unmapped. ENCODE value is default. AR recommends 50peOverlapMMp
: maximum proportion of mismatched bases in the overlap area. SF recommends 0.1peOverlapNbasesMin
: minimum number of overlap bases to trigger mates merging and realignment. Specify >0 value to switch on the 'merging of overlapping mates' algorithm. SF recommends 12, AR recommends 10
These are the defaults set by the workflow:
runThreadN
: 36twopassMode
: "Basic"alignSJoverhangMin
: 8outFilterMismatchNoverLmax
: 0.1outFilterType
: "BySJout"outFilterScoreMinOverLread
: 0.33outFilterMatchNminOverLread
: 0.33outReadsUnmapped
: "None"limitSjdbInsertNsj
: 1200000outSAMstrandField
: "intronMotif"outFilterIntronMotifs
: "None"alignSoftClipAtReferenceEnds
: "Yes"quantMode
: TranscriptomeSAM GeneCountsoutSAMtype
: "BAM Unsorted"outSAMunmapped
: "Within"genomeLoad
: "NoSharedMemory"chimMainSegmentMultNmax
: 1outSAMattributes
: 'NH HI AS nM NM ch RG'alignInsertionFlush
: "None"alignIntronMax
: 1000000alignMatesGapMax
: 1000000alignSJDBoverhangMin
: 1outFilterMismatchNmax
: 999alignSJstitchMismatchNmax
: "5 -1 5 5"alignSplicedMateMapLmin
: 0alignSplicedMateMapLminOverLmate
: 0.5chimJunctionOverhangMin
: 10chimMultimapNmax
: 50chimMultimapScoreRange
: 1chimNonchimScoreDropMin
: 20chimOutJunctionFormat
: 1chimOutType
: "Junctions WithinBAM SoftClip"chimScoreDropMax
: 30chimScoreJunctionNonGTAG
: -1chimScoreSeparation
: 1chimSegmentMin
: 10chimSegmentReadGapMax
: 3outFilterMultimapNmax
: 50peOverlapMMp
: 0.01peOverlapNbasesMin
: 10
arriba_memory
: Mem intensive tool. Set in GB
FusionGenome
: STAR-Fusion Cancer Transcriptome Analysis Toolkit (CTAT) Genome libcompress_chimeric_junction
: If part of a workflow, recommend compressing this file as final output
RNAseQC_GTF
: GTF file fromgtf_anno
that has been collapsed GTEx-style
kallisto_idx
: Specialized index of a transcriptome FASTA file for kallisto
RSEMgenome
: RSEM reference tar ballestimate_rspd
: Set this option if you want to estimate the read start position distribution (RSPD) from data
sample_name
: Sample ID of the input reads. If not provided, will use reads1 file basename.annofuse_col_num
: 0-based column number in file of fusion name.fusion_annotator_ref
: Tar ball with fusion_annot_lib.idx and blast_pairs.idx from STAR-Fusion CTAT Genome lib. Can be same as FusionGenome, but only two files needed from that package
rmats_variable_read_length
: Allow reads with lengths that differ from --readLength to be processed. --readLength will still be used to determine IncFormLen and SkipFormLen.rmats_novel_splice_sites
: Select for novel splice site detection or unannotated splice sites. 'true' to detect or add this parameter, 'false' to disable denovo detection. Tool Default: falsermats_stat_off
: Select to skip statistical analysis, either between two groups or on single sample group. 'true' to add this parameter. Tool default: falsermats_allow_clipping
: Allow alignments with soft or hard clipping to be used.rmats_threads
: Threads to allocate to RMATs.rmats_ram
: GB of RAM to allocate to RMATs.
run_t1k
: Set to false to disable T1k HLA typinghla_rna_ref_seqs
: FASTA file containing the HLA allele reference sequences for RNA.hla_rna_gene_coords
: FASTA file containing the coordinates of the HLA genes for RNA.
- Reads inputs:
- For PE FASTQ input, please enter the reads 1 file in
reads1
and the reads 2 file inreads2
. - For SE FASTQ input, enter the single ends reads file in
reads1
and leavereads2
empty as it is optional. - For alignment input (SAM/BAM/CRAM), please enter the reads file in
reads1
and leavereads2
empty as it is optional.
- For PE FASTQ input, please enter the reads 1 file in
r1_adapter
andr2_adapter
are OPTIONAL:- If the input reads have already been trimmed, leave these as null and cutadapt step will simple pass on the FASTQ files to STAR.
- If they do need trimming, supply the adapters and the cutadapt step will trim, and pass trimmed FASTQs along.
min_len
if adapter is trimmed, currently set to min20
bp. Change this as you see fitquality_base
set to Phred scale33
by default if trimming. There was a weird time when64
was used - change if differentquality_cutoff
if adapter is trimmed and you want to set a min bp quality. A single value will apply to both paired ends, 2 values will allow you to assign a different one to each (unusual)
wf_strand_param
is now optional as the workflow will try to determine strandedness for you. Note: if the workflow fails to detect a strandedness, it will fail. If you would like to override autodetect, it is a workflow convenience param so that, if you input the following, the equivalent will propagate to the four tools that use that parameter:default
: 'rsem_std': null, 'kallisto_std': null, 'rnaseqc_std': null, 'arriba_std': null. This means unstranded or auto in the case of arriba.rf-stranded
: 'rsem_std': 0, 'kallisto_std': 'rf-stranded', 'rnaseqc_std': 'rf', 'arriba_std': 'reverse'. This means if read1 in the input FASTQ/BAM is reverse complement to the transcript that it maps to.fr-stranded
: 'rsem_std': 1, 'kallisto_std': 'fr-stranded', 'rnaseqc_std': 'fr', 'arriba_std': 'yes'. This means if read1 in the input FASTQ/BAM is the same sense (maps 5' to 3') to the transcript that it maps to.
- Suggested STAR
outSAMattrRGline
format isID:sample_name LB:aliquot_id PL:platform SM:BSID
:- For example,
ID:7316-242 LB:750189 PL:ILLUMINA SM:BS_W72364MN
- These
KEY:VALUE
fields can be separated by either a whitespace or tab character. Any unquoted whitespace will be automatically converted to a tab value by STAR. If you wish to include whitespaces in yourVALUE
, you must put double quotes around theVALUE
. For example if you wanted aDS
key with aI love read groups
value, the entry would look like:ID:xxx DS:"I love read groups"
. See the STAR documentation onoutSAMattrRGline
for complete details.
- For example,
- Suggested REFERENCE inputs are:
reference_fasta
: GRCh38.primary_assembly.genome.fa, will need to unzipgtf_anno
: gencode.v39.primary_assembly.annotation.gtf, will need to unzipFusionGenome
: GRCh38_v39_CTAT_lib_Mar242022.CUSTOM.tar.gz. A custom library built using instructions from (https://github.com/STAR-Fusion/STAR-Fusion/wiki/installing-star-fusion#preparing-the-genome-resource-lib), using GENCODE 39 reference.RNAseQC_GTF
: gencode.v39.primary_assembly.rnaseqc.stranded.gtf OR gencode.v39.primary_assembly.rnaseqc.unstranded.gtf, built usinggtf_anno
and following build instructions here and hereRSEMgenome
: RSEM_GENCODE39.tar.gz, built using thereference_fasta
andgtf_anno
, followingGENCODE
instructions from here, then creating a tar ball of the results.STARgenome
: STAR_2.7.10a_GENCODE39.tar.gz, created using the star_2.7.10a_genome_generate.cwl tool, using thereference_fasta
,gtf_anno
, and settingsjdbOverhang
to 100kallisto_idx
: RSEM_GENCODE39.transcripts.kallisto.idx, built from RSEM GENCODE 39 transcript fasts, inRSEMgenome
tar ball, following instructions from herehla_rna_ref_seqs
: hla_v3.43.0_gencode_v39_rna_seq.fa, created using https://github.com/mourisl/T1K/blob/master/t1k-build.pl with hla.dat v3.43.0 and GENCODE v39 primary assembly GTFhla_rna_gene_coords
: hla_v3.43.0_gencode_v39_rna_coord.fa, created using https://github.com/mourisl/T1K/blob/master/t1k-build.pl with hla.dat v3.43.0 and GENCODE v39 primary assembly GTF
- rMATS requires the length of the reads in the sample. This workflow will attempt to estimate the read length based on a polling of reads. If the user wishes to override this value they can set
read_length_median
to their desired read length. Additionally, there is armats_variable_read_length
boolean that users can set if their reads are not uniform in length. This workflow will poll the reads and set that value to true if it observes multiple read lengths. Like read length, user-provided input will override this guess. - While
output_basename
,sample_name
, and the*rg_str
inputs are optional, it is strongly recommended that the user provide these values for data quality purposes. If the user does not provide these values, the basename of the reads1 file will be substituted in their place.output_basename
andsample_name
values will becomereads1.basename.split('.')[0]
- The STAR align
outSAMattrRGline
value will become:- For aligned reads inputs, we will use the RG line set in the BAM header (the
SM
value will be set to what we described above - For FASTQ inputs,
ID:reads1.basename.split('.')[0]_1 LB:reads1.basename.split('.')[0] SM:reads1.basename.split('.')[0] PL:Illumina
- For aligned reads inputs, we will use the RG line set in the BAM header (the
- Additionally for FASTQ inputs, if no
outSAMattrRGline
input is provided a disclaimer will be added to the@RG
header line that reads:DS:Values for this read group were auto-generated and may not reflect the true read group information.
cutadapt_stats
: Cutadapt stats output, only if adapter is supplied.STAR_sorted_genomic_cram
: STAR sorted and indexed genomic alignment CRAMSTAR_chimeric_junctions
: STAR chimeric junctionsSTAR_gene_count
: STAR genecountsSTAR_junctions_out
: STARjunction readsSTAR_final_log
: STAR metricslog file of unique, multi-mapping, unmapped, and chimeric readsSTAR-Fusion_results
: STAR fusion detection from chimeric readsarriba_fusion_results
: Fusion output from Arribaarriba_fusion_viz
: pdf output from ArribaRSEM_isoform
: RSEM isoform expression estimatesRSEM_gene
: RSEM gene expression estimatesRNASeQC_Metrics
: Metrics on mapping, intronic, exonic rates, count information, etcRNASeQC_counts
: Contains gene tpm, gene read, and exon countskallisto_Abundance
: Gene abundance output from STAR genomic BAM fileannofuse_filtered_fusions_tsv
: Filtered fusions called by annoFuse.rmats_filtered_alternative_3_prime_splice_sites_jc
: Alternative 3 prime splice sites JC.txt output from RMATs containing only those calls with 10 or more junction spanning read counts of supportrmats_filtered_alternative_5_prime_splice_sites_jc
: Alternative 5 prime splice sites JC.txt output from RMATs containing only those calls with 10 or more junction spanning read counts of supportrmats_filtered_mutually_exclusive_exons_jc
: Mutually exclusive exons JC.txt output from RMATs containing only those calls with 10 or more junction spanning read counts of supportrmats_filtered_retained_introns_jc
: Retained introns JC.txt output from RMATs containing only those calls with 10 or more junction spanning read counts of supportrmats_filtered_skipped_exons_jc
: Skipped exons JC.txt output from RMATs containing only those calls with 10 or more junction spanning read counts of supportt1k_genotype_tsv
: Genotyping results from T1k
- STAR-Fusion reference built with command
/usr/local/STAR-Fusion/ctat-genome-lib-builder/prep_genome_lib.pl --gtf gencode.v39.primary_assembly.annotation.gtf --annot_filter_rule ../AnnotFilterRule.pm --CPU 36 --fusion_annot_lib ../fusion_lib.Mar2021.dat.gz --genome_fa ../GRCh38.primary_assembly.genome.fa --output_dir GRCh38_v39_CTAT_lib_Mar242022.CUSTOM --human_gencode_filter --pfam_db current --dfam_db human 2> build.errs > build.out &
- fusion_annotator_ref built by placing GRCh38_v39_CTAT_lib_Mar242022.CUSTOM/fusion_annot_lib.idx and GRCh38_v39_CTAT_lib_Mar242022.CUSTOM/blast_pairs.idx into its own tar ball
- kallisto index built using RSEM
RSEM_GENCODE39.transcripts.fa
file as transcriptome FASTA, using command:kallisto index -i RSEM_GENCODE39.transcripts.kallisto.idx RSEM_GENCODE39.transcripts.fa
- RNA-SEQc reference built using collapse GTF script
- Two references needed if data are stranded vs. unstranded
- Flag
--collapse_only
used for stranded
This is an alternative alignment and quantification method currently in beta phase. It uses DNA variant calls from a patient to create a "personal genome" for improved alignment. See doc linked in section header.