The Profile object is used for the search of the gene with Hmmer. A “Profile” must match a HMM protein profile file, which name is based on the profile name. For instance, the gspG gene has the corresponding “gspG.hmm” profile file provided at a dedicated location.

profile API reference


class macsypy.profile.ProfileFactory(cfg)[source]

Build and store all Profile objects. Profiles must not be instanciated directly. The profile_factory must be used. The profile_factory ensures there is only one instance of profile for a given name. To get a profile, use the method get_profile. If the profile is already cached, this instance is returned. Otherwise a new profile is built, stored in the profile_factory and then returned.


Initialize self. See help(type(self)) for accurate signature.


list of weak references to the object (if defined)

get_profile(gene, model_location)[source]
  • gene (macsypy.gene.Gene or macsypy.gene.Homolog or macsypy.gene.Analog object) – the gene associated to this profile
  • model_location (macsypy.registries.ModelLocation object.) – The where to get the profile

the profile corresponding to the name. If the profile already exists, return it. Otherwise build it, store it and return it.

Return type:

macsypy.profile.Profile object


class macsypy.profile.Profile(gene, cfg, path)[source]

Handle a HMM protein profile

__init__(gene, cfg, path)[source]
  • gene (macsypy.secretion.Gene object) – the gene corresponding to this profile
  • cfg (macsypy.config.Config object) – the configuration
  • path (string) – the path to the hmm profile.
Returns:the length of the HMM protein profile
Return type:int

Print the name of the corresponding gene and the path to the HMM profile.


list of weak references to the object (if defined)


Parse the HMM profile to extract the length and the presence of GA bit threshold

Returns:the length, presence of ga bit threshold
Return type:tuple(int length, bool ga_threshold)

Launch the Hmmer search (hmmsearch executable) with this profile

Parameters:cpu (int) – the number of cpu to use for hmmsearch (must be >= 1)
Returns:an object storing information on the results of the HMM search (HMMReport)
Return object