TRAMP                 package:TRAMPR                 R Documentation

_T_R_F_L_P _A_n_a_l_y_s_i_s _a_n_d _M_a_t_c_h_i_n_g _P_r_o_g_r_a_m

_D_e_s_c_r_i_p_t_i_o_n:

     Determine if TRFLP profiles may match those in a database of
     knowns.  The resulting object can be used to produce a
     presence/absence matrix of known profiles in environmental
     samples.

     The 'TRAMPR' package contains a vignette, which includes a worked
     example; type 'vignette("TRAMPRdemo")' to view it.

_U_s_a_g_e:

     TRAMP(samples, knowns, accept.error=1.5, min.comb=4, method="maximum")

_A_r_g_u_m_e_n_t_s:

 samples: A 'TRAMPsamples' object, containing unidentified samples.

  knowns: A 'TRAMPknowns' object, containing identified TRFLP patterns.

accept.error: The largest acceptable difference (in base pairs) between
          any peak in the sample data and the knowns database (see
          Details; interpretation will depend on the value of
          'method').

min.comb: Minimum number of enzyme/primer combinations required before
          presence will be tested.  The default (4) should be
          reasonable in most cases.  Setting 'min.comb' to 'NA' will
          require that all enzyme/primer combinations in the knowns
          database are present in the samples.

  method: Method used in calculating the difference between samples and
          knowns; may be one of '"maximum"', '"euclidian"' or
          '"manhattan"' (or any unambiguous abbreviation).

_D_e_t_a_i_l_s:

     'TRAMP' attempts to determine which species in the 'knowns'
     database _may_ be present in a collection of samples.

     A sample matches a known if it has a peak that is "close enough"
     to every peak in the known for every enzyme/primer combination
     that they share.  The default is to accept matches where the
     largest distance between a peak in the knowns database and the
     sample is less than 'accept.error' base pairs (default 2), and
     where at least 'min.comb' enzyme/primer combinations are shared
     between a sample and a known (default 4).

     The three-dimensional matrix of match errors is generated by
     'create.diffsmatrix'.  In the resulting array, 'm[i,j,k]' is the
     difference (in base pairs) between the 'i'th sample and the 'j'th
     known for the 'k'th enzyme/primer combination.

     If p_k and q_k are the sizes of peaks for the kth enzyme/primer
     combination for a sample and known (respectively), then maximum
     distance is defined as


                           max(|p_k - q_k|)


     Euclidian distance is defined as

                      sqrt(sum (p_k - q_k)^2)/n


     and Manhattan distance is defined as

                          sum(|p_k - q_k|)/n


     where n is the number of shared enzyme/primer combinations, since
     this may vary across sample/known combinations.  For Euclidian and
     Manhattan distances, 'accept.error' then becomes the _mean_
     distance, rather than the total distance.

_V_a_l_u_e:

     A 'TRAMP' object, with elements: 

presence: Presence/absence matrix.  Rows are different samples (with
          rownames from 'labels(samples)') and columns are different
          knowns (with colnames from 'labels(knowns)').  Do not access
          the presence/absence matrix directly, but use
          'summary.TRAMP', which provides options for labelling knowns,
          grouping knowns, and excluding "ignored" matches.

   error: Matrix of distances between the samples and known, calculated
          by one of the methods described above.  Rows correspond to
          different samples, and columns correspond to different
          knowns. The matrix dimension names are set to the values
          'sample.pk' and 'knowns.pk' for the samples and knowns,
          respectively.

       n: A two-dimensional matrix (same dimensions as 'error'),
          recording the number of enzyme/primer combinations present
          for each combination of samples and knowns.

diffsmatrix: Three-dimensional array of output from
          'create.diffsmatrix'.

enzyme.primer: Different enzyme/primer combinations present in the
          data, in the order of the third dimension of 'diffsmatrix'
          (see 'create.diffsmatrix' for details).

samples, knowns, accept.error, min.comb, method: The input data objects
          and arguments, unmodified.


     In addition, an element 'presence.ign' is included to allow
     matches to be ignored.  However, this interface is experimental
     and its current format should not be relied on - use
     'remove.TRAMP.match' rather than interacting directly with
     'presence.ign'.

     Matching is based only on peak size (in base pairs), and does not
     consider peak heights.

_S_e_e _A_l_s_o:

     See 'create.diffsmatrix' for discussion of how differences between
     sample and known profiles are generated.

     'plot.TRAMP', which displays TRAMP fits graphically.

     'summary.TRAMP', which creates a presence/absence matrix.

     'remove.TRAMP.match', which marks TRAMP matches as ignored.

_E_x_a_m_p_l_e_s:

     data(demo.knowns)
     data(demo.samples)

     res <- TRAMP(demo.samples, demo.knowns)

     ## The resulting object can be interrogated with methods:

     ## The goodness of fit of the sample with sample.pk=101 (see
     ## ?plot.TRAMP).
     plot(res, 101)

     ## Not run: 
     ## To see all plots (this produces many figures), one after another.
     op <- par(ask=TRUE)
     plot(res)
     par(op)
     ## End(Not run)

     ## Produce a presence/absence matrix (see ?summary.TRAMP).
     m <- summary(res)
     head(m)

