Class GeneComparator

  • All Implemented Interfaces:
    Comparator<Gene>
    Direct Known Subclasses:
    UnambiguousExactGeneComparator, UnambiguousGeneComparator

    public class GeneComparator
    extends Object
    implements Comparator<Gene>
    Unambiguous gene comparator. It will first use UnambiguousInteractorBaseComparator to compare the basic interactor properties If the basic interactor properties are the same, It will look at ensembl identifier (the interactor with non null ensembl identifier will always come first). If the ensembl identifiers are not set, it will look at the ensemblGenome identifiers (the interactor with non null ensembl genome identifier will always come first). If the ensemblGemome identifiers are not set, it will look at the entrez/gene id (the interactor with non null entrez/gene id will always come first). If the entrez/gene ids are not set, it will look at the refseq identifiers (the interactor with non null refseq identifier will always come first).
    Since:
    15/01/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • GeneComparator

        public GeneComparator​(Comparator<Interactor> interactorBaseComparator)
        Creates a new UnambiguousGeneComparator. It will uses a UnambiguousInteractorBaseComparator to compare interactor properties
        Parameters:
        interactorBaseComparator - a Comparator object.
    • Method Detail

      • compare

        public int compare​(Gene gene1,
                           Gene gene2)
        It will first use UnambiguousInteractorBaseComparator to compare the basic interactor properties If the basic interactor properties are the same, It will look at ensembl identifier (the interactor with non null ensembl identifier will always come first). If the ensembl identifiers are not set, it will look at the ensemblGenome identifiers (the interactor with non null ensembl genome identifier will always come first). If the ensemblGemome identifiers are not set, it will look at the entrez/gene id (the interactor with non null entrez/gene id will always come first). If the entrez/gene ids are not set, it will look at the refseq identifiers (the interactor with non null refseq identifier will always come first).
        Specified by:
        compare in interface Comparator<Gene>
        Parameters:
        gene1 - a Gene object.
        gene2 - a Gene object.
        Returns:
        a int.