Data Integrator (Python API)
Public Member Functions | List of all members
cls.MetaRanking.CMetaRanking Class Reference

Meta Ranking executive class. More...

Inheritance diagram for cls.MetaRanking.CMetaRanking:
Inheritance graph
[legend]
Collaboration diagram for cls.MetaRanking.CMetaRanking:
Collaboration graph
[legend]

Public Member Functions

def __init__ (s)
 
def SetEmptyCell (s, emptyCell)
 Set empty cell string for identifying cells without context. More...
 
def SetInputFromList (s, data)
 Retrieve input data from a list. More...
 
def SetInputFromFile (s, reader, emptyCell)
 Retrieve input from a file. More...
 
def SetDefaultWeights (s)
 Set all weights to one. More...
 
def SetWeights (s, weights)
 Set weights for individual columns. More...
 
def SetHeader (s, header)
 Set the header column names. More...
 
def GetHeaderNames (s, refColNr, incSingleScores=False)
 Get header names, including the newly computed ones. More...
 
def IsValidColnr (s, colNr)
 Is the column number valid for this input? More...
 
def ScoreSingleColumn (s, refColNr, colNr, sorting="A", dataType=float)
 Compute rank score for a single unsorted column. More...
 
def ComputeMetaScore (s)
 Compute the meta score from the single ranked columns. More...
 
def RetrieveScoreColumns (s, refColNr, incSingleScores=False)
 Get the result of meta-ranking. More...
 

Detailed Description

Meta Ranking executive class.

This class handles reading from a TSV file, allows input of a table as a
@c List object, and computes the weighted MetaRanker score of selected
columns.

Constructor & Destructor Documentation

◆ __init__()

def cls.MetaRanking.CMetaRanking.__init__ (   s)

Member Function Documentation

◆ ComputeMetaScore()

def cls.MetaRanking.CMetaRanking.ComputeMetaScore (   s)

Compute the meta score from the single ranked columns.

    For each row, the meta score is the product of each individual
    column's score.
    @return @c Dict, the key is a cell referenced by the reference column
    (@c refColNr) from CMetaRanking::ScoreSingleColumn and the value is
    the meta score as a @c float number. Can be the empty @c Dict, if no
    columns have been scored previously or the weights have been set in
    some wrong way. In the latter case an error message is issued.

◆ GetHeaderNames()

def cls.MetaRanking.CMetaRanking.GetHeaderNames (   s,
  refColNr,
  incSingleScores = False 
)

Get header names, including the newly computed ones.

    @param refColNr  Reference column number (index starts at 0).
    @param incSingleScores  If set to @c True, the result will include a
     column name for each of the single scored columns.
    @return  @c List of @c Strings, the header names. They are ordered as
     returned by CMetaRanking::RetrieveScoreColumns. The last column name
     is that of the meta rank score.

◆ IsValidColnr()

def cls.MetaRanking.CMetaRanking.IsValidColnr (   s,
  colNr 
)

Is the column number valid for this input?

    Call this only after input has been processed.
    @param colNr Column number as would be supplied to any of the method
     of this class.
    @return @c True, the column number can be used, it is within the
     allowed range of indices. @c False, no.

◆ RetrieveScoreColumns()

def cls.MetaRanking.CMetaRanking.RetrieveScoreColumns (   s,
  refColNr,
  incSingleScores = False 
)

Get the result of meta-ranking.

    After an arbitrary number of columns have been scored by
    CMetaRanking::ScoreSingleColumn and the MetaRanker score has been
    computed by calling CMetaRanking::ComputeMetaScore, data are ready to
    be retrieved here. In case CMetaRanking::ComputeMetaScore has not been
    called, it will be done here for consistency reasons. Clearly, columns
    already must have been scored by CMetaRanking::ScoreSingleColumn.
    @param refColNr  Column index (starts with 0) of reference data.
    @param incSingleScores  Also report weighted scores for each single
     column that has been scored.
    @return A @c List of @c Lists, basically a table with score
    columns. If @c incSingleScores is @c True, for each scored column
    there is a column with its weighted normalized scores. The columns
    correspond to the ascending sorted column indices. The last column
    stores the meta-rank score. Returns an empty @c List, if there is no
    data to report or if there has been an error during a previous
    computation step.

◆ ScoreSingleColumn()

def cls.MetaRanking.CMetaRanking.ScoreSingleColumn (   s,
  refColNr,
  colNr,
  sorting = "A",
  dataType = float 
)

Compute rank score for a single unsorted column.

    The score is computed as follows: The rank of a sortable column is
    divided by the number of unique entries contained in a reference
    column. In case of equal scores for different references (eg. ordinal
    data), each block of equal scores is summarized by its highest ranked
    entry, and the number of entries in this block will add to the next
    rank. (Think of ex aequo in a competition.)
    @param refColNr  Index (starting with 0) specifying the column number
     which stores identifiers to which the score relates to (eg. gene IDs).
    @param colNr  Index of column which defines input data for ranking.
    @param sorting  (@c String) @c A for ascending sort, @c D for
     descending sort of column @c colNr.
    @param dataType  Data type for converting cells from column @c colNr.

◆ SetDefaultWeights()

def cls.MetaRanking.CMetaRanking.SetDefaultWeights (   s)

Set all weights to one.

    This method must be called once all columns have been scored!

◆ SetEmptyCell()

def cls.MetaRanking.CMetaRanking.SetEmptyCell (   s,
  emptyCell 
)

Set empty cell string for identifying cells without context.

    @param emptyCell  (@c String)

◆ SetHeader()

def cls.MetaRanking.CMetaRanking.SetHeader (   s,
  header 
)

Set the header column names.

    @param header  @c List of @c Strings, the header names.

◆ SetInputFromFile()

def cls.MetaRanking.CMetaRanking.SetInputFromFile (   s,
  reader,
  emptyCell 
)

Retrieve input from a file.

    Header handling should be done outside this class. This methods
    assumes any header has already been read and that only data rows are
    to be read.
    @param reader  cls.CDefaultTableReader instance for file access.
    @param emptyCell @c String for indentifying cells without content.
    @return See SetInputFromList.

◆ SetInputFromList()

def cls.MetaRanking.CMetaRanking.SetInputFromList (   s,
  data 
)

Retrieve input data from a list.

    @param data  (@c List) List of sequence types representing a table.
    @return  @c False, if the number of columns is not unique throughout
    the table, @c True if all validation was ok.

◆ SetWeights()

def cls.MetaRanking.CMetaRanking.SetWeights (   s,
  weights 
)

Set weights for individual columns.

    @param w  @c List of weights (@c Float). First entry in list is used
    to weight the column with the smallest index. The second entry is used
    for the second smallest column index, and so on.

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