Alignment using Rbowtie2
bowtie_align(
fq,
index,
outbam = "fq",
inputFormat = "fasta",
keepSAM = T,
mode = "genome_map",
maxMismatches = 0,
seedSubString = 18,
threads = 1,
report_k = NULL,
keep_all = NULL,
soft_clip = NULL,
additional_Args = NULL,
overwrite = FALSE
)
path to file to process (fasta or fastq).
bowtie2 index name without extension.
output bam name, not required if mode is set. If mode is set to "NULL", specify "fq" (default - name of file to process/reads) or "index" (name of index)
Format of reads, "fastq" or "fasta" (default).
keep bowtie2 SAM output file, TRUE (default) or FALSE.
mapping mode, "genome_map" (default - 1 mismatch in seed alignment, seed substring of 18) or "reverse_map" (for mapping short sequences to reads, i.e. miRNAs or chimera analysis, 0 mismatches and a seed substring of 18); set mode=NULL to custom set bowtie2 options using arguments below or additional arguments.
max mismatches in seed alignment, (default is 0).
length of seed substrings (default is 18).
number of threads to use (default is 1).
number of alignments to report, default is NULL (the best alignment is reported), set to integer to specify.
report all alignments, default is NULL (the best alignment is reported), set to TRUE to report all.
allow soft clipping, default is NULL (no soft clipping), set to TRUE to to soft clip.
any additional mapping arguments not set above, default is NULL, can be set by specifying a single character string with spaces between arguments (see example below); run "Rbowtie2::bowtie2_usage()" to see all options; please note that due to a Rbowtie2 bug, the "--no-1mm-upfront" is not available.
overwrite existing output files, TRUE or FALSE (default).
path to sorted BAM.
testFasta <- system.file("extdata/hg19Small.fa",package="CLIPflexR")
myIndex <- suppressWarnings(bowtie2_index(testFasta, overwrite=TRUE))
testFQ <- system.file("extdata/Fox3_Std_small.fq.gz",package="CLIPflexR")
FqFile <- decompress(testFQ,overwrite=TRUE)
FqFile_FF <- ctk_fastqFilter(FqFile,qsFilter="mean:0-29:20",verbose=TRUE)
#> fastq_filter.pl command is /Users/runner/Library/r-miniconda/envs/CLIPflexR_0.1.20/bin/ctk/fastq_filter.pl
#> fastq_filter.pl arguments are /Users/runner/Library/r-miniconda/envs/CLIPflexR_0.1.20/bin/ctk/fastq_filter.pl -if sanger -of fastq -f mean:0-29:20 /Users/runner/work/_temp/Library/CLIPflexR/extdata/Fox3_Std_small.fq /Users/runner/work/_temp/Library/CLIPflexR/extdata/FF_Fox3_Std_small.fq
FqFile_clipped <- fastx_clipper(FqFile_FF,length=20)
FqFile_QF <- fastq_quality_trimmer(FqFile_clipped)
FqFile_Col <- ctk_fastq2collapse(FqFile_QF,verbose=TRUE)
#> fastq_filter.pl command is /Users/runner/Library/r-miniconda/envs/CLIPflexR_0.1.20/bin/ctk/fastq2collapse.pl
#> fastq_filter.pl arguments are /Users/runner/Library/r-miniconda/envs/CLIPflexR_0.1.20/bin/ctk/fastq2collapse.pl /Users/runner/work/_temp/Library/CLIPflexR/extdata/QT_FF_Fox3_Std_small_clip.fq /Users/runner/work/_temp/Library/CLIPflexR/extdata/Collapsed_QT_FF_Fox3_Std_small_clip.fq
FqFile_ColStrip <- ctk_stripBarcode(FqFile_Col,linkerlength=5, inputFormat="fastq")
##map reads to genome
suppressWarnings(bowtie_align(FqFile_ColStrip,myIndex,
inputFormat="fastq", overwrite=TRUE))
#> [1] "/Users/runner/work/_temp/Library/CLIPflexR/extdata/Collapsed_QT_FF_Fox3_Std_small_clip_rm5.bam"
##map reads to genome, custom mode
suppressWarnings(bowtie_align(FqFile_ColStrip,myIndex, mode=NULL,
soft_clip=TRUE, additional_Args="--mp 15 -R 4", inputFormat="fastq", overwrite=TRUE))
#> [1] "/Users/runner/work/_temp/Library/CLIPflexR/extdata/Collapsed_QT_FF_Fox3_Std_small_clip_rm5.bam"
##map miRNAs to reads
miRNAs <- system.file("extdata/hsa_mature.fa",package="CLIPflexR")
FaFile_Fa <- fastx_qtoa(FqFile_ColStrip)
readIndex <- bowtie2_index(FaFile_Fa, overwrite=TRUE)
suppressWarnings(bowtie_align(miRNAs,readIndex, mode="reverse_map",overwrite=TRUE))
#> [1] "/Users/runner/work/_temp/Library/CLIPflexR/extdata/Collapsed_QT_FF_Fox3_Std_small_clip_rm5.bam"