getGffAttribute       package:genomeIntervals       R Documentation

_P_u_l_l _o_n_e _o_r _m_o_r_e _k_e_y/_v_a_l_u_e _p_a_i_r_s _f_r_o_m _g_f_f_A_t_t_r_i_b_u_t_e_s _s_t_r_i_n_g_s

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

     GFF files contain a string, with key/value pairs separated by ;,
     and the key and value separated by =. This function quickly
     extracts one or more key/value pairs.

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

     getGffAttribute(gi, attribute)

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

      gi: A 'Genome_intervals' object.

attribute: A vector of key names.

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

     A matrix with the same number of rows as 'gi', and one column per
     element of 'attribute'.

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

     See 'parseGffAttributes' for more complete parsing. See the
     function 'readGff3' for loading a GFF file.

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

     # Get file path
     libPath <- installed.packages()["genomeIntervals", "LibPath"]
     filePath <- file.path(
                        libPath,
                        "genomeIntervals",
                        "example_files"
                        )

     # Load gff
     gff <- readGff3( file.path( filePath, "sgd_simple.gff"), isRightOpen=FALSE)

     ## head of full gff annotations
     head(annotation(gff))

     # extract ID and Parent attributes
     idpa = getGffAttribute( gff, c( "ID", "Parent" ) )

     head(idpa)

