importGTF.Rd
This function loads GTF files into R and converts it into
a wrapper to rtracklayer::import() function to conveniently import GTF file into R as a GenomicRanges object.
importGTF(con)
Path to GTF file
Imported GenomicRanges object in GTF format
gtf <- system.file("extdata", "sc_merged_sample.gtf.gz", package = "factR")
importGTF(gtf)
#> GRanges object with 8117 ranges and 9 metadata columns:
#> seqnames ranges strand | source type score
#> <Rle> <IRanges> <Rle> | <factor> <factor> <numeric>
#> [1] chr15 3180731-3180944 * | StringTie transcript 1000
#> [2] chr15 3180731-3180944 * | StringTie exon 1000
#> [3] chr15 3217391-3219698 - | StringTie transcript 1000
#> [4] chr15 3217391-3219698 - | StringTie exon 1000
#> [5] chr15 3268547-3277274 + | StringTie transcript 1000
#> ... ... ... ... . ... ... ...
#> [8113] chr15 39922327-39924849 * | StringTie exon 1000
#> [8114] chr15 40326499-40326982 * | StringTie transcript 1000
#> [8115] chr15 40326499-40326982 * | StringTie exon 1000
#> [8116] chr15 40552598-40553130 * | StringTie transcript 1000
#> [8117] chr15 40552598-40553130 * | StringTie exon 1000
#> phase gene_id transcript_id exon_number gene_name
#> <integer> <character> <character> <character> <character>
#> [1] <NA> MSTRG.14523 MSTRG.14523.1 <NA> <NA>
#> [2] <NA> MSTRG.14523 MSTRG.14523.1 1 <NA>
#> [3] <NA> MSTRG.14524 ENSMUST00000227053.1 <NA> Gm7962
#> [4] <NA> MSTRG.14524 ENSMUST00000227053.1 1 Gm7962
#> [5] <NA> MSTRG.14525 ENSMUST00000160787.8 <NA> Selenop
#> ... ... ... ... ... ...
#> [8113] <NA> MSTRG.15020 MSTRG.15020.1 1 <NA>
#> [8114] <NA> MSTRG.15021 MSTRG.15021.1 <NA> <NA>
#> [8115] <NA> MSTRG.15021 MSTRG.15021.1 1 <NA>
#> [8116] <NA> MSTRG.15022 MSTRG.15022.1 <NA> <NA>
#> [8117] <NA> MSTRG.15022 MSTRG.15022.1 1 <NA>
#> ref_gene_id
#> <character>
#> [1] <NA>
#> [2] <NA>
#> [3] ENSMUSG00000114999.1
#> [4] ENSMUSG00000114999.1
#> [5] ENSMUSG00000064373.12
#> ... ...
#> [8113] <NA>
#> [8114] <NA>
#> [8115] <NA>
#> [8116] <NA>
#> [8117] <NA>
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths