Package 'BP4RNAseq'

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

Help Index


Trim samples with adapter using cutadapt.

Description

Trim samples with adapter using cutadapt based on the results from quality_test().

Usage

adapter_trim(sample, pair, threads = 4, scRNA = FALSE, cutadapt_add = NULL)

Arguments

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.

Value

None

Examples

adapter_trim(sample = 'test_read_2.fastq', pair = 'paired', scRNA = TRUE)

alignment-based workflow

Description

alignment-based workflow

Usage

align_based_quan(
  pair,
  taxa,
  genome,
  annotation,
  novel_transcript = FALSE,
  threads = 4,
  hisat2_build_add = NULL,
  hisat2_add = NULL,
  stringtie_add = NULL
)

Arguments

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.

Value

None

Examples

## 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.

Description

Alignment-free expression quantification with Salmon at gene and transcript levels.

Usage

align_free_quan(
  pair,
  genome,
  transcript,
  annotation,
  threads = 4,
  salmon_index_add = NULL,
  salmon_quan_add = NULL
)

Arguments

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.

Value

None

Examples

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

Description

Take averages with alignment-free and alignment-based quantification

Usage

average(based_gene, free_gene, based_transcript, free_transcript)

Arguments

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

Value

the average of gene expression quantification with alignment-free and alignment-based quantification workflow

Examples

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
)

Check the existence of dependancies.

Description

Trim samples with adapter using cutadapt based on the results from quality_test().

Usage

check_dep(dependancy)

Arguments

dependancy

the dependancy to check.

Value

TRUE if the dependancy exists, otherwise FALSE.

Examples

check_dep(dependancy = 'cutadapt')

Download the latest reference genome, transcript and the corresponding annotation files from NCBI.

Description

Download the latest reference genome and the corresponding annotation files from NCBI using the NCBI datasets command-line tool.

Usage

down_Ref(taxa)

Arguments

taxa

the scientific or common name of the organism.

Value

None

Examples

down_Ref(taxa = 'Drosophila melanogaster')

Download the RNA-seq samples from the NCBI and produce the quantifications of gene expression.

Description

Download the RNA-seq samples from the NCBI and produce the quantifications of gene expression with alignment-based and alignment-free workflows.

Usage

down2quan(
  accession,
  dir = getwd(),
  taxa,
  novel_transcript = FALSE,
  threads = 4,
  scRNA = FALSE,
  protocol
)

Arguments

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.

Value

None

Examples

down2quan(
accession = 'SRR11427582', dir = getwd(), 
taxa = 'Drosophila melanogaster', novel_transcript = FALSE, scRNA = FALSE
)

Produce the quantifications of gene expression based on the fastq files.

Description

Produce the quantifications of gene expression based on the fastq files with alignment-based and alignment-free workflows.

Usage

fastq2quan(
  threads = 4,
  dir = getwd(),
  pair,
  taxa,
  novel_transcript = FALSE,
  scRNA = FALSE,
  protocol = NULL
)

Arguments

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.

Value

None

Examples

sra_download(accession = 'SRR11427582')
sra2fastq()
fastq2quan(pair = 'single', taxa = 'Drosophila melanogaster')

Quality assessments of raw sequence data.

Description

Per base sequence quality, per sequence quality scores and adapter content of raw sequence data are assessed and tested based on FastQC.

Usage

qc_test(threads = 4, scRNA = FALSE, fastqc_add = NULL)

Arguments

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.

Value

Problematic samples' names

Examples

qc_test(scRNA = TRUE)

Trim poor quality samples using cutadapt.

Description

Trim poor quality samples using cutadapt based on the results from quality_test().

Usage

quality_trim(
  per_base,
  per_seq,
  pair,
  threads = 4,
  scRNA = FALSE,
  cutadapt_add = NULL
)

Arguments

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

Value

None

Examples

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.

Description

scRNA expression quantification with Salmon.

Usage

scRNA_quan(
  transcript,
  protocol,
  threads = 4,
  salmon_index_add = NULL,
  salmon_alevin_add = NULL
)

Arguments

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.

Value

None

Examples

scRNA_quan(transcript = 'test_transcript_Homo_sapiens.fna', protocol = 'dropseq')

Download RNA-seq samples from the NCBI.

Description

Download RNA-seq samples from the NCBI using SRA Toolkit and Entrez Direct based on the accession code.

Usage

sra_download(accession, dir = getwd())

Arguments

accession

the bioproject accession code for the RNA-seq samples deposited in the NCBI.

dir

the working directory. Default is the current working directory.

Value

the status of the download (0 for success, 1 for error).

Examples

sra_download(accession = 'SRR11427582')

Convert SRA format to fastq format and return the sequencing type, i.e., single-end (SE) or paired-end (PE) reads.

Description

Convert all SRA files to fastq files and return the sequencing type, i.e., single-end (SE) or paired-end (PE) reads.

Usage

sra2fastq(threads = 4)

Arguments

threads

the number of threads to be used. Default is 4.

Value

A string indicates single-end (SE) or paired-end (PE) reads.

Examples

sra_download(accession = 'SRR11427582')
sra2fastq()