Package: ribotricer
ribotricer: Accurate detection of short and long active ORFs using Ribo-seq dataOnline Paper|PDF|Supplementary File|Benchmarking scriptsInstallationWe highly recommend that you install ribotricer viacondain a clean environment:condacreate-nribotricer_env-cbiocondaribotricer
condaactivateribotricer_env
ribotricer--helpTo install locally, you can either download the source code from release or clone the latest version usinggit clone.
After you get a copy of the source code, please change into the source directory and run:makeinstallNOTE: ribotricer will install the following dependencies (If some of these are already present, they might be replaced by the designated version):pyfaidx>=0.5.0
pysam>=0.11.2.2
numpy>=1.11.0
pandas>=0.20.3
scipy>=0.19.1
matplotlib>=2.1.0
click>=6.0
click-help-colors>=0.3
quicksect>=0.2.0
tqdm>=4.23.4Workflow of ribotricerIn order to run ribotricer, you need to have the following three files
prepared including:genome annotation filein GTF format: our implementation handles
all variations of GTFs besides the often used GENCODE and Ensembl hosted onesreference genome filein FASTA formatalignment filein BAM formatPreparing candidate ORFsThe first step of ribotricer is to take the GTF file and the FASTA file to find all
candidate ORFs. In order to generate all candidate ORFs, please runribotricerprepare-orfs--gtf{GTF}--fasta{FASTA}--prefix{RIBOTRICER_INDEX_PREFIX}The command above by default only includes ORFs with length longer than 60 nts,
and only uses 'ATG' as start codon. You can change the setting by including
options--min_orf_lengthand--start_codons.Output: {PREFIX}_candidate_orfs.tsv.Detecting translating ORFsThe second step of ribotricer is to take the index file generated byprepare-orfsand the BAM file to detect the actively translating ORFs by assessing the periodicity
of all candidate ORFs:ribotricerdetect-orfs\--bam{BAM}\--ribotricer_index{RIBOTRICER_INDEX_PREFIX}_candidate_ORFs.tsv\--prefix{OUTPUT_PREFIX}NOTE: This above command, by default, uses a phase-score cutoff of 0.428. Our species specific recommended cutoffs
are as follows:SpeciesCutoffArabidopsis0.330C. elegans0.239Baker's Yeast0.318Drosophila0.181Human0.440Mouse0.418Rat0.453Zebrafish0.249In order to assignnon-translatingortranslatingstatus, ribotricer by default
uses a cutoff threshold of0.428. ORFs with phase score above0.428are marked as
translating as long as they have at least five codons with non-zero read count.
By default, ribotricer does not take coverage into account for predicting an ORF to be
translating or not-translating. However, this behavior can be changed by following
filters:--min_valid_codons(default=5): Minimum number of codons with non-zero reads for determining active translation--min_valid_codons_ratio(default=0): Minimum ratio of codons with non-zero reads to total codons for determining active translation--min_reads_per_codon(default=0): Minimum number of reads per codon for determining active translation--min_read_density(default=0.0): Minimum read density (total_reads/length) over an ORF total codons for determining active translationFor each of the above filters, an ORF failinganyof the filters is
marked asnon-translating.For example, to ensure that each ORF has at least 3/4 of its codons non-empty,
we can specify--min_valid_codons_ratioto be 0.75:ribotricer detect-orfs \
             --bam {BAM} \
             --ribotricer_index {RIBOTRICER_INDEX_PREFIX}_candidate_ORFs.tsv \
             --prefix {OUTPUT_PREFIX}
             --min_valid_codons_ratio 0.75The ORF detection step consists of several small steps including:Infer the experimental protocol (strandedness of the reads)You can directly assign the strandedness using option--stranded, it can be 'yes',
