Package schrodinger :: Package analysis :: Module enrichment :: Class ActiveDecoyFingerprintAnalyzer
[hide private]
[frames] | no frames]

Class ActiveDecoyFingerprintAnalyzer


Convert a structure file of screen results (or inputs) into active
and decoy fingerprints and report similarity metrics between the
fingerprint sets.


API example:
------------
actdecoyfpanalyzer = ActiveDecoyFingerprintAnalyzer(
    'docking_results_pv.mae',
    ['active1', 'active2', 'active3']
)
actdecoyfpanalyzer.analyzeFingerprints()
actdecoyfpanalyzer.writeCsv('analysis.csv')

@ivar decoy_ids:
    All the unique non-active ids (titles) observed in the results.

@ivar active_ids:
    All the unique active ids (titles) observed in the results.

@ivar input_active_ids:
    The full set of active ids, regardless of whether they appeared
    in the result file or not.

@ivar active_fps:
    Sequence of active fingerprints.

@ivar decoy_fps:
    Sequence of decoy fingerprints.

Instance Methods [hide private]
 
__init__(self, results, input_active_ids, fp_gen=None, fp_sim=None, id_prop='s_m_title')
 
analyzeFingerprints(self)
Create fingerprints from the self.results structure files, classifying members of actives and groups based on the ids.
tuple
getMaxSimDecoyByActiveId(self, active_id)
Returns: (similarity, id) tuple for the decoy that is most similar to the active_id
float
getMeanSimDecoyByActiveId(self, active_id)
Returns: The mean similarity value for the decoys to the active_id
float
getStdSimDecoyByActiveId(self, active_id)
Returns: The standard deviation of the mean similarity value for the decoys to the active_id
tuple
getMinSimDecoyByActiveId(self, active_id)
Returns: (similarity, id) tuple for the decoy that is least similar to the active_id
tuple
getSimHistogramByActiveId(self, active_id)
Returns: (histogram, bin_edges) tuple of numpy arrays for the best decoy similarities to the active_id
 
getMeanMaxActiveDecoySim(self)
Returns: mean of the maximum Active-Decoy similarity scores.
 
getMeanMaxActiveActiveSim(self)
Returns: mean of the maximum Active-Active similarity scores.
 
getMeanMaxDecoyDecoySim(self)
Returns: mean of the maximum Decoy-Decoy similarity scores.
 
writeCsv(self, csv_filename='active_decoy_fp_analysis.csv')
@param csv_filename: Path of the file to write.
Method Details [hide private]

__init__(self, results, input_active_ids, fp_gen=None, fp_sim=None, id_prop='s_m_title')
(Constructor)

 
Parameters:
  • results (string) - Path to structure file of screen results.
  • input_active_ids - List of identifer values for the actives. Structures with ids not on this list are treated as decoys. The first occurence of a structure is used to generate the fingerprint.
  • fp_gen (canvas.fingerprint.CanvasFingerprintGenerator) - Canvas Fingerprint generator. If None is provided the default fingerprint generator type is Linear with the default atom type for Linear.
  • fp_sim (canvas.similarity.CanvasFingerprintSimilarity) - Canvas Fingerprint similarity calculator. If None is provided the default similarity metric is Tanimoto.
  • id_prop (string) - m2io dataname for the compound identifier property. Default is title, 's_m_title'.
  • active_ids (list)

getMaxSimDecoyByActiveId(self, active_id)

 
Parameters:
  • active_id (string) - Identifier of the active to search against.
Returns: tuple
(similarity, id) tuple for the decoy that is most similar to the active_id

getMeanSimDecoyByActiveId(self, active_id)

 
Parameters:
  • active_id (string) - Identifier of the active to search against.
Returns: float
The mean similarity value for the decoys to the active_id

getStdSimDecoyByActiveId(self, active_id)

 
Parameters:
  • active_id (string) - Identifier of the active to search against.
Returns: float
The standard deviation of the mean similarity value for the decoys to the active_id

getMinSimDecoyByActiveId(self, active_id)

 
Parameters:
  • active_id (string) - Identifier of the active to search against.
Returns: tuple
(similarity, id) tuple for the decoy that is least similar to the active_id

getSimHistogramByActiveId(self, active_id)

 
Parameters:
  • active_id (string) - Identifier of the active to search against.
Returns: tuple
(histogram, bin_edges) tuple of numpy arrays for the best decoy similarities to the active_id

getMeanMaxActiveDecoySim(self)

 
Returns:
mean of the maximum Active-Decoy similarity scores.

getMeanMaxActiveActiveSim(self)

 
Returns:
mean of the maximum Active-Active similarity scores.

getMeanMaxDecoyDecoySim(self)

 
Returns:
mean of the maximum Decoy-Decoy similarity scores.

writeCsv(self, csv_filename='active_decoy_fp_analysis.csv')

 

@param csv_filename:
    Path of the file to write.
@type csv_filename:
    string

Write a CSV file that summarizies the Fingerprint analysis.
The headers are:
    Active Id
    Max. Decoy Similarity Score
    Max. Decoy Similarity Id
    Min. Decoy Similarity Score
    Min. Decoy Similarity Id
    Mean Decoy Similarity
    Mean Max. Active-Decoy Similarity
    Mean Max. Decoy-Decoy Similarity
    Num. Obs. Decoy Ids
    Num. Obs. Active Ids