Skip to content

Instantly share code, notes, and snippets.

Created June 10, 2011 13:46
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/1018851 to your computer and use it in GitHub Desktop.
Save anonymous/1018851 to your computer and use it in GitHub Desktop.
Aeembly parsing
sub parseAssembly{
use Bio::Assembly::IO;
# Load a reference ACE assembly
my $aio = Bio::Assembly::IO->new( -file => "output.all.cap.ace", -format => 'ace');
my $assembly = $aio->next_assembly;
foreach my $contig ($assembly->all_contigs) {
print $contig->id . "(" . $contig->get_consensus_length . "b)" . ":\n";
foreach my $seq ( $contig->each_seq ) {
# $seq is a Bio::LocatableSeq object
# $feature is a Bio::SeqFeature::Generic
my $feature = $contig->get_seq_coord($seq);
print "\t" . $seq->id . "\t" . $feature->start . "\t" . $feature->end . "\n";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment