Last data update: 2014.03.03

R: Class '"SffReadsQ"' for next generation reads stored in SFF...
SffReadsQ-classR Documentation

Class "SffReadsQ" for next generation reads stored in SFF files (Roche 454 and Life Sciences Ion Torrent) and their quality scores

Description

SffReadsQ class is a container for storing, next-generation sequencing read data, read id, and sequencing quality information imported directly from SFF files generated by technologies such as Roche 454 and Life Sciences Ion Torrent. This class provides a way to store and manipulate, in a coordinated fashion, next generation reads stored in SFF files, their identifiers and quality scores.

Objects from this class are the result of readSff, or can be constructed from DNAStringSet, QualityScore, and BStringSet objects, using a call to the constructor SffReadsQ, as described below.

Usage

## Constructor:

SffReadsQ(sread, quality, qualityIR, adapterIR, customIR, clipMode="raw", header)

Arguments

sread

an object of class "DNAStringSet" representing the sequence data.

quality

an object of class "BStringSet", or "FastqQuality" representing the quality values associated with the sequence in sread.

qualityIR

an object of type "IRanges" object, specifying the quality clip points.

adapterIR

an object of type "IRanges" object, specifying the adapter clip points.

customIR

an object of type "IRanges" object, specifying the user custom clip points.

## qualityIR, adapterIR, and customIR are allowed to by empty

clipMode

a character string specifying the clipping mode to use for the object, see availableClipModes for more information.

header

a list object with sff header information, see readSffHeader for more information.

Slots

Slot header is inherited from SffHeader. Slots sread, qualityIR, adapterIR, customIR and clipMode are inherited from SffReads. An additional slot defined in this class is:

quality:

Object of class "BStringSet" representing a quality score (see readFastq for some discussion of quality score).

Extends

Class "SffReads", directly. Class "SffHeader", by class "SffReads", distance 2.

Methods

quality

inherited from signature(object = "ANY"): access the quality slot of object.

