NAME
Bio::Assembly::IO::ace - module to load ACE files from various assembly programs
SYNOPSIS
# Building an input streamuse Bio::Assembly::IO;# Load a reference ACE assemblymy $in_io = Bio::Assembly::IO->new( -file => 'results.ace',-format => 'ace' );# Read the entire scaffoldmy $scaffold = $in_io->next_assembly;# Or read one contig at a time to save resourceswhile ( my $contig = $in_io->next_contig ) {# Do something ...}# Assembly writing methodsmy $out_io = Bio::Assembly::IO->new( -file => ">output.ace",-format => 'ace' );$out_io->write_assembly( -scaffold => $scaffold,-singlets => 1 );# Read the '454' Newbler variant of ACE instead of the default 'consed'# reference ACE variantmy $in_io = Bio::Assembly::IO->new( -file => 'results.ace',-format => 'ace-454' );# or ...my $in_io = Bio::Assembly::IO->new( -file => 'results.ace',-format => 'ace',-variant => '454' );
DESCRIPTION
This package loads the standard ACE files generated by various assembly programs (Phrap, CAP3, Newbler, Arachne, ...). It was written to be used as a driver module for Bio::Assembly::IO input/output.
Implemention
Assemblies are loaded into Bio::Assembly::Scaffold objects composed by Bio::Assembly::Contig and Bio::Assembly::Singlet objects. Only the ACE file is used, so if you need singlets, make sure that they are present in the ACE file.
A brief description of the ACE format is available at http://www.cbcb.umd.edu/research/contig_representation.shtml#ACE Read the full format description from http://bozeman.mbt.washington.edu/consed/distributions/README.14.0.txt
In addition to default "_aligned_coord:$seqID" feature class from Bio::Assembly::Contig, contig objects loaded by this module will have the following special feature classes in their feature collection:
"_align_clipping:$seqID" (AF)
Location of subsequence in read $seqID which is aligned to the contig. The
coordinates are relative to the contig. If no feature containing this tag is
present the read is considered low quality by Consed.
"_quality_clipping:$seqID" (AF)
The location of high quality subsequence in read $seqID (relative to contig)
"_base_segments" (BS)
Location of read subsequences used to build the consensus
"_read_tags:$readID" (RT)
Sequence features stored as sub_SeqFeatures of the sequence's coordinate
feature (the corresponding "_aligned_coord:$seqID" feature, easily accessed
through get_seq_coord() method).
"_read_desc:$readID" (DS)
Sequence features stored as sub_SeqFeatures of the read's coordinate feature
"consensus tags" (CT)
Equivalent to a bioperl sequence feature and, therefore, are added to the
feature collection using their type field (see Consed's README.txt file) as
primary tag.
"whole assembly tags" (WA)
They have no start and end, as they are not associated to any particular
sequence in the assembly, and are added to the assembly's annotation
collection using "whole assembly" as tag.
Variants
The default ACE variant is called 'consed' and corresponds to the reference ACE format.
The ACE files produced by the 454 GS Assembler (Newbler) do not conform to the reference ACE format. In 454 ACE, the consensus sequence reported covers only its clear range and the start of the clear range consensus is defined as position 1. Consequently, aligned reads in the contig can have negative positions. Be sure to use the '454' variant to have positive alignment positions. No attempt is made to construct the missing part of the consensus sequence (beyond the clear range) based on the underlying reads in the contig. Instead the ends of the consensus are simply padded with the gap character '-'.
FEEDBACK
Mailing Lists
User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing lists Your participation is much appreciated.
[email protected] - General discussionhttp://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support
Please direct usage questions or support issues to the mailing list:
rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.
Reporting Bugs
Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:
https://github.com/bioperl/bioperl-live/issues
AUTHOR - Robson Francisco de Souza
Email [email protected]
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
Parser methods
next_assembly
Title : next_assemblyUsage : $scaffold = $stream->next_assembly()Function: returns the next assembly in the streamReturns : a Bio::Assembly::Scaffold objectArgs : none
next_contig
Title : next_contigUsage : $scaffold = $stream->next_contig()Function: Returns the next contig or singlet in the ACE stream.Returns : a Bio::Assembly::Contig or Bio::Assembly::Single objectArgs : none
scaffold_annotations
Title : scaffold_annotationsUsage : $stream->scaffold_annotations($scaffold)Function: Add assembly and contig annotations to a scaffold. In the ACE format,annotations are the WA and CT tags.Returns : 1 for successArgs : a Bio::Assembly::Scaffold object to attach the annotations to
write_assembly
Title : write_assemblyUsage : $ass_io->write_assembly($assembly)Function: Write the assembly object in ACE compatible format. The contig IDsare sorted naturally if the Sort::Naturally module is present, orlexically otherwise. Internally, write_assembly use thewrite_contig, write_footer and write_header methods. Use thesemethods if you want more control on the writing process.Returns : 1 on success, 0 for errorArgs : A Bio::Assembly::Scaffold object
write_contig
Title : write_contigUsage : $ass_io->write_contig($contig)Function: Write a contig or singlet object in ACE compatible format. Qualityscores are automatically generated if the contig does not containanyReturns : 1 on success, 0 for errorArgs : A Bio::Assembly::Contig or Singlet object
write_header
Title : write_headerUsage : $ass_io->write_header($scaffold)or$ass_io->write_header(\@contigs);or$ass_io->write_header();Function: Write ACE header (AS tags). You can call this function at any time,i.e. not necessarily at the start of the stream - this is usefulif you have an undetermined number of contigs to write to ACE, e.g:for my $contig (@list_of_contigs) {$ass_io->_write_contig($contig);}$ass_io->_write_header();Returns : 1 on success, 0 for errorArgs : A Bio::Assembly::Scaffoldoran arrayref of Bio::Assembly::Contigornothing (the header is dynamically written based on the ACE filecontent)
write_footer
Title : write_footerUsage : $ass_io->write_footer($scaffold)Function: Write ACE footer (WA and CT tags).Returns : 1 on success, 0 for errorArgs : A Bio::Assembly::Scaffold object (optional)
variant
Title : variantUsage : $variant = $ass_io->variant();Function: Get and set method for the assembly variant. This is important sincenot all assemblers respect the reference ACE format.Returns : stringArgs : string: 'consed' (default) or '454'
_write_read
Title : _write_readUsage : $ass_io->_write_read($read, $contig)Function: Write a read object in ACE compatible formatReturns : 1 on success, 0 for errorArgs : a Bio::LocatableSeq readthe Contig or Singlet object that this read belongs to
_formatted_seq
Title : _formatted_seqUsage : Bio::Assembly::IO::ace::_formatted_seq($sequence, $line_width)Function: Format a sequence for ACE output:i ) replace gaps in the sequence by the '*' charii) split the sequence on multiple lines as neededReturns : new sequence stringArgs : sequence string on one linemaximum line width
_formatted_qual
Title : _formatted_qualUsage : Bio::Assembly::IO::ace::_formatted_qual($qual_arr, $sequence, $line_width, $qual_default)Function: Format quality scores for ACE output:i ) use the default quality values when they are missingii ) remove gaps (they get no score in ACE)iii) split the quality scores on several lines as neededReturns : new quality score stringArgs : quality score array referencecorresponding sequence stringmaximum line widthdefault quality score
_input_qual
Title : _input_qualUsage : Bio::Assembly::IO::ace::_input_qual($qual_string, $sequence)Function: Reads input quality string and converts it to an array of qualityscores. Gaps get a quality score equals to the average of thequality score of its neighbours.Returns : new quality score arrayArgs : quality score stringcorresponding sequence string
_initialize
Title : _initializeUsage : $ass_io->_initialize(@args)Function: Initialize the Bio::Assembly::IO object with the proper ACE variantReturns :Args :