SamSource: Create or retrieve 'SamSource' objects.

Description Usage Arguments Value Examples

Description

A SamSource object is meant to be an opaque object used to store the source information associated with a Sam file. Currently only type= "file" is supported, but "url" may be added. The name, host machine name, and type can be retrieved from SamSource or Sam objects with samSourceName(), samSourceHost(), and samSourceType(), respectively. A SamSource object can be retrieved from a Sam, SamHeader, or SamReads object using SamSource().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
SamSource(x, ...)

## S3 method for class 'character'
SamSource(x, host = NA, type = NA, ...)

## S3 method for class 'list'
SamSource(x, ...)

## S3 method for class 'Sam'
SamSource(x, ...)

## S3 method for class 'SamSource'
SamSource(x, ...)

## S3 method for class 'SamHeader'
SamSource(x, ...)

## S3 method for class 'SamReads'
SamSource(x, ...)

## S3 method for class 'NULL'
SamSource(x, ...)

Arguments

x

The object to construct a SamSource object from. Can be a Sam, SamHeader, or SamReads object, a list, or the name of the source file/url as a character vector, or an explicit NULL. If this is a list , "name=", "host=" and "type=" elements can be specified as character vectors. Missing or NULL list elements are treated as N/A. All character vectors should be the same length. If this is an explicit NULL, it is treated the same as if it was an empty list.

...

Required for S3 object method implementation. Not currently used.

host

The name of the system the sam file is available on. Default is NA.

type

The type of source for the sam file. Currently only "file" is supported. "url" may be added. The default is NA.

Value

Returns a SamSource object, an opaque object from which the source file name, host machine, and type of access can be extracted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
  sam <- Sam("file.sam")
  stopIfNot( SamSource( sam ) == SamSource( SamHeader( sam ) ==
  	SamSource( SamReads( sam )))

  source2 <- SamSource( "file.sam", host="bioinf.unc.edu", type="file")

  sourceList <- list(name="file.sam", host="bioinf.unc.edu", type="file")
  source3 <- SamSource( sourceList )

  source4 <- SamSource(NULL)

## End(Not run)

jefferys/SamSeq documentation built on Oct. 25, 2019, 8:11 a.m.