| Title: | A babysitter's package for reproducible RNA-seq analysis |
|---|---|
| Description: | An automated pipe for reproducible RNA-seq analysis with the minimal efforts from researchers. The package can process bulk RNA-seq data and single-cell RNA-seq data. You can only provide the taxa name and the accession id of RNA-seq data deposited in the National Center for Biotechnology Information (NCBI). After a cup of tea or longer, you will get formated gene expression data as gene count and transcript count based on both alignment-based and alignment-free workflows. |
| Authors: | Shanwen Sun [cre, aut], Lei Xu [aut], Quan Zou [aut] |
| Maintainer: | Shanwen Sun <[email protected]> |
| License: | GPL-2 |
| Version: | 1.23.0 |
| Built: | 2026-10-07 14:21:22 UTC |
| Source: | https://github.com/bioc/BP4RNAseq |
Trim samples with adapter using cutadapt based on the results from quality_test().
adapter_trim(sample, pair, threads = 4, scRNA = FALSE, cutadapt_add = NULL)adapter_trim(sample, pair, threads = 4, scRNA = FALSE, cutadapt_add = NULL)
sample |
samples with adapter. |
pair |
'single' for single-end (SE) or 'paired' for paired-end (PE) reads. |
threads |
the number of threads to be used. Default is 4. |
scRNA |
logic, whether single-cell RNA-seq is quantified or not. Default is FALSE. |
cutadapt_add |
additional parameters to customize cutadapt to trim adapter. Default is NULL. |
None
adapter_trim(sample = 'test_read_2.fastq', pair = 'paired', scRNA = TRUE)adapter_trim(sample = 'test_read_2.fastq', pair = 'paired', scRNA = TRUE)
alignment-based workflow
align_based_quan( pair, taxa, genome, annotation, novel_transcript = FALSE, threads = 4, hisat2_build_add = NULL, hisat2_add = NULL, stringtie_add = NULL )align_based_quan( pair, taxa, genome, annotation, novel_transcript = FALSE, threads = 4, hisat2_build_add = NULL, hisat2_add = NULL, stringtie_add = NULL )
pair |
'single' for single-end (SE) or 'paired' for paired-end (PE) reads. |
taxa |
the scientific or common name of the organism. |
genome |
the reference genome. |
annotation |
the annotation file. |
novel_transcript |
logic, whether identifying novel transcripts is expected or not. Default is FALSE. |
threads |
the number of threads to be used. Default is 4. |
hisat2_build_add |
additional parameters to customize hisat2 build command. Default is NULL. |
hisat2_add |
additional parameters to customize hisat2 command. Default is NULL. |
stringtie_add |
additional parameters to customize stringtie command. Default is NULL. |
None
## Not run: test_Homo_sapiens.fna <- system.file('extdata', 'test_Homo_sapiens.fna', package = 'BP4RNAseq') test_Homo_sapiens.gff <- system.file('extdata', 'test_Homo_sapiens.gff', package = 'BP4RNAseq') align_based_quan(pair = 'paired', taxa = 'Homo sapiens', genome = test_Homo_sapiens.fna, annotation = test_Homo_sapiens.gff, novel_transcript = FALSE) ## End(Not run)## Not run: test_Homo_sapiens.fna <- system.file('extdata', 'test_Homo_sapiens.fna', package = 'BP4RNAseq') test_Homo_sapiens.gff <- system.file('extdata', 'test_Homo_sapiens.gff', package = 'BP4RNAseq') align_based_quan(pair = 'paired', taxa = 'Homo sapiens', genome = test_Homo_sapiens.fna, annotation = test_Homo_sapiens.gff, novel_transcript = FALSE) ## End(Not run)
Alignment-free expression quantification with Salmon at gene and transcript levels.
align_free_quan( pair, genome, transcript, annotation, threads = 4, salmon_index_add = NULL, salmon_quan_add = NULL )align_free_quan( pair, genome, transcript, annotation, threads = 4, salmon_index_add = NULL, salmon_quan_add = NULL )
pair |
'single' for single-end (SE) or 'paired' for paired-end (PE) reads. |
genome |
the reference genome. |
transcript |
the reference transcript |
annotation |
the annotation file. |
threads |
the number of threads to be used. Default is 4. |
salmon_index_add |
additional parameters to customize salmon index command. Default is NULL. |
salmon_quan_add |
additional parameters to customize salmon quan command. Default is NULL. |
None
align_free_quan( pair = 'paired', 'test_Homo_sapiens.fna', 'test_transcript_Homo_sapiens.fna','test_Homo_sapiens.gff' )align_free_quan( pair = 'paired', 'test_Homo_sapiens.fna', 'test_transcript_Homo_sapiens.fna','test_Homo_sapiens.gff' )
Take averages with alignment-free and alignment-based quantification
average(based_gene, free_gene, based_transcript, free_transcript)average(based_gene, free_gene, based_transcript, free_transcript)
based_gene |
gene count matrix assessed based on alignment-based workflow |
free_gene |
gene count matrix assessed based on alignment-free workflow |
based_transcript |
transcript count matrix assessed based on alignment-based workflow |
free_transcript |
transcript count matrix assessed based on alignment-free workflow |
the average of gene expression quantification with alignment-free and alignment-based quantification workflow
align_based_gene <- system.file( 'extdata', 'test_gene_alignment_based_quantification.csv', package = 'BP4RNAseq' ) align_free_gene <- system.file( 'extdata', 'test_gene_alignment_free_quantification.csv', package = 'BP4RNAseq' ) align_based_transcript <- system.file( 'extdata', 'test_transcript_alignment_based_quantification.csv', package = 'BP4RNAseq' ) align_free_transcript <- system.file( 'extdata', 'test_transcript_alignment_free_quantification.csv', package = 'BP4RNAseq' ) align_based_gene <- read.csv(align_based_gene, header = TRUE) align_free_gene <- read.csv(align_free_gene, header = TRUE) align_based_transcript <- read.csv(align_based_transcript, header = TRUE) align_free_transcript <- read.csv(align_free_transcript, header = TRUE) average( align_based_gene, align_free_gene, align_based_transcript, align_free_transcript )align_based_gene <- system.file( 'extdata', 'test_gene_alignment_based_quantification.csv', package = 'BP4RNAseq' ) align_free_gene <- system.file( 'extdata', 'test_gene_alignment_free_quantification.csv', package = 'BP4RNAseq' ) align_based_transcript <- system.file( 'extdata', 'test_transcript_alignment_based_quantification.csv', package = 'BP4RNAseq' ) align_free_transcript <- system.file( 'extdata', 'test_transcript_alignment_free_quantification.csv', package = 'BP4RNAseq' ) align_based_gene <- read.csv(align_based_gene, header = TRUE) align_free_gene <- read.csv(align_free_gene, header = TRUE) align_based_transcript <- read.csv(align_based_transcript, header = TRUE) align_free_transcript <- read.csv(align_free_transcript, header = TRUE) average( align_based_gene, align_free_gene, align_based_transcript, align_free_transcript )
Trim samples with adapter using cutadapt based on the results from quality_test().
check_dep(dependancy)check_dep(dependancy)
dependancy |
the dependancy to check. |
TRUE if the dependancy exists, otherwise FALSE.
check_dep(dependancy = 'cutadapt')check_dep(dependancy = 'cutadapt')
Download the latest reference genome and the corresponding annotation files from NCBI using the NCBI datasets command-line tool.
down_Ref(taxa)down_Ref(taxa)
taxa |
the scientific or common name of the organism. |
None
down_Ref(taxa = 'Drosophila melanogaster')down_Ref(taxa = 'Drosophila melanogaster')
Download the RNA-seq samples from the NCBI and produce the quantifications of gene expression with alignment-based and alignment-free workflows.
down2quan( accession, dir = getwd(), taxa, novel_transcript = FALSE, threads = 4, scRNA = FALSE, protocol )down2quan( accession, dir = getwd(), taxa, novel_transcript = FALSE, threads = 4, scRNA = FALSE, protocol )
accession |
the bioproject accession code for the RNA-seq samples deposited in the NCBI. |
dir |
the working directory. Default is the current working directory. |
taxa |
the scientific or common name of the organism. |
novel_transcript |
logic, whether identifying novel transcripts is expected or not. Default is FALSE. |
threads |
the number of threads to be used. Default is 4. |
scRNA |
logic, whether single-cell RNA-seq is quantified or not. Default is FALSE. |
protocol |
the single-cell RNA sequencing protocol: dropseq, chromium, or chromiumV3. |
None
down2quan( accession = 'SRR11427582', dir = getwd(), taxa = 'Drosophila melanogaster', novel_transcript = FALSE, scRNA = FALSE )down2quan( accession = 'SRR11427582', dir = getwd(), taxa = 'Drosophila melanogaster', novel_transcript = FALSE, scRNA = FALSE )
Produce the quantifications of gene expression based on the fastq files with alignment-based and alignment-free workflows.
fastq2quan( threads = 4, dir = getwd(), pair, taxa, novel_transcript = FALSE, scRNA = FALSE, protocol = NULL )fastq2quan( threads = 4, dir = getwd(), pair, taxa, novel_transcript = FALSE, scRNA = FALSE, protocol = NULL )
threads |
the number of threads to be used. Default is 4. |
dir |
the working directory. Default is the current working directory. |
pair |
'single' for single-end (SE) reads or 'paired' for paired-end (PE) reads. |
taxa |
the scientific or common name of the organism. |
novel_transcript |
logic, whether identifying novel transcripts is expected or not. Default is FALSE. |
scRNA |
logic, whether single-cell RNA-seq is quantified or not. Default is FALSE. |
protocol |
the single-cell RNA sequencing protocol: dropseq, chromium, or chromiumV3. |
None
sra_download(accession = 'SRR11427582') sra2fastq() fastq2quan(pair = 'single', taxa = 'Drosophila melanogaster')sra_download(accession = 'SRR11427582') sra2fastq() fastq2quan(pair = 'single', taxa = 'Drosophila melanogaster')
Per base sequence quality, per sequence quality scores and adapter content of raw sequence data are assessed and tested based on FastQC.
qc_test(threads = 4, scRNA = FALSE, fastqc_add = NULL)qc_test(threads = 4, scRNA = FALSE, fastqc_add = NULL)
threads |
the number of threads to be used. Default is 4. |
scRNA |
logic, whether single-cell RNA-seq is quantified or not. Default is FALSE. |
fastqc_add |
additional parameters to customize FASTQC for quality control. Default is NULL. |
Problematic samples' names
qc_test(scRNA = TRUE)qc_test(scRNA = TRUE)
Trim poor quality samples using cutadapt based on the results from quality_test().
quality_trim( per_base, per_seq, pair, threads = 4, scRNA = FALSE, cutadapt_add = NULL )quality_trim( per_base, per_seq, pair, threads = 4, scRNA = FALSE, cutadapt_add = NULL )
per_base |
samples with poor per base sequence quality. |
per_seq |
samples with poor per sequence quality scores. |
pair |
'single' for single-end (SE) or 'paired' for paired-end (PE) reads. |
threads |
the number of threads to be used. Default is 4. |
scRNA |
logic, whether single-cell RNA-seq is quantified or not. Default is FALSE. |
cutadapt_add |
additional parameters to customize cutadapt to trim poor quality reads. Default is NULL |
None
quality_trim(per_base = 'test_read_2.fastq', per_seq = 'test_read_2.fastq', pair = 'paired', threads = 4, scRNA = TRUE)quality_trim(per_base = 'test_read_2.fastq', per_seq = 'test_read_2.fastq', pair = 'paired', threads = 4, scRNA = TRUE)
scRNA expression quantification with Salmon.
scRNA_quan( transcript, protocol, threads = 4, salmon_index_add = NULL, salmon_alevin_add = NULL )scRNA_quan( transcript, protocol, threads = 4, salmon_index_add = NULL, salmon_alevin_add = NULL )
transcript |
the reference transcript |
protocol |
the single-cell RNA sequencing protocol: dropseq, chromium, or chromiumV3. |
threads |
the number of threads to be used. Default is 4. |
salmon_index_add |
additional parameters to customize salmon index command. Default is NULL. |
salmon_alevin_add |
additional parameters to customize salmon alevin command. Default is NULL. |
None
scRNA_quan(transcript = 'test_transcript_Homo_sapiens.fna', protocol = 'dropseq')scRNA_quan(transcript = 'test_transcript_Homo_sapiens.fna', protocol = 'dropseq')
Download RNA-seq samples from the NCBI using SRA Toolkit and Entrez Direct based on the accession code.
sra_download(accession, dir = getwd())sra_download(accession, dir = getwd())
accession |
the bioproject accession code for the RNA-seq samples deposited in the NCBI. |
dir |
the working directory. Default is the current working directory. |
the status of the download (0 for success, 1 for error).
sra_download(accession = 'SRR11427582')sra_download(accession = 'SRR11427582')
Convert all SRA files to fastq files and return the sequencing type, i.e., single-end (SE) or paired-end (PE) reads.
sra2fastq(threads = 4)sra2fastq(threads = 4)
threads |
the number of threads to be used. Default is 4. |
A string indicates single-end (SE) or paired-end (PE) reads.
sra_download(accession = 'SRR11427582') sra2fastq()sra_download(accession = 'SRR11427582') sra2fastq()