Public Member Functions | Static Public Attributes

MGT::PhageHostApp::PhageHostApp Class Reference

Inheritance diagram for MGT::PhageHostApp::PhageHostApp:
MGT::App::App

List of all members.

Public Member Functions

def makeOptionParserArgs
def parseCmdLinePost
def initWork
def doWork
def loadPhageHostDb
def buildDbPhageHost
def selectPhageHostPairs
def predict
def processImmScores
def compareWithProtAnnot
def plotContigAnnotGff
def performance
def getVirToHostPicked
def processPhymmScores

Static Public Attributes

tuple batchDepModes = ("predict","train")
 Derived classes should set this to a list of opt.mode values that can result in submision of new batch jobs.

Detailed Description

App-derived class for phage-host assignment

Member Function Documentation

def MGT::PhageHostApp::PhageHostApp::buildDbPhageHost (   self,
  kw 
)
Collect and save data about phage-host associations in RefSeq
def MGT::PhageHostApp::PhageHostApp::compareWithProtAnnot (   self,
  kw 
)
Compare our predicted host taxonomy with protein level annotations.
Annotations are loaded from a tab delimited file that maps hits from
various database searches onto predicted peptides, which are mapped
onto reads, which are in turn mapped onto phage contigs/scaffolds that we
used as input to predict the bacterial hosts.
The expectation is that we might see e.g. BLAST hits to phages with a known
host range, or to the hosts themselves.
Parameters are taken from self.opt.
@param contAnnot Input file with protein annotations projected onto viral contigs
@param predOutTaxa Output file with predicted taxa
def MGT::PhageHostApp::PhageHostApp::doWork (   self,
  kw 
)
Do the actual work.
Must be redefined in the derived classes.
Should not be called directly by the user except from doWork() in a derived class.
Should work with empty keyword dict, using only self.opt.
If doing batch submision of other App instances, must return a list of sink (final) BatchJob objects.

Reimplemented from MGT::App::App.

def MGT::PhageHostApp::PhageHostApp::getVirToHostPicked (   self )
Return {virNode->host} map from a DB of picked vir-host pairs
def MGT::PhageHostApp::PhageHostApp::initWork (   self,
  kw 
)
Perform common initialization right before doing the actual work in doWork().
Must be redefined in the derived classes.
Should not be called directly by the user except from initWork() in a derived class.
This one can create large objects because they are not passed through the batch submission,
but immediately used within the same process.

Reimplemented from MGT::App::App.

def MGT::PhageHostApp::PhageHostApp::loadPhageHostDb (   self )
Load and map Phage-Host DB into the taxaTree
def MGT::PhageHostApp::PhageHostApp::makeOptionParserArgs (   klass )
Return a Struct with optparse.OptionParser constructor arguments specific to the application.
The "option_list" attribute must be obtained with a sequence of calls to optparse.make_option.
Other possible attributes can be e.g. "usage".
This method will be called by parseCmdLine() and the returned "option_list" concatenated with the default
one provided by the parseCmdLine().
Must be redefined in the derived class only if there are any application specific command-line options.

Reimplemented from MGT::App::App.

def MGT::PhageHostApp::PhageHostApp::parseCmdLinePost (   klass,
  options,
  args,
  parser 
)
Optionally modify options and args in-place.
Called at the end of parseCmdLine to allow the derived classes customizing the option processing.
@param options options returned by OptionParser and converted to Struct object
@param args args returned by OptionParser
@param parser OptionParser object used to parse the command line - needed here to call its error() method
if necessary.
options should be modified in place by this method

Reimplemented from MGT::App::App.

def MGT::PhageHostApp::PhageHostApp::performance (   self,
  kw 
)
Evaluate the performance of predicting host taxonomy on the DB of known pairs.
Parameters are taken from self.opt.
@param predOutTaxa File with predicted taxa
@param perfOutTaxa Output file with performance metrics
@param predIdLab IdLabels file for the samples
def MGT::PhageHostApp::PhageHostApp::plotContigAnnotGff (   self,
  annRecs,
  outGraphFileRoot,
  gdFormat = "pdf" 
)
Generate GFF files and graphics based on protein annotation for viral contigs.
@param gdFormat file type for genomic digrams, one of "pdf","png","svg" 
(svg output in genometools (v.1.3.5) incorrectly clips a lot on the right side of the diagram)
def MGT::PhageHostApp::PhageHostApp::predict (   self,
  kw 
)
Predict host taxonomy for viral sequences.
Parameters are taken from self.opt.
@param predSeq Name of FASTA sequence file to classify
@param immDb Path to directory with IMMs
@param predOutDir Output directory for predictions
def MGT::PhageHostApp::PhageHostApp::processImmScores (   self,
  kw 
)
Process raw IMM scores to predict host taxonomy for viral sequences.
Parameters are taken from self.opt.
@param outScoreComb File with ImmScores object
@param rndScoreComb File with ImmScores object for random query sequences
@param predOutTaxa Output file with predicted taxa
def MGT::PhageHostApp::PhageHostApp::processPhymmScores (   self,
  kw 
)
Load Phymm predictions to use as a reference implementation.
Parameters are taken from self.opt.
@param outPhymm File with Phymm output
@param predOutTaxa Output file with predicted taxa
def MGT::PhageHostApp::PhageHostApp::selectPhageHostPairs (   self,
  kw 
)
Pick pairs of phages and hosts from p-h DB stratified at a genus level

Member Data Documentation

tuple MGT::PhageHostApp::PhageHostApp::batchDepModes = ("predict","train") [static]

Derived classes should set this to a list of opt.mode values that can result in submision of new batch jobs.

Reimplemented from MGT::App::App.


The documentation for this class was generated from the following file: