mitoGbk2DT: Convert a mitogenome GENBANK file into a data table

View source: R/mitoGbk2DT.R

mitoGbk2DTR Documentation

Convert a mitogenome GENBANK file into a data table

Description

This function reads in a GENBANK file and outputs an R data.table object. It has been written for the import of mitogenome data into R, but could be used for importing other GENBANK files but is not rigorously tested.

Usage

mitoGbk2DT(
  genbankFile,
  type_vec = c("gene", "CDS", "tRNA", "rRNA", "D-loop", "misc_feature")
)

Arguments

genbankFile

Character: the path to the GENBANK file.

type_vec

Character: a vector of features to extract. The default value has been set to extract the major elements of mitochondrial genomes, but it could be edited to extract other features. Default is c('gene', 'CDS', 'tRNA', 'rRNA', 'D-loop', 'misc_feature').

Value

Returns a data.table with the following columns:

  1. $NAME = The name of the genetic feature.

  2. $TYPE = The type of genetic feature.

  3. $STRAND = Is given a 1 for the reported strand, and a -1 if it is on the complementary strand.

  4. $START = The starting base position.

  5. $END = The end base position.

Examples

library(genomalicious)

# Create a link to raw external datasets in genomalicious
genomaliciousExtData <- paste0(find.package('genomalicious'), '/extdata')

# Read in a GENBANK file
gbk.read <- mitoGbk2DT(paste(genomaliciousExtData, 'data_Bcocosensis_mitogenome.gbk', sep='/'))
gbk.read


j-a-thia/genomalicious documentation built on Oct. 19, 2024, 7:51 p.m.