extract_field_from_gencode: Extract field from gencode GTF file

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/import_gencode.R

Description

Extract field from gencode GTF file

Usage

1
2
extract_field_from_gencode(file, level = "gene",
    primary_key = "gene_id", field = "gene_name")

Arguments

file

the input GTF file

level

level of the annotation (e.g. gene, transcript, exon, the third column in GTF file)

primary_key

primary field

field

field to be retrieved

Details

Although GTF file can be imported by e.g. makeTxDbFromGFF, some information in the original GTF file will not be imported. This function aims to extract additionally information from GTF file.

The function calls external Perl script, so you need to have Perl installed.

Value

A vector in which 'primary_key' corresponds to the name and 'field' corresponds to the value.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

See Also

available_gencode_fields lists all possible values for primary_key and field.

Examples

1
2
3
4
5
6
7
8
## Not run: 
download.file("ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/release_19/gencode.v19.annotation.gtf.gz",
    destfile = "gencode.v19.annotation.gtf.gz")
extract_field_from_gencode("gencode.v19.annotation.gtf.gz")
extract_field_from_gencode("gencode.v19.annotation.gtf.gz", field = "gene_type")

## End(Not run)
NULL

jokergoo/epik documentation built on Sept. 28, 2019, 9:20 a.m.