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")
                                     
             

