"track.table"
describes a collection of features localized on a genome, defined by a chromosomal location ("chrom"), two boundaries ("start" and "end") and various data (other columns). Objects can be created by two distincts means :
track.table
constructor, similar to the data.frame
constructor. It imports a single data.frame
or a collection of vectors into the object, reorder it to meet the track.table
class restrictions (see below) and check immediatly for validity.
new
function (standard behavior for S4 and reference classes), which produces an empty object and do NOT check for validity. It takes as named arguments the values to store in the fields of the various classes the new object will inherit from.
"track.table"
, with restricted names and types :
character
.integer
or factor
.integer
.integer
.factors
, they need to be numerically ordered by their internal codes (as the order
function does), not alphabetically by their labels. As the slice
method relies on a row index, each update in the feature coordinates must be followed by a call to the buildIndex
method, a behavior that is enforced by overloading most of
-inherited methods. As the slice
method relies on a R call object using
column references, each update in the column names must be followed by a call to the buildCalls
method, a behavior that is enforced by overloading most of
-inherited methods.
, directly.
Class
, directly.
Class
, by class
, distance 2.
Class
, by class
, distance 3. All reference classes extend and inherit methods from
.assembly
:character
value, the assembly version for the coordinates stored in the object. Must have length 1, should not be NA
.checktrack
:call
to the C external "checktrack", for faster object check (see the check
method).index
:integer
vector, giving the index of the first row in each chromosome. See the subtrack
function for further details.organism
:character
value, the name of the organism whose data is stored in the object. Must have length 1, should not be NA
.sizetrack
:call
to the C external "track", for faster row counting (see the size
method).subtrack
:call
to the C external "track", for faster slicing (see the slice
method).addArms(centromeres, temp = )
:buildCalls()
:buildGroupPosition(groupBy, colName = , reverse = )
:buildGroupSize(groupBy, colName = )
:buildIndex()
:eraseArms(temp = )
:isArmed()
:segMerge(...)
:segOverlap(...)
:size(chrom, start, end)
:refTable-class
track.table
, subtrack
, istrack
# Exemplar data : subset of human genes
data(hsFeatures)
# Construction
trackTable <- track.table(
hsGenes,
.name = "NCBI Genes",
.organism = "Homo sapiens",
.assembly = "GRCh37"
)
# Slicing
print(trackTable$slice(chrom="1", as.integer(15e6), as.integer(20e6)))
Run the code above in your browser using DataCamp Workspace