Conversion of GenBank file into fasta file

Share:

Description

Converts a single entry in GenBank format into a fasta file.

Usage

1
gb2fasta(source.file, destination.file)

Arguments

source.file

GenBank file

destination.file

Fasta file

Details

Multiple entries in GenBank file are not supported.

Value

none

Author(s)

J.R. Lobry

References

citation("seqinr")

See Also

oriloc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  myGenBankFile <- system.file("sequences/ct.gbk.gz", package = "seqinr")
  myFastaFileName <- "Acinetobacter_ADP1_uid61597.fasta"
  gb2fasta(myGenBankFile, myFastaFileName)
  readLines(myFastaFileName)[1:5]
  #
  # Should be :
  #
  # [1] ">CHLTCG 1042519 bp"                                          
  # [2] "gcggccgcccgggaaattgctaaaagatgggagcaaagagttagagatctacaagataaa"
  # [3] "ggtgctgcacgaaaattattaaatgatcctttaggccgacgaacacctaattatcagagc"
  # [4] "aaaaatccaggtgagtatactgtagggaattccatgttttacgatggtcctcaggtagcg"
  # [5] "aatctccagaacgtcgacactggtttttggctggacatgagcaatctctcagacgttgta"
  #

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.