gffUtilities: gff utilities functions

gff UtilitiesR Documentation

gff utilities functions

Description

gff attributes parsing

Usage

  ezGffAttributeField(x, field, attrsep = ";", valuesep = "=")

Arguments

x

character(n): attribute columns of gtf/gff file.

field

character(1): the field in attribute to extract

attrsep

character(1): the separation character in attribute. “;” in gff file and “; ” in gtf file.

valuesep

character(1): the separation character between values in attribute. “=” in gff file and “ ” in gtf file.

Value

A vector of character for the field.

Author(s)

Ge Tan

References

http://www.ensembl.org/info/website/upload/gff.html

See Also

ezReadGff

Examples

  ## Not run: 
    ## gtf
    gtf <- ezReadGff(system.file("extdata/genes.gtf", package="ezRun", 
                                 mustWork=TRUE))
    transcript_id <- ezGffAttributeField(gtf$attributes, field="transcript_id", 
                                         attrsep="; *", valuesep=" ")
    gene_id <- ezGffAttributeField(gtf$attributes, field="gene_id", 
                                   attrsep="; *", valuesep=" ")
    
    ## gff
    gff <- ezReadGff("/srv/GT/reference/Ca.Chlamydia_sanzinia_2742-308/NCBI/CP014639.1/Annotation/Version-2016-11-18/Genes/CP014639.gff3")
    IDs <- ezGffAttributeField(gff$attributes, field="ID", 
                               attrsep=";", valuesep="=")
  
## End(Not run)

uzh/ezRun documentation built on April 19, 2024, 8:25 a.m.