Module:Bio::Assembly::IO

From BioPerl
Jump to: navigation, search
Bio::Assembly::IO
PDoc Bio::Assembly::IO
CPAN Bio::Assembly::IO
metaCPAN Bio::Assembly::IO


The new method returns a A Bio::Assembly::IO handler initialised with the appropriate format. The next_assembly method on the handler returns a Bio::Assembly::ScaffoldI compliant object (typically just a Bio::Assembly::Scaffold).

The assembly formats currently supported are:


Example usage

The demonstration script below can be viewed in overview like this:

#!/usr/bin/perl -w
 
use Bio::Assembly::IO;
 
## Get an 'Assembly IO' object
my $assemIO = Bio::Assembly::IO->
  new( -file => 'my.assembly.ace',
       -format => 'ACE');
 
## Get the individual Assembly objects from the file
## (via the Assembly IO object)
while(my $assem = $assemIO->next_assembly){
  ## $assem is a Bio::Assembly::ScaffoldI compliant object
 
  #print "$assem\n";
  print "there are ", $assem->get_nof_contigs,
    " contigs in this assembly\n";
 
  foreach my $contig ($assem->all_contigs){
    ## $contig is a Bio::Assembly::Contig
 
    #print "\t$contig\n";
    print "\tthere are ", $contig->no_sequences,
      " sequences in this contig\n";
 
    foreach my $seq ($contig->each_seq){
      ## $seq is a Bio::LocatableSeq object
 
      #print "\t\t$seq\n";
 
      ## Get the "gapped consensus" location for aligned sequence
      my $feature =
        $contig->get_seq_coord( $seq );
      ## $feature is a Bio::SeqFeature::Generic
 
      ## I'd really like to print the aligned region, not the whole
      ## sequence region!
 
      print
        join("\t",
             $seq->id,
             $seq->strand,
             $seq->start,
             $seq->end,
             $feature->start,
             $feature->end,
            ), "\n";
    }
  }
}
 
warn "OK\n";
Personal tools
Namespaces
Variants
Actions
Main Links
documentation
community
development
Toolbox