Package schrodinger :: Package application :: Package msv :: Module test_helpers
[hide private]
[frames] | no frames]

Module test_helpers

Classes [hide private]
  RuleBasedStateMachineMetaClass
A metaclass that makes it easy to create simple rules for a RuleBasedStateMachine.
  AlignmentInfo
Functions [hide private]
 
patch_signals(obj)
Patch all the signals on the given object with MagicMocks.
 
make_alignment(AlnClass, aln_info, patch=True)
Given an alignment class and information to populate an instance returns an instance of an alignment
 
sample_indices(draw, list_length)
Convenience function that returns a subset of indices in a list, given a hypothesis draw function and the length of the list.
schrodinger.application.msv.domain.residue.Residue
generated_residues()
Returns: A residue suitable for testing
schrodinger.application.msv.domain.sequence.ProteinSequence
generated_sequences()
Returns: A protein sequence suitable for testing
QtGui.QColor
qcolor_strategy()
Returns: A QtColor instance to be used in a test
AlignmentInfo
alignment_info_strategy()
Returns everything we need to create an alignment
Variables [hide private]
  POSSIBLE_RESIDUES = ['PAQ', 'AGM', 'TPQ', 'CCS', 'GSC', 'NEM',...
  seq_elements_strategy = lists(elements=sampled_from(('PA...
  RESIDUE_NAMES = ['PAQ', 'AGM', 'TPQ', 'CCS', 'GSC', 'NEM', 'TI...
  RESIDUE_TYPES = [ResidueType('Y', 'PAQ', 'Tyrosine'), ResidueT...
  letters_and_numbers = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',...
  seq_strategy = builds(ProteinSequence, elements=lists(elements...
  prot_annotations = [<ANNOTATION_TYPES.indices: 1>, <ANNOTATION...
  protein_ann_combinations = [(), (<ANNOTATION_TYPES.indices: 1>...
  __package__ = 'schrodinger.application.msv'
  name = 'ARN'
Function Details [hide private]

patch_signals(obj)

 

Patch all the signals on the given object with MagicMocks.

Parameters:
  • obj (object) - The object whose signals we want to patch

make_alignment(AlnClass, aln_info, patch=True)

 

Given an alignment class and information to populate an instance returns an instance of an alignment

Parameters:
  • AlnClass (type) - An alignment class
  • aln_info (AlignmentInfo) - Information to populate the instance
  • patch (bool) - Whether to patch the signals on the alignment instance
Returns:
A ProteinAlignment instance.

sample_indices(draw, list_length)

 

Convenience function that returns a subset of indices in a list, given a hypothesis draw function and the length of the list.

Parameters:
  • draw (function) - A function supplied by hypothesis
  • list_length (int) - The length of the list to get a subset of

generated_residues()

 
Parameters:
  • draw (function) - A function supplied by hypothesis
Returns: schrodinger.application.msv.domain.residue.Residue
A residue suitable for testing
Decorators:
  • @strategies.composite

generated_sequences()

 
Parameters:
  • draw (function) - A function supplied by hypothesis
Returns: schrodinger.application.msv.domain.sequence.ProteinSequence
A protein sequence suitable for testing
Decorators:
  • @strategies.composite

qcolor_strategy()

 
Returns: QtGui.QColor
A QtColor instance to be used in a test
Decorators:
  • @strategies.composite

alignment_info_strategy()

 

Returns everything we need to create an alignment

We return an alignment_info instead of an alignment in order to allow tests to create different kinds of alignments and also to pass along additional test data customized to the alignment that the test will create. For example, a potential_reordering will be a reordering that should work with the alignment, etc., etc.

Returns: AlignmentInfo
A test fixture for alignment tests
Decorators:
  • @strategies.composite

Variables Details [hide private]

POSSIBLE_RESIDUES

Value:
['PAQ',
 'AGM',
 'TPQ',
 'CCS',
 'GSC',
 'NEM',
 'TIH',
 'DLY',
...

seq_elements_strategy

Value:
lists(elements=sampled_from(('PAQ',
 'AGM',
 'TPQ',
 'CCS',
 'GSC',
 'NEM',
 'TIH',
 'DLY',
...

RESIDUE_NAMES

Value:
['PAQ',
 'AGM',
 'TPQ',
 'CCS',
 'GSC',
 'NEM',
 'TIH',
 'DLY',
...

RESIDUE_TYPES

Value:
[ResidueType('Y', 'PAQ', 'Tyrosine'),
 ResidueType('R', 'AGM', 'Arginine'),
 ResidueType('A', 'TPQ', 'Alanine'),
 ResidueType('C', 'CCS', 'Cysteine'),
 ResidueType('G', 'GSC', 'Glycine'),
 ResidueType('H', 'NEM', 'Histidine'),
 ResidueType('A', 'TIH', 'Alanine'),
 ResidueType('X', 'DLY', 'Lysine'),
...

letters_and_numbers

Value:
['a',
 'b',
 'c',
 'd',
 'e',
 'f',
 'g',
 'h',
...

seq_strategy

Value:
builds(ProteinSequence, elements=lists(elements=sampled_from(('PAQ',
 'AGM',
 'TPQ',
 'CCS',
 'GSC',
 'NEM',
 'TIH',
 'DLY',
...

prot_annotations

Value:
[<ANNOTATION_TYPES.indices: 1>,
 <ANNOTATION_TYPES.mean_hydrophobicity: 2>,
 <ANNOTATION_TYPES.mean_isoelectric_point: 3>,
 <ANNOTATION_TYPES.consensus_symbols: 4>,
 <ANNOTATION_TYPES.consensus_seq: 5>,
 <ANNOTATION_TYPES.consensus_freq: 6>,
 <ANNOTATION_TYPES.sequence_logo: 7>]

protein_ann_combinations

Value:
[(),
 (<ANNOTATION_TYPES.indices: 1>),
 (<ANNOTATION_TYPES.mean_hydrophobicity: 2>),
 (<ANNOTATION_TYPES.mean_isoelectric_point: 3>),
 (<ANNOTATION_TYPES.consensus_symbols: 4>),
 (<ANNOTATION_TYPES.consensus_seq: 5>),
 (<ANNOTATION_TYPES.consensus_freq: 6>),
 (<ANNOTATION_TYPES.sequence_logo: 7>),
...