Skip to content

Instantly share code, notes, and snippets.

Created April 28, 2011 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/945944 to your computer and use it in GitHub Desktop.
Save anonymous/945944 to your computer and use it in GitHub Desktop.
$seqio_object = Bio::SeqIO->new(-file => 'test1.txt',
-format => 'EMBL',
-alphabet => 'dna');
while ($seq_object = $seqio_object->next_seq){
@cds_features = grep { $_->primary_tag eq 'CDS' } $seq_object ->get_SeqFeatures;
%gene_sequences = map {$_->get_tag_values('gene'), $_->spliced_seq->seq } @cds_features;
foreach( keys %gene_sequences ) {
$gene_sequences{$_} =~ s/A/G/g;
}
}
$seqio_obj = Bio::SeqIO->new(-file => '>test_final.txt', -format => 'EMBL' );
$seqio_obj->write_seq($seq_object);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment