screen – screen processing and conversion

class cockatoo.screen.Cocktail(name, ph=None, components=None)[source]

This class represents a cocktail.

A cocktail is made of of one or more compounds.

add_compound(compound)[source]

Add a compound to the cocktail.

Parameters

compound (compound) – The compound to add (cockatoo.Compound)

fingerprint()[source]

Compute the fingerprint for a cocktail

Returns

The fingerprint sparse vector dict

class cockatoo.screen.CocktailSerializer(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]
class cockatoo.screen.Compound(name, conc, unit, ph=None, smiles=None, molecular_weight=None, density=None)[source]

This class represents a chemcial compound used in a cocktail.

fingerprint()[source]

Compute the fingerprint for a compound

Returns

The fingerprint sparse vector dict

molarity()[source]

Convert concentration of compound into molarity

Returns

The molar concentration or None if missing data

class cockatoo.screen.CompoundSerializer(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]
class cockatoo.screen.Screen(name, cocktails=None)[source]

This class represents a macromolecular crystallization screen.

A screen is made of of one or more cocktails.

add_cocktail(cocktail)[source]

Add a cocktail to the screen.

Parameters

cocktail (cocktail) – The cocktail to add (cockatoo.Cocktail)

print_stats()[source]

Print summary stats for the screen.

class cockatoo.screen.ScreenSerializer(extra=None, only=None, exclude=(), prefix='', strict=None, many=False, context=None, load_only=(), dump_only=(), partial=False)[source]
cockatoo.screen.distance(screen1, screen2, weights)[source]

Compute the distance between two screens (from Newman et al. 2010).

Parameters
  • screen1 (screen) – First screen

  • screen2 (screen) – Second screen

  • weights (array) – weights

Returns

The distance score between 0 and 1

cockatoo.screen.internal_similarity(s, weights)[source]

Compute the internal diversity within a screen (from Newman et al. 2010).

Parameters
  • s (screen) – The screen

  • weights (array) – weights

Returns

The diversity score between 0 and 1

cockatoo.screen.parse_cocktail(path)[source]

Parse a cocktail from JSON file

cockatoo.screen.parse_csv(name, path)[source]

Parse a screen in CSV format.

Parameters
  • name (str) – Name of the screen

  • path (str) – Path to file

Returns

The screen (cockatoo.Screen)