4.5.1 Check
Function
rpf_Check inspects transcriptome-aligned BAM files, extracts reads mapped to transcript regions, generates filtered and indexed BAM files, summarizes read-length distribution, and optionally calculates read/gene saturation curves.
This is usually the first quality-control step after alignment.
| Input |
Description |
| BAM file |
Transcriptome-aligned BAM file, such as Aligned.toTranscriptome.out.bam. |
| Transcript annotation |
Normalized transcript annotation file, usually gene.norm.txt generated by rpf_Reference. |
| Output prefix |
Sample-specific prefix used for filtered BAM, tables, figures, and logs. |
Parameters
| Parameter |
Required |
Description |
-t |
Yes |
Input transcript annotation file in TXT format, usually gene.norm.txt. |
-b |
Yes |
Input BAM file. |
-o |
Yes |
Output prefix. |
--thread |
No |
Number of threads. Default is 1. Large BAM files may require more memory. |
-g |
No |
Mapping-locus filter. Use 0 to keep all reads or 1 to keep uniquely mapped reads only. Default is 0. |
-a |
No |
Aligner source used to interpret BAM tags. Choices are star, hisat2, and bowtie2. Default is star. |
-r |
No |
Also count reads aligned to the negative strand. Disabled by default. |
-l |
No |
Keep only the longest transcript for each gene. Disabled by default. |
-s |
No |
Calculate read and gene saturation. This step can be time- and memory-consuming. Disabled by default. |
Output files
| Output |
Description |
<prefix>.bam |
Filtered and sorted BAM file. |
<prefix>.bam.bai |
BAM index file. |
<prefix>_length_distribution.txt |
Read-length distribution table. |
<prefix>_length_distribution.pdf / <prefix>_length_distribution.png |
Read-length distribution plots. |
<prefix>_gene_saturation.txt |
Gene saturation table, generated when -s is used. |
<prefix>_gene_saturation.pdf / <prefix>_gene_saturation.png |
Gene saturation plots, generated when -s is used. |
<prefix>_reads_saturation.txt |
Read saturation table, generated when -s is used. |
<prefix>_reads_saturation.pdf / <prefix>_reads_saturation.png |
Read saturation plots, generated when -s is used. |
<prefix>.log |
Running log if redirected by the user. |
Example
for bam in ../../3.star/*Aligned.toTranscriptome.out.bam
do
prefix_name=$(basename ${bam} Aligned.toTranscriptome.out.bam)
rpf_Check \
-b ${bam} \
-t ../../../1.reference/norm/gene.norm.txt \
-o ${prefix_name} \
-g 1 \
-a star \
--thread 10 \
-s \
&> ${prefix_name}.log
done
merge_length
Merge read-length distribution tables from multiple samples.
| Parameter |
Required |
Description |
-l / --list |
Yes |
Input *_length_distribution.txt files. Multiple files can be provided. |
-o |
Yes |
Output prefix. The output table is <prefix>_length_distribution.txt. |
merge_length \
-l *_length_distribution.txt \
-o RIBO
merge_saturation
Merge gene saturation files from multiple samples.
| Parameter |
Required |
Description |
-l / --list |
Yes |
Input saturation files, usually *_gene_saturation.txt. Multiple files can be provided. |
-o |
Yes |
Output prefix. The output table is <prefix>_gene_saturation.txt. |
merge_saturation \
-l *_gene_saturation.txt \
-o RIBO
Notes
- Ribo-seq libraries should show a dominant footprint length, commonly within a narrow RPF length range.
- Use
-s when you need to evaluate whether sequencing depth is sufficient; skip it for a fast initial check.
- Use
-g 1 when downstream analysis should be based on uniquely mapped reads only.