Class MitabUtils


  • public class MitabUtils
    extends Object
    Utilisty class for MitabWriter
    Since:
    10/06/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • MitabUtils

        public MitabUtils()
    • Method Detail

      • findDbSourceForAlias

        public static String findDbSourceForAlias​(Alias alias)
        The source of the Alias is uniprotkb if the alias type is gene name, gene name synonym, isoform synonym, locus name or orf name. It is unknown otherwise.
        Parameters:
        alias - a Alias object.
        Returns:
        the default dbsource for this alias
      • findDbSourceForAlias

        public static String findDbSourceForAlias​(ParticipantEvidence participant,
                                                  Alias alias)
        The source of the Alias is uniprotkb if the alias type is gene name, gene name synonym, isoform synonym, locus name or orf name. If the participant evidence has an interaction evidence with an experiment, publication and source, it will return the source shortname. It is unknown otherwise.
        Parameters:
        participant - a ParticipantEvidence object.
        alias - a Alias object.
        Returns:
        the default dbsource for this alias and participant
      • findDbSourceForAlias

        public static String findDbSourceForAlias​(ModelledParticipant participant,
                                                  Alias alias)
        The source of the Alias is uniprotkb if the alias type is gene name, gene name synonym, isoform synonym, locus name or orf name. If the participant has an modelled interaction with a source, it will return the source shortname. It is unknown otherwise.
        Parameters:
        participant - a ModelledParticipant object.
        alias - a Alias object.
        Returns:
        a String object.
      • unescapeDoubleQuote

        public static String unescapeDoubleQuote​(String stringToReplace)

        unescapeDoubleQuote.

        Parameters:
        stringToReplace - a String object.
        Returns:
        a String object.
      • isAnnotationAnInteractionTag

        public static boolean isAnnotationAnInteractionTag​(Annotation annot)
        To know if a publication annotation is an interactionTag
        Parameters:
        annot - a Annotation object.
        Returns:
        a boolean.
      • findBestShortNameAndFullNameFromAliases

        public static MitabAlias[] findBestShortNameAndFullNameFromAliases​(Collection<MitabAlias> aliases)
        Find the best alias to use as a shortname and fullName. It will first collect the alias with display_short if it exists, otherwise display_long if it exists, otherwise gene name if it exists , otherwise shortlabel if it exists otherwise the alias with the shortest alias name.
        Parameters:
        aliases - a Collection object.
        Returns:
        the best alias to use as a shortname
      • findBestShortNameFromAlternativeIdentifiers

        public static MitabXref findBestShortNameFromAlternativeIdentifiers​(Collection<MitabXref> altids)
        Find the best id to use as a shortname. It will first collect the id with qualifier = display_short if it exists, otherwise qualifier = display_long if it exists, otherwise qualifier = gene name if it exists , otherwise qualifier = shortlabel if it exists otherwise null.
        Parameters:
        altids - a Collection object.
        Returns:
        the best id to use as a shortname