rep_hisat2: Replicate execution of read alignment using hisat2

Description Usage Arguments Examples

View source: R/rep_hisat2.R

Description

The NGS read alignment using hisat2 for multiple samples. The input and output directory must be created by 'rskoseq::project_rnsq'.

Usage

1
rep_hisat2(alndir, idx, project, fqdir, paired, suffix_fq, ...)

Arguments

alndir

character: the name of alignment directory. results output

idx

character: the fully path of hisat2 index name.

project

logical:default is TRUE. If does not create project directory using rskoseq::project_rnsq, it is FALSE

fqdir

character: the fully path of fastq files. The default is 'paste0(dirname(alndir), "/fastq")'. If this directory containing still analyzed fastq and additional fastq files,

paired

logical: paired or single read. If paired end, the names of fastq file must be "_R1" and "_R2".

suffix_fq

character: suffix of fastq files. The default is ".fastq.gz"

...

additional hisat2 options. E.g. "–no-spliced-alignment"

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## project TRUE (all result created at directories predetermined by 'project_rnsq') ----
# alndir <- "~/pub/sampledata/rnaseq/project1/test.h2"
# idx <- "~/db/index/hisat2_idx/CriGri_1.0.ens.add"
# unlink(alndir, recursive = T)
# rskoseq::project_rnsq("~/pub/sampledata/rnaseq/project1", "test.h2", "hisat2")
# rskoseq::rep_hisat2(alndir = alndir, idx = idx, paired=F)

## paired ----
# alndir <- "~/pub/sampledata/rnaseq/project1/test2.h2"
# fqd <- "~/pub/sampledata/rnaseq/project1/paired_fastq"
# unlink(alndir, recursive = T)
# rskoseq::project_rnsq("~/pub/sampledata/rnaseq/project1", "test2.h2", "hisat2")
# rep_hisat2(alndir = alndir, idx = idx, fqdir = fqd, suffix_fq = "_sub.fastq.gz", paired=T)
#
## project FALSE (all result create under the alignment directory)
# alndir <- "~/pub/sampledata/rnaseq/project1"
# fqd <- "~/pub/sampledata/rnaseq/project1/fastq"
# rep_hisat2(alndir = "~/pub/sampledata/rnaseq/project1", project = F,
#            idx = idx, fqdir = fqd, paired=FALSE, )

shkonishi/rskoseq documentation built on June 24, 2018, 6:19 a.m.