Last data update: 2014.03.03

R: Class '"SffReads"'. A class for next generation reads stored...
SffReads-classR Documentation

Class "SffReads". A class for next generation reads stored in SFF files (Roche 454 and Life Sciences Ion Torrent)

Description

This class provides a way to store and manipulate, in a coordinated fashion, next generation reads stored in SFF files and their identifiers.

Objects from this class are created by readSff, or by calls to the constructor SffReads, as outlined below.

Usage

## Constructor:

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

Arguments

sread

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

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

Slots header are inherited from SffHeader. Additional slots defined in this class are:

sread:

Object of class "DNAStringSet" containing IUPAC-standard, variable-length DNA strings representing sequence reads.

qualityIR:

Object of class "IRanges" contains the clip points associated with quality clip locations specified in the sff file read header. Clip locations are auto filled to those specified in the sff file.

adapterIR:

Object of class "IRanges" contains the clip points associated with adapter clip locations specified in the sff file read header. Clip locations are auto filled to those specified in the sff file.

customIR:

Object of class "IRanges" contains the clip points associated with custom clip locations as specified by the user. Initial object is set to empty.

clipMode:

Object of class "character" contains the current active clipMode, one of "raw", "adapter", "quality", "custom", "full". See explaination below for an expanded desription of clip modes.

Extends

Class "SffHeader", directly.

Methods

[

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.

adapterClip

signature(object = "SffReads"): Returns an IRanges object of clip points when clipMode is set to "adapter"

adapterClip<-

signature(object = "SffReads"): Provide new adapter clip points with an IRanges object.

clipMode

signature(object = "SffReads"): returns the current active clipMode being used.

clipMode<-

signature(object = "SffReads"): set the current clip mode to one of "raw", "adapter", "quality", "full", or "custom"

customClip

signature(object = "SffReads"): Returns an IRanges object of clip points when clipMode is set to "custom"

customClip<-

signature(object = "SffReads"):Provide new custom clip points with an IRanges object.

fullClip

signature(object = "SffReads"): Returns an IRanges object of clip points when clipMode is set to "full"

length

signature(x = "SffReads"): returns a integer(1) vector describing the number of reads in this object.

width

signature(x = "SffReads"): returns an integer() vector of the widths of each read in this object.

names

signature(x = "SffReads"): access the id slot of the object returning a character vector of read names.

names<-

signature(x = "SffReads", value = "ANY"): Provide new read ids with a character() vector of same length as the object.

qualityClip

signature(object = "SffReads"): Returns an IRanges object of clip points when clipMode is set to "quality".

qualityClip<-

signature(object = "SffReads"): Provide new quality clip points with an IRanges object.

rawClip

signature(object = "SffReads"): Returns an IRanges object of clip points when clipMode is set to "full".

sread

signature(object = "ANY"): access the sread slot of object, returning a DNAStringSet object of reads.

id

signature(object = "SffReads"): this function is included to maintain compatibilty with the ShortRead class, returning a BStringSet object of read names for the object.

append

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

writeFasta

signature(object="SffReads", file, ...): write object to file in fasta format. See writeFasta for ... argument values.

Author(s)

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

See Also

SffReadsQ and availableClipModes

Examples

showClass("SffReads")
showMethods(class="SffReads", where=getNamespace("rSFFreader"),
            inherit=FALSE)
            
sff <- readSff(system.file("extdata","Small454Test.sff",package="rSFFreader"), use.qualities=FALSE)
detail(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/SffReads-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: SffReads-class
> ### Title: Class '"SffReads"'. A class for next generation reads stored in
> ###   SFF files (Roche 454 and Life Sciences Ion Torrent)
> ### Aliases: class:SffReads SffReads-class SffReads show,SffReads-method
> ###   detail,SffReads-method [,SffReads,ANY,ANY-method
> ###   [,SffReads,ANY,missing-method [,SffReads,missing,ANY-method
> ###   [,SffReads,missing,missing-method adapterClip,SffReads-method
> ###   adapterClip<-,SffReads-method clipMode,SffReads-method
> ###   clipMode<-,SffReads-method customClip,SffReads-method
> ###   customClip<-,SffReads-method fullClip,SffReads-method
> ###   length,SffReads-method names,SffReads-method
> ###   names<-,SffReads,ANY-method qualityClip,SffReads-method
> ###   qualityClip<-,SffReads-method rawClip,SffReads-method sread
> ###   id,SffReads-method name,SffReads-method
> ###   append,SffReads,SffReads-method width,SffReads-method
> ###   writeFasta,SffReads-method solveSffSEW adapterClip adapterClip<-
> ###   clipMode clipMode<- customClip customClip<- fullClip qualityClip
> ###   qualityClip<- rawClip
> ### Keywords: classes
> 
> ### ** Examples
> 
> showClass("SffReads")
Class "SffReads" [package "rSFFreader"]

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

Extends: "SffHeader"

Known Subclasses: "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"), use.qualities=FALSE)
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
> detail(sff)
class: SffReads