'no', or 'reverse'. If this option is not provided, ribotricer will automatically infer the
experimental protocol by comparing the strand of reads to the reference.Output: {OUTPUT_PREFIX}_protocol.txtSplit the bam file by strand and read lengthIn this step, all mapped reads will be filtered to include only uniquely mapped reads. Reads
will be split by strand and read length with respect to the strandedness provided or inferred
from the previous step. If you only want to include certain read lengths, they can be assigned with
option--read_lengths.Output: {OUTPUT_PREFIX}_bam_summary.txtPlot read length distributionIn this step, read length distribution will be plotted and serves as quality controlOutput: {OUTPUT_PREFIX}_read_length_dist.pdfCalculate metagene profilesIn this step, the metagene profile of all CDS transcripts for each read length is
calculated by aligning with start codon or stop codon.Output: {OUTPUT_PREFIX}_metagene_profiles_5p.tsv is the metagene profile aligning with the
start codon and {OUTPUT_PREFIX}_metagene_profiles_3p.tsv is the metagene profile aligning with
the stop codonPlot metagene profilesIn this step, metagene plots will be made to serve as quality control.Output: {OUTPUT_PREFIX}_metagene_plots.pdfAlign metagene profilesIf the P-site offsets are not provided, this step will use cross-correlation to find out the relative
offsets between different read lengthsOutput: {OUTPUT_PREFIX}_psite_offsets.txtmerge reads from different read lengths based on P-site offsetsThis step will integrate reads of different read lengths by shifting with the P-site offsetsExport wig fileA WIG file is exported in this step to be used for visualization in Genome BrowserOutput: {OUTPUT_PREFIX}_pos.wig for the positive strand and {OUTPUT_PREFIX}_neg.wig for the negative strand.Export actively translating ORFsThe periodicity of all ORF profiles are assessed and the translating ones are outputed. You can output all ORFs regardless
of the translation status with option--report_allOutput: {OUTPUT_PREFIX}_translating_ORFs.tsvDefinition of ORF typesRibotricer reports eight different ORF types as defined below:annotated: CDS annotated in the provided GTF filesuper_uORF: upstream ORF of the annotated CDS, not overlapping with any CDS of the same gene (first or most upstream uORF)super_dORF: downstream ORF of the annotated CDS, not overlapping with any CDS of the same gene  (last or most downstream dORF)uORF: upstream ORF of the annotated CDS, not overlapping with the main CDSdORF: downstream ORF of the annotated CDS, not overlapping with the main CDSoverlap_uORF: upstream ORF of the annotated CDS, overlapping with the main CDSoverlap_dORF: downstream ORF of the annotated CDS, overlapping with the main CDSnovel: ORF in non-coding genes or in non-coding transcripts of coding genesLearning cutoff empirically from dataRibotricer can also learn cutoff empirically from the data. Given at least one Ribo-seq and one RNA-seq BAM file,ribotricerlearns the cutoff by running one iteration of the algorithm on the provided files with a prespecified
cutoff (--phase_score_cutoff, default: 0.428) and then uses the generated output to find the median difference between Ribo-seq and RNA-seq phase scores of only candidate ORFs withtranscript_typeset toprotein_coding(--filter_by_tx_annotation).ribotricer learn-cutoff --ribo_bams ribo_bam1.bam,ribo_bam2.bam \
--rna_bams rna_1.bam \
--prefix ribo_rna_prefix \
--ribotricer_index {RIBOTRICER_ANNOTATION}Visualizing ribotricer outputRibotricer generates a de-noised profile of read counts for each ORF. We can visualize the read distribution for any ORF. For an example,
seethis notebook.Contacts and bug reportshttps://github.com/smithlabcode/ribotricer/issuesIf you found a bug or mistake in this project, we would like to know about it.
Before you send us the bug report though, please check the following:Are you using the latest version? The bug you found may already have been
fixed.Check that your input is in the correct format and you have selected the
correct options.Please reduce your input to the smallest possible size that still produces
the bug; we will need your input data to reproduce the problem, and the
smaller you can make it, the easier it will be.LICENSERibotricer for detecting actively translating ORFs from Ribo-seq data
Copyright (C) 2022 Saket Choudhary, Wenzheng Li, Andrew D Smith, and
the University of Southern CaliforniaThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program.  If not, seehttp://www.gnu.org/licenses/.