<<

NAME

Sanger::CGP::Vagrent::Annotators::AnnotatorCollection - Convienience class for running annotation over a variety of input data types

DESCRIPTION

This is a aggregator class, it holds several annotators and runs them one at a time over any submitted variation. It does none of the annotation work itself, it simply combines the answers of the other annotators it knows about. It extends Sanger::CGP::Vagrent::Annotators::AbstractAnnotator to keep the same interface.

It uses the same constructor as the AbstractAnnotator, however it doesn't need to be given a TranscriptSource as it won't be doing any actual annotating. However it should be used for Bookmarking. By adding Bookmarkers to the AnnotatorCollection, results from each contained Annotator will be collated together and then bookmarked as a single list. Bookmarking separately in each child Annotator will result in duplicate answers for the same bookmark type.

METHODS

Constructor

new

Usage :
 my $source = Sanger::CGP::Vagrent::Annotators::AnnotatorCollection->new(%params);
Function :

Builds a new Sanger::CGP::Vagrent::Annotators::AnnotatorCollection

Returns :

Sanger::CGP::Vagrent::Annotators::AnnotatorCollection object, optionally initialised with Bookmarkers

Params :

Hash of parameter values

 bookmarker       => (Optional) An array reference of, or single, Sanger::CGP::Vagrent::Bookmarkers::AbstractBookmarker inheriting object
 only_bookmarked  => (Optional) Boolean, only return annotations that get bookmarked

Functions

addAnnotator

Usage :
 $AnnotatorCollection->addAnnotator($substitutionAnnotator);
 $AnnotatorCollection->addAnnotator($insertionAnnotator);
 $AnnotatorCollection->addAnnotator($deletionAnnotator);
Function :

Adds a new child Annotator to the collection. Every variant given to the collection will be sent to every child Annotator in turn.

Returns :

Nothing

Params :

A Sanger::CGP::Vagrent::Annotators::AbstractAnnotator inheriting object

getMessages

Usage :
 my @mess = $annotator->getMessages();
Function :

Retrieves the messages from all child Annotators and returns them as a single message list

Returns :

Array of Strings

<<