getSnpAnnotation           package:SNPchip           R Documentation

_R_e_t_r_i_e_v_e_s _S_N_P-_l_e_v_e_l _a_n_n_o_t_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     SNP-level annotation currently includes the db SNP identifier,
     chromosome, physical position, strand, and fragment length.

_U_s_a_g_e:

     getSnpAnnotation(object, ...)

_A_r_g_u_m_e_n_t_s:

  object: An object derived from 'eSet'.  

     ...: Additional arguments

_D_e_t_a_i_l_s:

     Currently, this function supports only Affymetrix 100k and 500k
     SNP chips.  The 'featureNames' in the 'eSet' object must be valid
     Affymetrix identifiers.  Two options exist for adding SNP-level
     annotation to an object:

     1. The default method is to use the annotation packages maintained
     by Bioconductor.   This is the preferred method as the annotation
     packages are continuously updated.  Using the default method
     requires that the annotation slot in the 'eSet' object be exactly
     identical to 1 of the 4 annotation packages currently provided:

     a. pd.mapping50k.hind240 b. pd.mapping50k.xba240 c.
     pd.mapping250k.nsp d. pd.mapping250k.sty

     Note that if the R package oligo was used to summarize genotype
     calls in the 'eSet' object, the annotation slot is already
     provided.

     2. Manually download the annotation provided by NetAffx and
     convert the file to an object of class 'AnnotatedDataFrame'.  The
     SNPs in the 'AnnotatedDataFrame' must be in the same order as the
     SNPs in the object derivied from 'eSet'.

_V_a_l_u_e:

     An object of class 'AnnotatedDataFrame'

_A_u_t_h_o_r(_s):

     Robert Scharpf

_R_e_f_e_r_e_n_c_e_s:

_S_e_e _A_l_s_o:

     'oligoSnpSet', 'AnnotatedDataFrame', 'annotation'

_E_x_a_m_p_l_e_s:

     ##Default method for adding SNP-level annotation

       data(annSnpset)
       obj <- new("AnnotatedSnpCopyNumberSet",
                  copyNumber=copyNumber(annSnpset)[1:50,],
                  cnConfidence=cnConfidence(annSnpset)[1:50,],
                  phenoData=phenoData(annSnpset), annotation=annotation(annSnpset))
       obj
     ## Not run: 
     ##Requires pd.mapping50k.xba240 annotation package
       snp.annotation <- getSnpAnnotation(obj)
       snp.annotation
       class(snp.annotation)
       identical(featureNames(obj), featureNames(snp.annotation))
       featureData(obj) <- snp.annotation
       validObject(obj)
       varLabels(featureData(obj))
     ## End(Not run)

     ##Using NetAffx annotation (already saved as a data.frame)
     ## Not run: 
       try(load(url("http://biostat.jhsph.edu/~iruczins/publications/sm/2006.scharpf.bioinfo/mapping/mapping50kXba240.rda")))
       reorderRows <- match(featureNames(obj), as.character(mapping50kXba240$Probe.Set.ID))
       netaffx.annotation <- mapping50kXba240[reorderRows, ]
       fD <- as(netaffx.annotation, "AnnotatedDataFrame")
       featureData(obj) <- fD
       varLabels(featureData(obj))
       validObject(obj)
     ## End(Not run)

