Bio::Polloc::TypingI - Generic typing interface
Use this interface to initialize the Bio::Polloc::Typing::* objects. Any rule inherits from this Interface. Usually, rules are initialized from files (via the Bio::Polloc::TypingIO package).
Email lrr at cpan dot org
Bio::Polloc::Polloc::Root
Methods provided by the package
Attempts to initialize a Bio::Polloc::Typing::* object
Bio::Polloc::Typing::*
Arguments
The typing method. For further description of the different type, see:
Li, W., Raoult, D., & Fournier, P.-E. (2009). Bacterial strain typing in the genomic era. FEMS Microbiology Reviews, 33(5), 892-916.
http://www.mendeley.com/research/bacterial-strain-typing-in-the-genomic-era/.
One of:
"DNA banding pattern-based methods which classify bacteria according to the size of fragments generated by amplification and/or enzymatic digestion of genomic DNA" (Li et al 2009)
Same of bandingPattern, but specifying fragments generated by amplification.
bandingPattern
Same of bandingPattern, but specifying fragments generated by enzymatic digestion.
"DNA sequencing-based methods, which study the polymorphism of DNA sequences" (Li et al 2009)
"DNA hybridization-based methods using nucleotidic probes" (Li et al 2009)
Group of loci (Bio::Polloc::LociGroup) to be use for typing.
Returns
The Bio::Polloc::Typing::* object
Throws
Bio::Polloc::Polloc::Error if unable to initialize the proper object
Gets/sets the type of typing method
Value (str). See new and the corresponding Bio::Polloc::Typing::* objects for further details.
Some variations can be introduced, like case variations or short versions like banding or seq.
Return
Value (str). The typing method, or undef if undefined. The value returned is undef or a string from the above list, regardless of the input variations.
undef
Bio::Polloc::Polloc::Error if an unsupported type is received.
Sets/gets the group of loci to be used.
A Bio::Polloc::LociGroup object (optional).
A Bio::Polloc::LociGroup object or undef.
Generates a matrix of values for the given group of loci.
The group of loci to be used as base. If not provided, attempts to find the last value returned by scan. If never called (or not cached by the implementation) looks for the base loci (setted via locigroup or at initialization). If everything fails to provide a base group of loci, warns about it and returns undef.
If true, returns a binary matrix (presence/absence) instead of the native typing value.
If true, returns a hash with the names of the genomes as keys instead of an array.
A reference to an array or a hash (if -names is true). The key correspond to the incremental number or the name of the genomes, and the values can be either numeric or an array of numeric values, depending on the typing_value implemented by the genotyping method. If -binary is true, the values are always 0 or 1, regardless of the typing method.
-names
-binary
Alias of matrix with -binary true.
Returns a GD::Simple object containing the graphic representation of the typing results.
The group to be used as a basis. If any, attempts to locate the last value returned by scan. If never called, looks for the value stored via locigroup or at initialization. Otherwise, warns about it and returns undef,
Width of the image in pixels. 600 by default.
Height of the image in pixels. 300 by default.
Font of the text in the image (if any). 'Times' by default, but certain images require a TrueType Font in order to work properly. This argument is optional, but we strongly reccomend to provide the path to Lucida Sans Regular, or any other similar TrueType Font.
A GD::Simple object.
Synopsis
# ... $typing->scan($lociGroup); my $graph = $typing->graph(-font=>'/path/to/LucidaSansRegular.ttf'); if($graph){ open IMG, ">", "graph.png" or die "I can not open graph.png: $!\n"; binmode IMG; print IMG $graph->png; close IMG; }
Methods that should be implemented by objects using this interface as base. All the methods in this section can throw Bio::Polloc::Polloc::NotImplementedException if not implemented.
Scans the genomes using the specified loci as base.
Loci to use as genotyping base. Optional if provided via locigroup or at initialization.
A Bio::Polloc::LociGroup object containing the actual loci employed for typing.
Clusters the genomes based on the provided loci.
The base group of loci. Same behavior as matrix.
A Bio::Tree object.
Provides a value for the passed loci associated with the typing method.
The loci to be evaluated. Note that it is a reference array of Bio::Polloc::LocusI objects, and NOT a Bio::Polloc::LociGroup. This is because all the loci are expected to be part of the same genome, and the same group (if grouped). This argument is mandatory.
A numeric value or a reference to an array of numeric values, depending on the genotyping method.
Methods intended to be used only witin the scope of Bio::Polloc::*
Gets/sets the group of loci after scanning. This should be called at the end of all the implementations of scan.
To install Bio::Polloc, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::Polloc
CPAN shell
perl -MCPAN -e shell install Bio::Polloc
For more information on module installation, please visit the detailed CPAN module installation guide.