header information:
[[1]]
[[1]]$filename
[1] "/home/ddbj/local/lib64/R/library/rSFFreader/extdata/Small454Test.sff"

[[1]]$magic_number
[1] 779314790

[[1]]$version
[1] ""

[[1]]$index_offset
[1] 6201592

[[1]]$index_length
[1] 20728

[[1]]$number_of_reads
[1] 1000

[[1]]$header_length
[1] 1640

[[1]]$key_length
[1] 4

[[1]]$number_of_flows_per_read
[1] 1600

[[1]]$flowgram_format_code
[1] 1

[[1]]$flow_chars
[1] "TACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACG"

[[1]]$key_sequence
[1] "GACT"



Clip Mode:  full 

sread:
  A DNAStringSet instance of length 1000
       width seq                                            names               
   [1]   422 ACACGACGACTTCTTCCAGCAC...TCAATCGGCAGGCGCTCGCTC HRWLTHE02G15D7
   [2]   157 ACACTACTCGTGCAATGGTATT...TTTTGCCCTGCTGGTGCCGGC HRWLTHE02H2PCX
   [3]   376 ACACGACGACTGTTGGCGATAA...GAGATGAATTCGTTACAAATC HRWLTHE02HB23L
   [4]   243 ACACGACGACTCAACAGCATCT...CAGCTGGAGCGAGAAGATCAT HRWLTHE02IYLA2
   [5]   727 ACACTACTCGTGCCGACAAATC...AGGCGACCGAGGTCTCCGTTA HRWLTHE02F3E10
   ...   ... ...
 [996]   652 ACACGACGACTCGGGGTTTCAT...ACTCGCTTGTCGCCTTCCTGC HRWLTHE02JSWSM
 [997]   756 ACACGACGACTGGCATTTTCAA...GAAATAAACGCCCGGTCACCG HRWLTHE02FJUSH
 [998]   574 ACACGACGACTTATCGCCCTGA...GGTGTGATCGACGAGGGGGGT HRWLTHE02GCJZT
 [999]   693 ACACTACTCGTCATCCGTCGCT...TGCTGGTATCTACCGGCAGCA HRWLTHE02IFUFC
[1000]   573 ACACTACTCGTCGCGTTCGCGA...TTGACGCGGGTTGTGAATACG HRWLTHE02GF2BA

clip points:
IRanges object with 1000 ranges and 0 metadata columns:
             start       end     width
         <integer> <integer> <integer>
     [1]         5       426       422
     [2]         5       161       157
     [3]         5       380       376
     [4]         5       247       243
     [5]         5       731       727
     ...       ...       ...       ...
   [996]         5       656       652
   [997]         5       760       756
   [998]         5       578       574
   [999]         5       697       693
  [1000]         5       577       573
IRanges object with 1000 ranges and 0 metadata columns:
             start       end     width
         <integer> <integer> <integer>
     [1]         1       938       938
     [2]         1      1048      1048
     [3]         1      1418      1418
     [4]         1      1471      1471
     [5]         1      1026      1026
     ...       ...       ...       ...
   [996]         1      1272      1272
   [997]         1       987       987
   [998]         1      1411      1411
   [999]         1       950       950
  [1000]         1      1316      1316
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>