bed2featuretab: Converts a BED file of annotations into a GenBank feature...

View source: R/bed2featuretab.R

bed2featuretabR Documentation

Converts a BED file of annotations into a GenBank feature table.

Description

The GenBank feature table is a 5 column table that is used to submit annotations to GenBank (www.ncbi.nlm.nih.gov/WebSub/html/help/feature-table.html). This function takes a BED file of annotations and converts it into the feature table format for GenBank submission.

Usage

bed2featuretab(bedFiles, featureRef, outFile)

Arguments

bedFiles

Character: A vector of BED file names to process.

featureRef

Data.table: This contains the list of features that are to be mapped against the annotations in BED format. Requires 3 columns:

  1. $NAME, the name of the feature, which matches the 4th column of the BED file.

  2. $FEATURE, the type of feature, e.g., 'gene', 'tRNA', or 'misc_feature'.

  3. $DETAIL, the details to accompany the feature, which could be the gene or product name, or notes to attach to misc_features.

outFile

Character: The output file name for the feature table.

Details

At this stage, the function's use is largely limited to simple annotations of complete seqeunces and is restricted to genes, mRNA, tRNA, rRNA, and misc_features. Coding of partial sequences and more complex annotations may be added in the future.

Value

Writes the feature table to file.

Examples

library(genomalicious)

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

# We will create a feature table of gene and coding sequences for the protein-coding
# genes from the Bathygobius cocosensis mitogenome.
bcocoFtRefs <- fread(paste0(genomaliciousExtData, '/data_Bcocosensis_mito_features.csv'))
bcocoBedPath <- paste0(genomaliciousExtData, '/data_Bcocosensis_mito_annots.bed')

# Take a look
bcocoFtRefs
bcocoBedPath
readLines(bcocoBedPath)

# Run
bed2featuretab(bcocoBedPath, bcocoFtRefs, 'Bcoco_feature_table.txt')


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