[Biojava-l] GCG format...

Andrew Macgregor andrew@anatomy.otago.ac.nz
Fri, 11 Oct 2002 16:58:02 +1300


Hi all,

I see from the mailing list archive that there was mention of someone
creating a GCG format for BioJava. Did this happen? Is it necessary? I'm
interested in seeing how to convert from one format to another a bit like I
could with this bioperl script. Is something like this possible. I can see
how to use Embl, Genbank and Fasta but not GCG.

TIA for any pointers.


use Bio::SeqIO;

my $in  = Bio::SeqIO->new(-file => "$ARGV[0]" , '-format' => 'Fasta');

# number for files
my $i=1;

while ( my $seq = $in->next_seq() ) {

    my $out = Bio::SeqIO->new(-file => ">$i.seq" , '-format' => 'gcg');
    $out->write_seq($seq);

    $i++;
}


Cheers, Andrew.