Class DefaultGene

  • All Implemented Interfaces:
    Gene, Interactor, Molecule
    Direct Known Subclasses:
    MitabGene, XmlGene, XmlGene, XmlGene

    public class DefaultGene
    extends DefaultMolecule
    implements Gene
    Default implementation for gene Notes: The equals and hashcode methods have NOT been overridden because the Gene object is a complex object. To compare Gene objects, you can use some comparators provided by default: - DefaultGeneComparator - UnambiguousGeneComparator - DefaultExactGeneComparator - UnambiguousExactGeneComparator - GeneComparator
    Since:
    24/01/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • DefaultGene

        public DefaultGene​(String name)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
      • DefaultGene

        public DefaultGene​(String name,
                           String fullName)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        fullName - a String object.
      • DefaultGene

        public DefaultGene​(String name,
                           Organism organism)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        organism - a Organism object.
      • DefaultGene

        public DefaultGene​(String name,
                           String fullName,
                           Organism organism)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        fullName - a String object.
        organism - a Organism object.
      • DefaultGene

        public DefaultGene​(String name,
                           Xref uniqueId)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        uniqueId - a Xref object.
      • DefaultGene

        public DefaultGene​(String name,
                           String fullName,
                           Xref uniqueId)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        fullName - a String object.
        uniqueId - a Xref object.
      • DefaultGene

        public DefaultGene​(String name,
                           Organism organism,
                           Xref uniqueId)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        organism - a Organism object.
        uniqueId - a Xref object.
      • DefaultGene

        public DefaultGene​(String name,
                           String fullName,
                           Organism organism,
                           Xref uniqueId)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        fullName - a String object.
        organism - a Organism object.
        uniqueId - a Xref object.
      • DefaultGene

        public DefaultGene​(String name,
                           String fullName,
                           String ensembl)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        fullName - a String object.
        ensembl - a String object.
      • DefaultGene

        public DefaultGene​(String name,
                           CvTerm type,
                           Xref ensembl)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        type - a CvTerm object.
        ensembl - a Xref object.
      • DefaultGene

        public DefaultGene​(String name,
                           String fullName,
                           CvTerm type,
                           Xref ensembl)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        fullName - a String object.
        type - a CvTerm object.
        ensembl - a Xref object.
      • DefaultGene

        public DefaultGene​(String name,
                           CvTerm type,
                           Organism organism,
                           Xref ensembl)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        type - a CvTerm object.
        organism - a Organism object.
        ensembl - a Xref object.
      • DefaultGene

        public DefaultGene​(String name,
                           CvTerm type,
                           Xref uniqueId,
                           Xref ensembl)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        type - a CvTerm object.
        uniqueId - a Xref object.
        ensembl - a Xref object.
      • DefaultGene

        public DefaultGene​(String name,
                           String fullName,
                           CvTerm type,
                           Xref uniqueId,
                           Xref ensembl)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        fullName - a String object.
        type - a CvTerm object.
        uniqueId - a Xref object.
        ensembl - a Xref object.
      • DefaultGene

        public DefaultGene​(String name,
                           CvTerm type,
                           Organism organism,
                           Xref uniqueId,
                           Xref ensembl)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        type - a CvTerm object.
        organism - a Organism object.
        uniqueId - a Xref object.
        ensembl - a Xref object.
      • DefaultGene

        public DefaultGene​(String name,
                           Organism organism,
                           String ensembl)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        organism - a Organism object.
        ensembl - a String object.
      • DefaultGene

        public DefaultGene​(String name,
                           CvTerm type)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        type - a CvTerm object.
      • DefaultGene

        public DefaultGene​(String name,
                           String fullName,
                           CvTerm type)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        fullName - a String object.
        type - a CvTerm object.
      • DefaultGene

        public DefaultGene​(String name,
                           CvTerm type,
                           Organism organism)

        Constructor for DefaultGene.

        Parameters:
        name - a String object.
        type - a CvTerm object.
        organism - a Organism object.
    • Method Detail

      • getPreferredIdentifier

        public Xref getPreferredIdentifier()

        getPreferredIdentifier

        Return the first ensembl identifier if provided, otherwise the first ensemblGenomes if provided, otherwise the first entrez/gene id if provided, otherwise the first refseq id if provided otherwise the first identifier in the list of identifiers
        Specified by:
        getPreferredIdentifier in interface Interactor
        Overrides:
        getPreferredIdentifier in class DefaultInteractor
        Returns:
        the first identifier in the list of identifiers or null if the list is empty
      • getEnsembl

        public String getEnsembl()

        Getter for the field ensembl.

        Specified by:
        getEnsembl in interface Gene
        Returns:
        a String object.
      • setEnsembl

        public void setEnsembl​(String ac)
        Sets the Ensembl accession for this gene. It will remove the old ensembl identifier from the collection of identifiers and replace it with the new ensembl identifier. If the new ensembl identifier is null, all the existing ensembl identifiers will be removed from the collection of identifiers
        Specified by:
        setEnsembl in interface Gene
        Parameters:
        ac - : Ensembl accession
      • getEnsemblGenome

        public String getEnsemblGenome()

        Getter for the field ensemblGenome.

        Specified by:
        getEnsemblGenome in interface Gene
        Returns:
        a String object.
      • setEnsemblGenome

        public void setEnsemblGenome​(String ac)
        Sets the Ensembl genomes identifier It will remove the old ensembl genomes identifier from the collection of identifiers and replace it with the new ensembl genomes identifier. If the new ensembl genomes identifier is null, all the existing ensembl genomes identifiers will be removed from the collection of identifiers
        Specified by:
        setEnsemblGenome in interface Gene
        Parameters:
        ac - : the ensembleGenome ac
      • getEntrezGeneId

        public String getEntrezGeneId()

        Getter for the field entrezGeneId.

        Specified by:
        getEntrezGeneId in interface Gene
        Returns:
        a String object.
      • setEntrezGeneId

        public void setEntrezGeneId​(String id)
        Sets the Entrez gene id. It will remove the old entrez/gene identifier from the collection of identifiers and replace it with the new entrez/gene identifier. If the new entrez/gene identifier is null, all the existing entrez/gene identifiers will be removed from the collection of identifiers
        Specified by:
        setEntrezGeneId in interface Gene
        Parameters:
        id - : Entrez gene id
      • getRefseq

        public String getRefseq()

        Getter for the field refseq.

        Specified by:
        getRefseq in interface Gene
        Returns:
        a String object.
      • setRefseq

        public void setRefseq​(String ac)
        Sets the refseq accession. It will remove the old refseq identifier from the collection of identifiers and replace it with the new refseq identifier. If the new refseq identifier is null, all the existing refseq identifiers will be removed from the collection of identifiers
        Specified by:
        setRefseq in interface Gene
        Parameters:
        ac - : the refseq accession
      • processAddedIdentifierEvent

        protected void processAddedIdentifierEvent​(Xref added)

        processAddedIdentifierEvent

        Parameters:
        added - a Xref object.
      • processRemovedIdentifierEvent

        protected void processRemovedIdentifierEvent​(Xref removed)

        processRemovedIdentifierEvent

        Parameters:
        removed - a Xref object.
      • clearPropertiesLinkedToIdentifiers

        protected void clearPropertiesLinkedToIdentifiers()

        clearPropertiesLinkedToIdentifiers

      • setInteractorType

        public void setInteractorType​(CvTerm type)
        Description copied from class: DefaultInteractor
        Sets the molecule type for this interactor If the given type is null, this method automatically sets the interactor type to 'unknown participant' (MI:0329)
        Specified by:
        setInteractorType in interface Interactor
        Overrides:
        setInteractorType in class DefaultInteractor
        Parameters:
        type - : molecule type