Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gb2fasta

Conversion of GenBank file into fasta file


Description

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

Usage

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

Examples

myGenBankFile <- system.file("sequences/ct.gbk.gz", package = "seqinr")
  #myFastaFileName <- "Acinetobacter_ADP1_uid61597.fasta"
  myFastaFileName <-tempfile(pattern = "Acinetobacter_ADP1_uid61597", 
   tmpdir = tempdir(), fileext = "fasta")
  tempdir(check = FALSE)
  gb2fasta(myGenBankFile, myFastaFileName)
  readLines(myFastaFileName)[1:5]
  #
  # Should be :
  #
  # [1] ">CHLTCG 1042519 bp"                                          
  # [2] "gcggccgcccgggaaattgctaaaagatgggagcaaagagttagagatctacaagataaa"
  # [3] "ggtgctgcacgaaaattattaaatgatcctttaggccgacgaacacctaattatcagagc"
  # [4] "aaaaatccaggtgagtatactgtagggaattccatgttttacgatggtcctcaggtagcg"
  # [5] "aatctccagaacgtcgacactggtttttggctggacatgagcaatctctcagacgttgta"
  #

seqinr

Biological Sequences Retrieval and Analysis

v4.2-16
GPL (>= 2)
Authors
Delphine Charif [aut], Olivier Clerc [ctb], Carolin Frank [ctb], Jean R. Lobry [aut, cph], Anamaria Necşulea [ctb], Leonor Palmeira [ctb], Simon Penel [cre], Guy Perrière [ctb]
Initial release
2022-05-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.