AnnotatedDataFrame          package:Biobase          R Documentation

_C_l_a_s_s _C_o_n_t_a_i_n_i_n_g _M_e_a_s_u_r_e_d _V_a_r_i_a_b_l_e_s _a_n_d _T_h_e_i_r _M_e_t_a-_D_a_t_a _D_e_s_c_r_i_p_t_i_o_n.

_D_e_s_c_r_i_p_t_i_o_n:

     An 'AnnotatedDataFrame' consists of two parts. There is a
     collection of samples and the values of variables measured on
     those samples. There is also a description of each variable
     measured. The components of an 'AnnotatedDataFrame' can be
     accessed with 'pData' and 'varMetadata'.

_E_x_t_e_n_d_s:

     Versioned

_C_r_e_a_t_i_n_g _O_b_j_e_c_t_s:

     'new("AnnotatedDataFrame")'

     'new("AnnotatedDataFrame", data=data.frame(),
     varMetadata=data.frame(), dimLabels=c("rowNames", "columnNames"))'

     'AnnotatedDataFrame' instances are created using 'new'.  The
     initialize method takes up to three arguments, 'data',
     'varMetadata', and 'dimLabels'.  'data' is a 'data.frame' of the
     samples (rows) and measured variables (columns).  'varMetadata' is
     a 'data.frame' with the number of rows equal to the number of
     columns of the 'data' argument. 'varMetadata' describes aspects of
     each measured variable. 'dimLabels' provides aesthetic control for
     labeling rows and columns in the 'show' method. 'varMetadata' and
     'dimLabels' can be missing.

     'as(data.frame, "AnnotatedDataFrame")' coerces a 'data.frame' to
     an 'AnnotatedDataFrame'.

     'annotatedDataFrameFrom' may be a convenient way to create an
     'AnnotatedDataFrame' from 'AssayData-class'.

_S_l_o_t_s:

     Class-specific slots:

     '_d_a_t_a': A 'data.frame' containing samples (rows) and measured
          variables (columns).

     '_v_a_r_M_e_t_a_d_a_t_a': A 'data.frame' with number of rows equal number of
          columns in 'data', and at least one column, named
          'labelDescription', containing a textual description of each
          variable.

_M_e_t_h_o_d_s:

     Class-specific methods.

     '_c_o_m_b_i_n_e(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>,         <_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>': Bind
          data from one 'AnnotatedDataFrame' to a second
          'AnnotatedDataFrame', returning the result as an
          'AnnotatedDataFrame'. Row (sample) names in each argument
          must be unique. Variable names present in both arguments
          occupy a single column in the resulting 'AnnotatedDataFrame'.
          Variable names unique to either argument create columns with
          values assigned for those samples where the variable is
          present. 'varMetadata' in the returned 'AnnotatedDataFrame'
          is updated to reflect the combination.

     '_p_D_a_t_a(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)', '_p_D_a_t_a(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)<-<_d_a_t_a._f_r_a_m_e>': 
          Set and retrieve the data (samples and variables) in the
          'AnnotatedDataFrame'

     '_v_a_r_M_e_t_a_d_a_t_a(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)', '_v_a_r_M_e_t_a_d_a_t_a(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)<-<_d_a_t_a._f_r_a_m_e>': 
          Set and retrieve the meta-data (variables and their
          descriptions) in the 'AnnotatedDataFrame'

     '_f_e_a_t_u_r_e_N_a_m_e_s(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)', '_f_e_a_t_u_r_e_N_a_m_e_s(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)<-<_A_N_Y>': 
          Set and retrieve the feature names in 'AnnotatedDataFrame'; a
          synonym for 'sampleNames'.

     '_s_a_m_p_l_e_N_a_m_e_s(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)', '_s_a_m_p_l_e_N_a_m_e_s(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)<-<_A_N_Y>': 
          Set and retrieve the sample names in 'AnnotatedDataFrame'

     '_v_a_r_L_a_b_e_l_s(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)', '_v_a_r_L_a_b_e_l_s(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)<-<_d_a_t_a._f_r_a_m_e>': 
          Set and retrieve the variable labels in the
          'AnnotatedDataFrame'

      '_d_i_m_L_a_b_e_l_s(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)', '_d_i_m_L_a_b_e_l_s(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>) <- <_c_h_a_r_a_c_t_e_r>' 
          Retrieve labels used for display of 'AnnotatedDataFrame',
          e.g., 'rowNames', 'columnNames'.

     Standard generic methods:

     '_i_n_i_t_i_a_l_i_z_e(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)': Object instantiation, used by
          'new'; not to be called directly by the user.

     '_a_s(<_d_a_t_a._f_r_a_m_e>, "_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e")': Convert a 'data.frame'
          to an AnnotatedDataFrame.

     '_a_s(<_p_h_e_n_o_D_a_t_a>,<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)': Convert old-style
          'phenoData-class' objects to 'AnnotatedDataFrame', issuing
          warnings as appropriate.

     '_v_a_l_i_d_O_b_j_e_c_t(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)': Validity-checking method,
          ensuring coordination between 'data' and 'varMetadata'
          elements

     '_u_p_d_a_t_e_O_b_j_e_c_t(_o_b_j_e_c_t, ..., _v_e_r_b_o_s_e=_F_A_L_S_E)' Update instance to
          current version, if necessary. See 'updateObject'

     '_i_s_C_u_r_r_e_n_t(_o_b_j_e_c_t)' Determine whether version of object is
          current. See 'isCurrent'

     '_i_s_V_e_r_s_i_o_n_e_d(_o_b_j_e_c_t)' Determine whether object contains a
          'version' string describing its structure . See 'isVersioned'

     '_s_h_o_w(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)' Abbreviated display of object

     '[<_s_a_m_p_l_e>,<_v_a_r_i_a_b_l_e>': Subset operation, taking two arguments and
          indexing the sample and variable. Returns an
          'AnnotatedDataFrame', i.e., including relevant metadata.
          Unlike a 'data.frame', setting 'drop=TRUE' generates an
          error. 

     '[[<_s_a_m_p_l_e>', '$<_s_a_m_p_l_e>': Selector returning a sample and
          measured variables.

     '[[<-<_n_e_w__s_a_m_p_l_e>', '$<-<_n_e_w__s_a_m_p_l_e>': Replace a sample row of
          data.

     '_d_i_m(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)', '_n_c_o_l(<_A_n_n_o_t_a_t_e_d_D_a_t_a_F_r_a_m_e>)': Number
          of samples and variables ('dim') and variables ('ncol') in
          the argument.

_A_u_t_h_o_r(_s):

     V.J. Carey, after initial design by R. Gentleman

_S_e_e _A_l_s_o:

     'eSet', 'ExpressionSet', 'read.AnnotatedDataFrame'

_E_x_a_m_p_l_e_s:

     df <- data.frame(x=1:6,
                      y=rep(c("Low", "High"),3),
                      z=I(LETTERS[1:6]),
                      row.names=paste("Sample", 1:6, sep="_"))
     metaData <-
       data.frame(labelDescription=c(
                    "Numbers",
                    "Factor levels",
                    "Characters"))
                            
     new("AnnotatedDataFrame")
     new("AnnotatedDataFrame", data=df)
     new("AnnotatedDataFrame",
         data=df, varMetadata=metaData)

     as(df, "AnnotatedDataFrame")

     obj <- new("AnnotatedDataFrame")
     pData(obj) <- df
     varMetadata(obj) <- metaData
     validObject(obj)

