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 –rna-strandness R"

Examples

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

# paired
alnd <- "~/pub/sampledata/rnaseq/project1/test2.h2"
fqd <- "~/pub/sampledata/rnaseq/project1/paired_fastq"
unlink(alnd, recursive = T)
rskoseq::project_rnsq("~/pub/sampledata/rnaseq/project1", "test2.h2", "hisat2")

adopt <- "--rna-strandness RF --no-softclip --dta"
rskoseq::rep_hisat2(alndir = alnd, idx = idx, fqdir = fqd, suffix_fq = "_sub.fastq.gz",
paired = T, ... = adopt)

# project FALSE (all result create under the alignment directory)
alnd <- "~/pub/sampledata/rnaseq/project1"
fqd <- "~/pub/sampledata/rnaseq/project1/fastq"
rep_hisat2(alndir = alnd, project = F, idx = idx, fqdir = fqd, paired = FALSE)

## End(Not run)

shkonishi/rskoseq documentation built on April 18, 2021, 3:50 p.m.