-
-
Save anonymous/e50ef06c30f10de01298 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Bio::SeqIO; | |
my $file = shift; | |
# create reader for the input | |
my $seq_in = Bio::SeqIO->new( -file => $file, | |
-format => 'genbank' ); | |
my @entries; | |
while (my $contig = $seq_in->next_seq()){ | |
## do stuff | |
push @entries, $contig; | |
} | |
my $outfile = Bio::SeqIO->new( -file => ">out.gbk", | |
-format => 'genbank' ); | |
foreach my $contig (@entries){ | |
$outfile->write_seq($contig); | |
} | |
## Example for "do stuff" | |
#foreach my $feat ($contig->get_SeqFeatures()){ | |
# if($feat->primary_tag() eq 'CDS'){ | |
# my $feature_seq = $feat->seq(); | |
# print $feature_seq."\n"; | |
# } | |
#} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment