Package schrodinger :: Package application :: Package phase :: Module hypothesis
[hide private]
[frames] | no frames]

Module hypothesis

Module for reading and writing Phase hypotheses.

Classes [hide private]
  _HypothesisFeature
Class representing a hypothesis feature.
  Hypothesis
  PhaseHypothesis
Functions [hide private]
int
_cast_entry_id(entry_id)
Casts an entry ID to an integer.
str
_get_hypothesis_datafile(entry_id)
Returns the path to a hypothesis data file for a given hypothesis entry ID.
list of project.ProjectRow
_get_hypothesis_rows(hypo_entry_id)
Collects all entries in the group associated with the passed hypothesis entry ID, which contain the same hypothesis ID property value.
PhaseHypothesis
get_hypothesis_from_project(entry_id)
Gets hypothesis with a given entry id from the project.
 
convert_project_hypotheses(project_handle)
Converts all hypothesis datafiles in the original Phase format into PhaseHypothesis (PhpHypoAdaptor) objects.
 
get_entry_hypothesis(entry)
Extract the hypothesis from the given ProjectRow instance, and return a Hypothesis class for it.
 
generate_from_ligand(lig_file, hypo)
Given a structure file, generate a Hypothesis.
 
hypo_exists(hypo)
Returns True, if the hypothesis of the given path exists.
 
remove_hypo_if_present(hypo)
Remove the given hypothesis from disk (if present)
list of lists of ints
get_ligand_groups(ligand_sts)
Groups ligands in an analagous way to phase_database, iterating through the list of ligands and checking if the previous ligand has the same title and connectivity.
bool
is_hypothesis_entry(entry_id)
Returns whether project table row is a Phase hypothesis entry or not.
 
sorted_hypo_structures(hypothesis_sts)
Sorts a list of structures for PhaseHypothesis - Phase hypothesis CT - Phase hypothesis reference ligand - Any additional Phase hypothesis ligands
list of PhaseHypothesis
extract_hypotheses(filename)
Extracts all hypotheses from Phase hypothesis file containing multiple hypotheses
 
write_hypotheses(hypotheses, filename, group=None)
Writes set of PhaseHypothesis objects to *_phypo.maegz file.
int or None
find_site_num(site, hypo)
This function determines site number for the given feature site by comparing its name with names of all 'reference' sites in the given hypothesis.
Variables [hide private]
  logger = log.get_output_logger(__file__)
  SCHRODINGER = '/scr/buildbot/savedbuilds/NB/2016-4/build-126'
  CREATE_HYPOFILES = '/scr/buildbot/savedbuilds/NB/2016-4/build-...
  CREATE_HYPOTAB = '/scr/buildbot/savedbuilds/NB/2016-4/build-12...
  PHASE_V5_ENABLED = 1
  HYP_DATA_FILENAME = 'hypothesis.hyp'
  maestro = schrodinger.get_maestro()
  __package__ = 'schrodinger.application.phase'
Function Details [hide private]

_cast_entry_id(entry_id)

 

Casts an entry ID to an integer. If the entry ID corresponds to a scratch entry, a warning is issued and None is returned.

Parameters:
  • entry_id - project table entry ID
  • entry_id - int or str
Returns: int
the cast entry ID

_get_hypothesis_datafile(entry_id)

 

Returns the path to a hypothesis data file for a given hypothesis entry ID. If the entry is not a hypothesis, or the HYP_DATA_FILENAME does not exist, return None.

Parameters:
  • entry_id (int) - hypothesis entry ID
Returns: str
path to corresponding HYP_DATA_FILENAME

_get_hypothesis_rows(hypo_entry_id)

 

Collects all entries in the group associated with the passed hypothesis entry ID, which contain the same hypothesis ID property value.

Parameters:
  • hypo_entry_id - hypothesis entry ID
  • hypo_entry_id - int
Returns: list of project.ProjectRow
list of rows associated with the given hypothesis

get_hypothesis_from_project(entry_id)

 

Gets hypothesis with a given entry id from the project. It creates a hypothesis object from entries within same hypothesis group.

Parameters:
  • entry_id (int) - hypothesis ID
Returns: PhaseHypothesis
Phase hypothesis

convert_project_hypotheses(project_handle)

 

Converts all hypothesis datafiles in the original Phase format into PhaseHypothesis (PhpHypoAdaptor) objects. If successful, each hypothesis is updated in the project to the new format. If the given entry ID does not have a corresponding hypothesis datafile, nothing is done.

Parameters:

get_entry_hypothesis(entry)

 

Extract the hypothesis from the given ProjectRow instance, and return a Hypothesis class for it.

Returns None if the entry has no hypothesis associated with it.

generate_from_ligand(lig_file, hypo)

 

Given a structure file, generate a Hypothesis. Only the first structure is read.

lig_file - path to the input ligand file hypo - path to the new hypothesis

get_ligand_groups(ligand_sts)

 

Groups ligands in an analagous way to phase_database, iterating through the list of ligands and checking if the previous ligand has the same title and connectivity.

Parameters:
Returns: list of lists of ints
list of conformer index lists by ligand group

is_hypothesis_entry(entry_id)

 

Returns whether project table row is a Phase hypothesis entry or not.

Parameters:
  • entry_id (int) - entry ID for row in project table
Returns: bool
True if the row is a hypothesis entry, false Otherwise

sorted_hypo_structures(hypothesis_sts)

 

Sorts a list of structures for PhaseHypothesis
- Phase hypothesis CT
- Phase hypothesis reference ligand
- Any additional Phase hypothesis ligands

@param hypothesis_sts: list of structures
@type hypothesis_sts: list of L{Structure}

@return: hypothesis, reference ligand, additional hypothesis ligands
@rtype: L{Structure}, L{Structure}, list of L{Structure}

extract_hypotheses(filename)

 

Extracts all hypotheses from Phase hypothesis file containing multiple hypotheses

Parameters:
  • filename (str) - *_phypo.mae.gz file containing Phase hypotheses
Returns: list of PhaseHypothesis
list of Phase hypotheses

write_hypotheses(hypotheses, filename, group=None)

 

Writes set of PhaseHypothesis objects to *_phypo.maegz file.

Parameters:
  • hypotheses (list of PhaseHypothesis) - list of Phase hypotheses
  • filename (str) - *_phypo.mae.gz file containing Phase hypotheses
  • group (str) - name to group all hypotheses under

find_site_num(site, hypo)

 

This function determines site number for the given feature site by comparing its name with names of all 'reference' sites in the given hypothesis.

Parameters:
Returns: int or None
site number of the current feature in the hypothesis

Variables Details [hide private]

CREATE_HYPOFILES

Value:
'/scr/buildbot/savedbuilds/NB/2016-4/build-126/utilities/create_hypoFi\
les'

CREATE_HYPOTAB

Value:
'/scr/buildbot/savedbuilds/NB/2016-4/build-126/utilities/create_hypoTa\
bFile'