[

signature(x = "SffReads", i = "ANY", j = "missing"): This method creates a new SffReads object containing only those reads indexed by i. Additional methods on ‘[,SffReads’ do not provide additional functionality, but are present to limit appropriate use.

writeFastaQual

signature(object = "SffReadsQ"): ...

writeFastq

signature(object = "SffReadsQ", file = "character", mode="character", ...): Write object to file in fastq format. mode defaults to ‘w’. This creates a new file, or fails if file already exists. Use mode="a" to append to an existing file. file is expanded using path.expand.

writePhredQual

signature(object = "FastqQuality", filepath, mode="w")

writePhredQual

signature(object = "SffReadsQ", filepath, mode="w"): Write object's quality values to filepath in phred qual format (numeric). append defaults to ‘w’. This creates a new file, or fails if filepath already exists. Use mode="a" to append to an existing file. filepath is expanded using path.expand.

writeFastaQual

signature(object = "SffReadsQ", basefilename = "character", append="logical", ...): Write object to basefilename in fasta and phred qual format. append defaults to ‘FALSE’. This creates a new file, or fails if basefilename already exists. Use append=TRUE to append to an existing file. basefilename is expanded using path.expand and the suffixes [basefilename].fasta (sequence) and [basefilename].fasta.qual (qualities) are added.

append

signature(x = "SffReadsQ", values = "SffReads"): append the sread, quality and id slots of values after the corresponding fields of x.

Author(s)

Matt Settles with lots of code 'borrowed' from Martin Morgan's ShortRead Package

See Also

readSff for creation of objects of this class from SFF files.

Examples

showClass("SffReadsQ")
showMethods(class="SffReadsQ", where=getNamespace("rSFFreader"),
            inherit=FALSE)
showMethods(class="SffReads", where=getNamespace("rSFFreader"),
            inherit=FALSE)

sff <- readSff(system.file("extdata","Small454Test.sff",package="rSFFreader"))
quality(sff)

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(rSFFreader)
Loading required package: ShortRead
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: BiocParallel
Loading required package: Biostrings
Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: IRanges
Loading required package: XVector
Loading required package: Rsamtools
Loading required package: GenomeInfoDb
Loading required package: GenomicRanges
Loading required package: GenomicAlignments
Loading required package: SummarizedExperiment
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/rSFFreader/SffReadsQ-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: SffReadsQ-class
> ### Title: Class '"SffReadsQ"' for next generation reads stored in SFF
> ###   files (Roche 454 and Life Sciences Ion Torrent) and their quality
> ###   scores
> ### Aliases: class:SffReadsQ SffReadsQ-class SffReadsQ
> ###   detail,SffReadsQ-method [,SffReadsQ,ANY,ANY-method
> ###   [,SffReadsQ,ANY,missing-method [,SffReadsQ,missing,ANY-method
> ###   [,SffReadsQ,missing,missing-method writeFastaQual,SffReadsQ-method
> ###   writePhredQual,SffReadsQ-method writePhredQual,FastqQuality-method
> ###   writeFastq,SffReadsQ,ANY-method quality,ANY-method
> ###   append,SffReadsQ,SffReadsQ-method quality writeFastaQual
> ###   writePhredQual
> ### Keywords: classes
> 
> ### ** Examples
> 
> showClass("SffReadsQ")
Class "SffReadsQ" [package "rSFFreader"]

Slots:
                                                                       
Name:       quality        sread    qualityIR    adapterIR     customIR
Class: QualityScore DNAStringSet      IRanges      IRanges      IRanges
                                
Name:      clipMode       header
Class:    character         list

Extends: 
Class "SffReads", directly
Class "SffHeader", by class "SffReads", distance 2
> showMethods(class="SffReadsQ", where=getNamespace("rSFFreader"),
+             inherit=FALSE)
Function: .sffValidity (package rSFFreader)
object="SffReadsQ"

Function: [ (package base)
x="SffReadsQ", i="ANY", j="ANY"
x="SffReadsQ", i="ANY", j="missing"
x="SffReadsQ", i="missing", j="ANY"
x="SffReadsQ", i="missing", j="missing"

Function: append (package BiocGenerics)
x="SffReadsQ", values="SffReadsQ"

Function: detail (package Biostrings)
x="SffReadsQ"

Function: writeFastaQual (package rSFFreader)
object="SffReadsQ"

Function: writeFastq (package ShortRead)
object="SffReadsQ", file="ANY"

Function: writePhredQual (package rSFFreader)
object="SffReadsQ"

> showMethods(class="SffReads", where=getNamespace("rSFFreader"),
+             inherit=FALSE)
Function: .sffValidity (package rSFFreader)
object="SffReads"

Function: [ (package base)
x="SffReads", i="ANY", j="ANY"
x="SffReads", i="ANY", j="missing"
x="SffReads", i="missing", j="ANY"
x="SffReads", i="missing", j="missing"

Function: adapterClip (package rSFFreader)
object="SffReads"

Function: adapterClip<- (package rSFFreader)
object="SffReads"

Function: append (package BiocGenerics)
x="SffReads", values="SffReads"

Function: clipMode (package rSFFreader)
object="SffReads"

Function: clipMode<- (package rSFFreader)
object="SffReads"

Function: customClip (package rSFFreader)
object="SffReads"

Function: customClip<- (package rSFFreader)
object="SffReads"

Function: detail (package Biostrings)
x="SffReads"

Function: fullClip (package rSFFreader)
object="SffReads"

Function: id (package ShortRead)
object="SffReads"

Function: length (package base)
x="SffReads"

Function: names (package base)
x="SffReads"

Function: names<- (package base)
x="SffReads", value="ANY"

Function: qualityClip (package rSFFreader)
object="SffReads"

Function: qualityClip<- (package rSFFreader)
object="SffReads"

Function: rawClip (package rSFFreader)
object="SffReads"

Function: show (package methods)
object="SffReads"

Function: width (package BiocGenerics)
x="SffReads"

Function: writeFasta (package ShortRead)
object="SffReads"

> 
> sff <- readSff(system.file("extdata","Small454Test.sff",package="rSFFreader"))
Total number of reads to be read: 1000
reading header for sff file:/home/ddbj/local/lib64/R/library/rSFFreader/extdata/Small454Test.sff
reading file:/home/ddbj/local/lib64/R/library/rSFFreader/extdata/Small454Test.sff
> quality(sff)
class: FastqQuality
quality:
  A BStringSet instance of length 1000
       width seq
   [1]   422 IIIIIIIIIHIHHFFFFFFFF>AADGIIIIII...31113334;955577;;997977777878787
   [2]   157 IIHHIHAAADFHDAACAA>A>@EDEDCCA@E@...534474446>>>???FFD@?B@??=;4/...7
   [3]   376 >>FHHHHFFFFFDCA@@=?=77754444;;33...3344555559777778<;;0002999:74444
   [4]   243 IIIIIIIIIEEEFHHFHHHFIIFFFFIIIEEI...8;;;;;;=?@887==<;;;87555641.144/
   [5]   727 IIIIIIIIIIHHIIIIFHHHHHIIIIIIIIII...220100000022--/,/+++------+++--/
   ...   ... ...
 [996]   652 IIIIIIIIIHHHGGDD>>>FIIGGHIIFIIFG...01245442,20225231111.10////,,,/,
 [997]   756 IIIIIIIIIIIIIIIHHHHIIIIIIIIIIIII...2200*10200100---)))++001001*10-+
 [998]   574 IIIIIIIIHHFFFFA<444>ECCCGEECFIII...96431/.3++++++),.111111.,+++++++
 [999]   693 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...////-,+,,+011111101010-----,//-+
[1000]   573 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...999999699633355322500--)+.10-+++
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>