Created
June 10, 2011 13:46
-
-
Save anonymous/1018851 to your computer and use it in GitHub Desktop.
Aeembly parsing
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
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