Access and modify the track data. x$name and x$name <- value are just shortcuts for trackData(x)$name and trackData(x)$name <- value, respectively.

trackData(x)

trackData(x) <- value

# S4 method for TnTTrack
$(x, name)

# S4 method for TnTTrack
$(x, name) <- value

Arguments

x

A TnTTrack object.

value

Replaced value.

name

Passed to the inner method for track data.

Value

trackData on all track types except "CompositeTrack" returns an object that inherits GRanges class, which means they should behave like a GRanges. While trackData on "CompositeTrack" returns a list of tracks.

Examples

track <- BlockTrack(GRanges("chr1", IRanges(6, 54))) trackData(track) # track data of block track is an object that inherits GRanges.
#> RangeTrackData object with 1 range and 3 metadata columns: #> seqnames ranges strand | tooltip color key #> <Rle> <IRanges> <Rle> | <data.frame> <character> <integer> #> [1] chr1 [6, 54] * | blue 1 #> ------- #> seqinfo: 1 sequence from an unspecified genome; no seqlengths
ctrack <- merge(track, track) trackData(ctrack) # track data of composite track is a list of tracks
#> An object of class "CompositeTrackData" #> [[1]] #> A BlockTrack #> | Label: GRanges("chr1", IRanges(6, 54)) #> | Background: missing, use ‘white’ #> | Height: 30 #> | Data: RangeTrackData object with 1 range and 3 metadata columns: #> | seqnames ranges strand | tooltip color key #> | <Rle> <IRanges> <Rle> | <data.frame> <character> <integer> #> | [1] chr1 [6, 54] * | blue 1 #> | ------- #> | seqinfo: 1 sequence from an unspecified genome; no seqlengths #> #> [[2]] #> A BlockTrack #> | Label: GRanges("chr1", IRanges(6, 54)) #> | Background: missing, use ‘white’ #> | Height: 30 #> | Data: RangeTrackData object with 1 range and 3 metadata columns: #> | seqnames ranges strand | tooltip color key #> | <Rle> <IRanges> <Rle> | <data.frame> <character> <integer> #> | [1] chr1 [6, 54] * | blue 1 #> | ------- #> | seqinfo: 1 sequence from an unspecified genome; no seqlengths #>