The Gene object represents genes encoding the protein components of a System. See The Gene object for an overview of the implementation.
Warning
To optimize computation and to avoid concurrency problems when we search several systems, each gene must be instanciated only once, and stored in gene_bank. gene_bank is a macsypy.gene.GeneBank object. The gene_bank and system_bank (macsypy.system.SystemBank object) are filled by a system_parser (macsypy.system_parser.SystemParser)
Example to get a gene object:
from macsypy.system import system_bank
from macsypy.config import Config
from macsypy.gene import gene_bank
#get a system
t2ss = system_bank["T2SS"]
#get of a gene
pilO = gene_bank["pilO"]
- class macsypy.gene.GeneBank[source]¶
Store all Gene objects. Ensure that genes are instanciated only once.
- __contains__(gene)[source]¶
Implement the membership test operator
Parameters: gene (macsypy.gene.Gene object) – the gene to test Returns: True if the gene is in, False otherwise Return type: boolean
- __getitem__(name)[source]¶
Parameters:
- name (string) – the name of the Gene
- cfg (macsypy.config.Config object) – the configuration object
Returns: return the Gene corresponding to the name. If the Gene already exists, return it, otherwise, build it and return it
Return type: macsypy.gene.Gene object
- __weakref__¶
list of weak references to the object (if defined)
- add_gene(gene)[source]¶
Parameters:
- name (string) – the name of the gene
- cfg (macsypy.config.Config object) – the configuration
Returns: return gene corresponding to the name. If the gene already exists, return it, otherwise, build it and return it
Return type: macsypy.gene.Gene object
Raise: KeyError if a gene with the same name is already registered
Note
Don’t instanciate your own GeneFactory use the gene_bank at the top level of the module.
from macsypy.gene import gene_bank
Handle Gene of a (secretion) System
Returns: | True if the gene names (gene.name) are the same, False otherwise. |
---|---|
Parameters: | gene (macsypy.gene.Gene object.) – the query of the test |
Return type: | boolean. |
handle gene
Parameters: |
|
---|
list of weak references to the object (if defined)
Add an analogous gene to the Gene
Parameters: | analog (macsypy.gene.Analog object) – analog to add |
---|
Add a homolog gene to the Gene
Parameters: | homolog (macsypy.gene.Homolog object) – homolog to add |
---|
Returns: | True if this gene can be replaced with one of its homologs or analogs whithout any effects on the system, False otherwise. |
---|---|
Return type: | boolean. |
Returns: | the Gene analogs |
---|---|
Type: | list of macsypy.gene.Analog object |
Test every system in system_list for compatibility with the gene using the is_authorized function.
Parameters: |
|
---|---|
Returns: | the list of compatible systems |
Return type: | list of string, or void list if none compatible |
Returns: | the Gene homologs |
---|---|
Type: | list of macsypy.gene.Homolog object |
Returns: | The maximum distance allowed between this gene and another gene for them to be considered co-localized. If the value is not set at the Gene level, return the value set at the System level. |
---|---|
Return type: | integer. |
Returns: | True if the gene is within the accessory genes of the system, False otherwise. |
---|---|
Parameters: | system (macsypy.system.System object.) – the query of the test |
Return type: | boolean. |
Returns: | True if the two genes are analogs, False otherwise. |
---|---|
Parameters: | gene (macsypy.gene.Gene object.) – the query of the test |
Return type: | boolean. |
Returns: | True if the genes are found in the System definition file (.xml), False otherwise. |
---|---|
Parameters: |
|
Return type: | boolean. |
Returns: | True if the gene is within the forbidden genes of the system, False otherwise. |
---|---|
Parameters: | system (macsypy.system.System object.) – the query of the test |
Return type: | boolean. |
Returns: | True if the two genes are homologs, False otherwise. |
---|---|
Parameters: | gene (macsypy.gene.Gene object.) – the query of the test |
Return type: | boolean. |
Returns: | True if the gene is within the mandatory genes of the system, False otherwise. |
---|---|
Parameters: | system (macsypy.system.System object.) – the query of the test |
Return type: | boolean. |
Returns: | True if the gene can be isolated on the genome, False otherwise |
---|---|
Return type: | boolean |
Returns: | True if this Gene can belong to different occurrences of this System (and can be used for multiple System assessments), False otherwise. |
---|---|
Return type: | boolean. |
Variables: | profile – The HMM protein Profile corresponding to this gene macsypy.gene.Profile object |
---|
Returns: | the System that owns this Gene |
---|---|
Return type: | macsypy.system.System object |
Note
All attributes/methods which are not directly implemented in Homolog are redirected to that of the encapsulated Gene.
Handle homologs, encapsulate a Gene
Parameters: |
|
---|
list of weak references to the object (if defined)
Variables: | gene – gene |
---|
Returns: | the gene to which this one is homolog to (reference gene) |
---|---|
Return type: | macsypy.gene.Gene object |
Handle analogs, encapsulate a Gene
Parameters: |
|
---|
list of weak references to the object (if defined)
Variables: | gene – gene |
---|
Returns: | the gene to which this one is analog to (reference gene) |
---|---|
Return type: | macsypy.gene.Gene object |