uk.ac.ebi.microarray.zooma.mapping
Class TextReportingMapper

java.lang.Object
  extended by uk.ac.ebi.microarray.zooma.mapping.TextReportingMapper
All Implemented Interfaces:
OntologyMapper

public class TextReportingMapper
extends java.lang.Object
implements OntologyMapper

A mapper implementation that generates a simple tab delimited text file mapping report.

This mapper is not fully thread-safe - it is designed for writing multiple outcomes to a single TextReportWriter, the lifecycle of which should be handled by the calling class. Whilst applying outcomes from parallel threads is likely to be safe, calling classes should take care to ensure that the ReportWriter has been initialized fully before commencing writing, and should take care to close down only once writing has finished.

This reporting mapper needs to be fully wired with it's subsystem dependencies before usage. Generally, this is easy to acheive for all reusable modules (evaluators, calculators, rankers, factories etc) but retrievers may change between requests. For this reason, there is a convenience method to supply new retrievers (addRetriever(uk.ac.ebi.microarray.zooma.retrieval.OntologyTermRetriever)) on the fly.

Author:
Tony Burdett

Constructor Summary
TextReportingMapper()
           
 
Method Summary
 void addRetriever(OntologyTermRetriever retriever)
          Add an ontology term retriever to use to generate mapping outcomes.
 void applyOutcome(OntologyMappingOutcome outcome)
          Assesses and applies, the given outcome.
 OntologyMappingOutcome generateOutcome(Value value)
          Generates an OntologyMappingOutcome given a description and a mapping context.
 OntologyMappingFormulator getAlternativeHypothesisFormulator()
           
 OntologyMappingEvaluator getEvaluator()
           
protected  org.slf4j.Logger getLog()
           
 OntologyMappingFormulator getNullHypothesisFormulator()
           
 boolean isReportingFails()
           
 void setAlternativeHypothesisFormulator(OntologyMappingFormulator alternativeHypothesisFormulator)
           
 void setEvaluator(OntologyMappingEvaluator evaluator)
           
 void setNullHypothesisFormulator(OntologyMappingFormulator nullHypothesisFormulator)
           
 void setReportingFails(boolean reportFails)
           
 void writeFailureOutcomesWith(TextReportWriter failureReportWriter)
           
 void writeOutcomesWith(TextReportWriter reportWriter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextReportingMapper

public TextReportingMapper()
Method Detail

getLog

protected org.slf4j.Logger getLog()

setNullHypothesisFormulator

public void setNullHypothesisFormulator(OntologyMappingFormulator nullHypothesisFormulator)

getNullHypothesisFormulator

public OntologyMappingFormulator getNullHypothesisFormulator()

setAlternativeHypothesisFormulator

public void setAlternativeHypothesisFormulator(OntologyMappingFormulator alternativeHypothesisFormulator)

getAlternativeHypothesisFormulator

public OntologyMappingFormulator getAlternativeHypothesisFormulator()

setEvaluator

public void setEvaluator(OntologyMappingEvaluator evaluator)

getEvaluator

public OntologyMappingEvaluator getEvaluator()

setReportingFails

public void setReportingFails(boolean reportFails)

isReportingFails

public boolean isReportingFails()

writeOutcomesWith

public void writeOutcomesWith(TextReportWriter reportWriter)

writeFailureOutcomesWith

public void writeFailureOutcomesWith(TextReportWriter failureReportWriter)

addRetriever

public void addRetriever(OntologyTermRetriever retriever)
Add an ontology term retriever to use to generate mapping outcomes. By default, no retrievers are setup, so outcomes will not map to anything. Add more retrievers to fetch terms from more resources.

Parameters:
retriever - the retriever to add to fetch terms from

generateOutcome

public OntologyMappingOutcome generateOutcome(Value value)
                                       throws BadOutcomeException
Description copied from interface: OntologyMapper
Generates an OntologyMappingOutcome given a description and a mapping context.

Specified by:
generateOutcome in interface OntologyMapper
Parameters:
value - the description requiring mapping
Returns:
the expected ontology mapping outcome for the given description in a context
Throws:
BadOutcomeException - if the outcome could not be generated due to an error

applyOutcome

public void applyOutcome(OntologyMappingOutcome outcome)
                  throws BadOutcomeException
Description copied from interface: OntologyMapper
Assesses and applies, the given outcome. Implementations are free to define the actions taken when an outcome is applied. The value and context originally being mapped from is supplied for the purposes of provenance tracking and logging

Specified by:
applyOutcome in interface OntologyMapper
Parameters:
outcome - the outcome to apply
Throws:
BadOutcomeException - if the outcome could not be applied


Copyright © 2010. All Rights Reserved.