ctk_tag2profile: Wrapper function for ctk's ctk_tag2profile

View source: R/wrapperFunctions_ctk.R

ctk_tag2profileR Documentation

Wrapper function for ctk's ctk_tag2profile

Description

Wrapper function for ctk's ctk_tag2profile

Usage

ctk_tag2profile(
  filesToRun,
  outFile = paste0(file_path_sans_ext(filesToRun), ".out"),
  outFile2 = NULL,
  sb = "tag2profile.pl",
  perl = "perl",
  PATHTOPERLLIB = NULL,
  bigFile = FALSE,
  weight = FALSE,
  weightAvg = FALSE,
  ss = TRUE,
  exact = TRUE,
  nz = FALSE,
  ext5 = NULL,
  ext3 = NULL,
  chromLen = NULL,
  region = NULL,
  minBlockSize = 2e+06,
  windowSize = 100,
  stepSize = 20,
  outputFormat = "bedgraph",
  normalization = "none",
  stderr = file.path(dirname(fileToRun), paste0(basename(fileToRun),
    "_ctk_tag2profile_stderr.txt")),
  stdout = file.path(dirname(fileToRun), paste0(basename(fileToRun),
    "_ctk_tag2profile_stdout.txt")),
  useClipRConda = ifelse(is.null(getOption("CLIPflexR.condaEnv")), FALSE, TRUE),
  additional_Args = NULL,
  verbose = FALSE,
  writelog = T
)

Arguments

filesToRun

path to file to process (BED).

outFile

path to output file (BED).

outFile2

path to output 2 file (BED; specify two output files to separate strands).

sb

path to tag2profile.pl from CTK.

perl

path to PERL

PATHTOPERLLIB

path to PERL5LIB.

bigFile

TRUE when working with a big file, TRUE or FALSE (default).

weight

weight counts according to the score of each tag, TRUE or FALSE (default).

weightAvg

weight average the score of each tag, TRUE or FALSE (default).

ss

separate strand, TRUE (default) or FALSE.

exact

exact count at each nucleotide, TRUE (default) or FALSE.

nz

don't print zeroes (works for sgr and bed), TRUE or FALSE (default).

ext5

extension of tags at the 5' end, default is NULL (set to integer to specify).

ext3

extension of tags at the 3' end, default is NULL (set to integer to specify).

chromLen

chrom length file, default is NULL (set file path to specify).

region

a bed file with regions to count tag numbers; if not specified (NULL), count in moving windows

minBlockSize

minimum number of lines to read in each block for a big file, default is 2000000.

windowSize

window size, default is 100.

stepSize

step size, default is 20.

outputFormat

output format, "bed" or "bedgraph" (default) or "sgr".

normalization

normalization, "none" (default) or "rpkm" or multiply=1.3).

stderr

path to stdout file.

stdout

path to stdout file.

useClipRConda

use conda environment installed by Herper, TRUE (default) or FALSE.

additional_Args

Additional arguments to be passed to system call.

verbose

print messages, TRUE or FALSE (default).

writelog

write stderr/stdout logs, TRUE (default) or FALSE.

Value

path to BED file.

Author(s)

Kathryn Rozen-Gagnon

Examples

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_FF <- ctk_fastqFilter(testFQ,qsFilter="mean:0-29:20",verbose=TRUE)
FqFile <- decompress(FqFile_FF,overwrite=TRUE)
FqFile_clipped <- fastx_clipper(FqFile,length=20)
FqFile_QF <- fastq_quality_trimmer(FqFile_clipped)
FqFile_Col <- ctk_fastq2collapse(FqFile_QF,verbose=TRUE)
FqFile_QFColStripped <- ctk_stripBarcode(FqFile_Col,linkerlength=5,inputFormat="fastq")
bam <- suppressWarnings(bowtie_align(FqFile_QFColStripped,myIndex, 
overwrite=TRUE, inputFormat="fastq"))
parsedAlignment <- ctk_parseAlignment(bam)
myCollaped <- ctk_tag2collapse(parsedAlignment,weight=FALSE,randomBarcode=FALSE,
weightInName=FALSE,verbose=TRUE)
myrgbBed <- ctk_bed2rgb(myCollaped,col="128,0,0")
ctk_tag2profile(myrgbBed,verbose=TRUE)

kathrynrozengagnon/CLIPflexR documentation built on Dec. 8, 2022, 7:31 p.m.