Last data update: 2014.03.03

R: fastqKmerSubsetLocs function: Counts for a given DNA k-mer...
fastqKmerSubsetLocsR Documentation

fastqKmerSubsetLocs function: Counts for a given DNA k-mer subset position wise from FASTQ files.

Description

Reads (compressed) FASTQ files and counts for given DNA k-mer subset for each position in sequence. The k-mer subset is given by a vector of k-mer indices. k-mer indices can be obtained from DNA k-mers with the function kMerIndex.

Usage

fastqKmerSubsetLocs(filenames, k=4, kIndex)

Arguments

filenames

character. Vector of fastqKmerSubsetLocs file names. Files can be gz compressed.

k

integer. Length of counted DNA k-mers.

kIndex

integer. Numeric values which represent indices of DNA-k mers.

Details

Maximal allowed value for k is 12.

Value

list. The length of the list equals the number of given filenames. Contains for each given file a matrix. Each matrix has one row for each given kIndex and an additional row with counts for all other DNA k-mers (labeled other). The number of columns equals the maximal sequence length in the FASTQ file.

Author(s)

Wolfgang Kaisers

References

Cock PJA, Fields CJ, Goto N, Heuer ML, Rice PM The sanger FASTQ file format for sequences with quality scores and the Solexa/Illumina FASTQ variants. Nucleic Acids Research 2010 Vol.38 No.6 1767-1771

Examples

basedir <- system.file("extdata", package="seqTools")
setwd(basedir)
k <- 4
kMers <- c("AAAA", "AACC", "AAGG")
kIdx <- kMerIndex(kMers)
res <- fastqKmerSubsetLocs("test_l6.fq", k, kIdx)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(seqTools)
Loading required package: zlibbioc
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/seqTools/fastqKmerSubsetLocs.Rd_%03d_medium.png", width=480, height=480)
> ### Name: fastqKmerSubsetLocs
> ### Title: fastqKmerSubsetLocs function: Counts for a given DNA k-mer
> ###   subset position wise from FASTQ files.
> ### Aliases: fastqKmerSubsetLocs
> ### Keywords: fastqKmerSubsetLocs kmer
> 
> ### ** Examples
> 
> basedir <- system.file("extdata", package="seqTools")
> setwd(basedir)
> k <- 4
> kMers <- c("AAAA", "AACC", "AAGG")
> kIdx <- kMerIndex(kMers)
> res <- fastqKmerSubsetLocs("test_l6.fq", k, kIdx)
[fastq_KsubLocs] File ( 1/1) 'test_l6.fq' 	done.
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>