1

I am quite new to Java and want to build a program that can convert a GenBank text file to FASTA format. Basically there will be two texboxes: one where I will upload the GenBank format file, and a second to show the converted FASTA format file.

This is a GenBank format file:

LOCUS       AB000263                 368 bp    mRNA    linear   PRI 05-FEB-1999
DEFINITION  Homo sapiens mRNA for prepro cortistatin like peptide, complete
            cds.
ACCESSION   AB000263
ORIGIN      
        1 acaagatgcc attgtccccc ggcctcctgc tgctgctgct ctccggggcc acggccaccg
       61 ctgccctgcc cctggagggt ggccccaccg gccgagacag cgagcatatg caggaagcgg
      121 caggaataag gaaaagcagc ctcctgactt tcctcgcttg gtggtttgag tggacctccc
      181 aggccagtgc cgggcccctc ataggagagg aagctcggga ggtggccagg cggcaggaag
      241 gcgcaccccc ccagcaatcc gcgcgccggg acagaatgcc ctgcaggaac ttcttctgga
      301 agaccttctc ctcctgcaaa taaaacctca cccatgaatg ctcacgcaag tttaattaca
      361 gacctgaa
//

and its corresponding FASTA format file is:

>AB000263 |acc=AB000263|descr=Homo sapiens mRNA for prepro cortistatin like peptide, complete cds.|len=368
ACAAGATGCCATTGTCCCCCGGCCTCCTGCTGCTGCTGCTCTCCGGGGCCACGGCCACCGCTGCCCTGCC
CCTGGAGGGTGGCCCCACCGGCCGAGACAGCGAGCATATGCAGGAAGCGGCAGGAATAAGGAAAAGCAGC
CTCCTGACTTTCCTCGCTTGGTGGTTTGAGTGGACCTCCCAGGCCAGTGCCGGGCCCCTCATAGGAGAGG
AAGCTCGGGAGGTGGCCAGGCGGCAGGAAGGCGCACCCCCCCAGCAATCCGCGCGCCGGGACAGAATGCC
CTGCAGGAACTTCTTCTGGAAGACCTTCTCCTCCTGCAAATAAAACCTCACCCATGAATGCTCACGCAAG
TTTAATTACAGACCTGAA

Can anybody help me with advice on how-to or code to trim the GenBank file and display it in the second textbox through a clicked button.

I am using Netbeans 6.9.

martin clayton
  • 76,436
  • 32
  • 213
  • 198
  • Have you tried anything? For example, google how to implement a gui in Java. – gigadot Sep 06 '12 at 15:54
  • the implementation of gui is alright but cant figure out how to trim the data and extract the one i need and reaarange in the right order – Sonal Akhal Sep 06 '12 at 16:07
  • Google [says](http://www.google.com/search?q=convert+genbank+to+fasta+java) choose a [converter](http://molbiol-tools.ca/Convert.htm). – trashgod Sep 06 '12 at 16:56

1 Answers1

4

I haven't used it, but The BioJava Project includes code to read a GenBank file that may contain more than one sequence. For display, see How Do I Print A Sequence in Fasta Format.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045