BGC Detection

BGC prediction using a conditional random field.

class gecco.crf.ClusterCRF(object)[source]

A wrapper for sklearn_crfsuite.CRF to work with the GECCO data model.

classmethod trained(model_path: Optional[str] = None) → gecco.crf.ClusterCRF[source]

Create a new pre-trained ClusterCRF instance from a model path.


model_path (str, optional) – The path to the model directory obtained with the gecco train command. If None given, use the embedded model.


ClusterCRF – A CRF model that can be used to perform predictions without training first.


ValueError – If the model data does not match its hash.


Create a new ClusterCRF instance.

  • feature_type (str) – Defines how features should be extracted. Should be either domain, protein, or overlap.

  • algorithm (str) – The optimization algorithm for the model. See for available values.

  • overlap (int) – In case of feature_type = "overlap", defines the sliding window size to use. The resulting window width is 2*overlap+1.

  • pool_factory (multiprocessing.pool.Pool subclass, or callable) – The factory to use to create a new pool instance for methods that can perform operations in parallel. It is called with a single argument which is the number of workers to create, or None to create a much workers as there are CPUs.

Any additional keyword argument is passed as-is to the internal CRF constructor.

  • ValueError – if feature_type has an invalid value.

  • TypeError – if one of the *_columns argument is not iterable.


Predict how likely each given gene is part of a gene cluster.