translateSampleNames     package:GeneRegionScan     R Documentation

_T_r_a_n_s_l_a_t_e _s_a_m_p_l_e _n_a_m_e_s _u_s_i_n_g _t_r_a_n_s_l_a_t_i_o_n _f_i_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     Function that will change sample names in an ExpressionSet using a
     translation file.

_U_s_a_g_e:

         translateSampleNames(object, translationFile, from, to)

_A_r_g_u_m_e_n_t_s:

  object: An ExpressionSet

translationFile: Character string with the path to a tab-separated text
          file with translations of names. Alternatively a data frame
          containing translation information.

    from: Character string with the translationFile column name
          containing the values to translate from.

      to: Character string with the translationFile column name
          containing the values to translate to.

_D_e_t_a_i_l_s:

     Function that can translate the sampleNames of an ExpressionSet
     when given translation information. The translationFile argument
     gives the translation between sampleNames as they are and the
     sampleNames as they should be.  It can either be a character
     string with the path to a tab-separated text-file with headers or
     a directly a data frame with the necessary information. The
     variables 'from' and 'to' specify the column names that contains
     the translation information. They must be present in the
     translationFile and the entries in 'from' must be present in the
     sampleNames of the  current ExpressionSet. Extra entries in the
     translationFile are omitted but samples in the ExpressionSet
     without  samples in the translationFile will raise an error.

     This package is particularly useful after running cel-files
     through the Affymetrix Power Tools  (with getLocalProbeIntensities
     for example), since this program has a tendency to change any odd 
     character in the filename to something else.

_V_a_l_u_e:

     The same ExpressionSet given as argument, but with sampleNames
     changed as specified in translationFile

_A_u_t_h_o_r(_s):

     Lasse Folkersen

_E_x_a_m_p_l_e_s:

             data(exampleProbeLevelSet)
             
             fromThese<-sampleNames(exampleProbeLevelSet)
             
             toThese<-sub(".cel","", sampleNames(exampleProbeLevelSet))
             toThese<-sub("X","", toThese)
             

             translationFile<-cbind(fromThese, toThese)
             translationFile<-as.data.frame(translationFile)
             
             translateSampleNames(exampleProbeLevelSet, translationFile, from="fromThese", to="toThese")
                                     
             

