Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • buthercup_ch
    Member
    • Apr 2014
    • 41

    .gb to .ffa by using R Bioconductor

    Hi everyone,

    Experimentalist trying to get introduced to some basic bioinformatics, I've recently started to use R Bioconductor, but getting quite lost yet.
    I'm would like to use this new skills to convert a Genebank file (.gbk) downloaded from ncbi, to a multifasta file containing all genes, nucleotides (.ffn), so it would be great if any now can give me the exact script I have to use:

    1) Import the .gb file
    2) transform .bg to .ffn
    3) Export .ffn to tab file (so I can open it using textedit)

    I know is kind of very basics, but thank you in advance.

    Cristina
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #2
    This is easier in biopython:

    Code:
    #!/usr/bin/env python
    from Bio import SeqIO
    outfile = open("output.fa", "w") #Change the output name
    for record in SeqIO.read("somefile.gb", "genbank") : #Change the input name
        SeqIO.write(record, outfile, "fasta")
    outfile.close()
    Something like that should work.

    Comment

    • buthercup_ch
      Member
      • Apr 2014
      • 41

      #3
      Hi Ryan, thanks for you answer… but I don't know how to work in Python.
      Should I tape in the Linux terminal?


      Anyway I think I found this script anywhere else, but this is for transforming to "fasta" and I need "ffn".

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        Yes, though you'll need to install the biopython package on your computer as well as just python, which should already be there. If you're typing things in manually, then you can skip the first line (#!/usr/bin/env python). You'll find a basic fluency on python to be rather important in bioinformatics (knowing python and R is sufficient for most things).

        Comment

        • dpryan
          Devon Ryan
          • Jul 2011
          • 3478

          #5
          BTW, ffn is fasta.

          Comment

          • buthercup_ch
            Member
            • Apr 2014
            • 41

            #6
            I know "ffn" is fasta… :-) but multifasta.
            As fas as I understood the fasta format output in python is a unique sequence, the whole genome, from the genbank file, but ffn contains multiple sequences from all genes in the genome.
            Am I right?

            Comment

            • dpryan
              Devon Ryan
              • Jul 2011
              • 3478

              #7
              Python will happily write a multifasta file

              Comment

              • buthercup_ch
                Member
                • Apr 2014
                • 41

                #8
                Really? Oh, that's good then.
                I will look to use python.
                Thanks a lot Ryan!

                Comment

                • maubp
                  Peter (Biopython etc)
                  • Jul 2009
                  • 1544

                  #9
                  See also http://www.warwick.ac.uk/go/peter_co...genbank2fasta/ which discusses converting GenBank to FASTA with Biopython in more detail - including how to pull out the gene sequences.

                  Comment

                  Latest Articles

                  Collapse

                  • GATTACAT
                    Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                    by GATTACAT
                    Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
                    07-01-2026, 11:43 AM
                  • SEQadmin2
                    Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                    by SEQadmin2


                    I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

                    Here are nine questions we think about, in roughly the order they matter, before...
                    06-18-2026, 07:11 AM

                  ad_right_rmr

                  Collapse

                  News

                  Collapse

                  Topics Statistics Last Post
                  Started by SEQadmin2, 07-02-2026, 11:08 AM
                  0 responses
                  25 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 06-30-2026, 05:37 AM
                  0 responses
                  23 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 06-26-2026, 11:10 AM
                  0 responses
                  23 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 06-17-2026, 06:09 AM
                  0 responses
                  55 views
                  0 reactions
                  Last Post SEQadmin2  
                  Working...