parseGffAttributes      package:genomeIntervals      R Documentation

_P_a_r_s_e _o_u_t _t_h_e _g_f_f_A_t_t_r_i_b_u_t_e_s _c_o_l_u_m_n _o_f _a _G_e_n_o_m_e__i_n_t_e_r_v_a_l_s _o_b_j_e_c_t

_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 parses such
     strings into a list of vectors with named elements.

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

     parseGffAttributes(gi)

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

      gi: A 'Genome_intervals' object.

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

     A list, with one element per row of 'gi'. Each element is a
     character vector with named components. Names correspond to keys,
     and components correspond to values.

_N_o_t_e:

     Key/value pairs which are missing the = symbol, or which have
     nothing between it and the ; delimiter or end of line, will
     generate a 'NA' value, with a warning. Any key/value pairs with
     more than one = cause an error.

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

     In many cases, 'getGffAttribute', in this package, is easier and
     faster. 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 and parse attributes
     gff <- readGff3( file.path( filePath, "sgd_simple.gff"), isRightOpen = FALSE )
     gfatt <- parseGffAttributes(gff)

     head( gfatt )

