Package psidev.psi.mi.jami.tab.utils
Class MitabUtils
- java.lang.Object
-
- psidev.psi.mi.jami.tab.utils.MitabUtils
-
public class MitabUtils extends Object
Utilisty class for MitabWriter- Since:
10/06/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUTHOR_SUFFIXConstantAUTHOR_SUFFIX=" et al."static StringCOLUMN_SEPARATORConstantCOLUMN_SEPARATOR="\t"static StringCOMMENT_PREFIXConstantCOMMENT_PREFIX="#"static DateFormatDATE_FORMATConstantDATE_FORMATstatic StringDISPLAY_LONGConstantDISPLAY_LONG="display_long"static StringDISPLAY_SHORTConstantDISPLAY_SHORT="display_short"static StringEMPTY_COLUMNConstantEMPTY_COLUMN="-"static StringFIELD_SEPARATORConstantFIELD_SEPARATOR="|"static StringLINE_BREAKConstantLINE_BREAK="System.getProperty(line.separator)"static DateFormatPUBLICATION_YEAR_FORMATConstantPUBLICATION_YEAR_FORMATstatic StringRANGE_SEPARATORConstantRANGE_SEPARATOR=","static StringSHORTLABELConstantSHORTLABEL="shortlabel"static String[]SPECIAL_CHARACTERSConstantSPECIAL_CHARACTERS="new String[]{FIELD_SEPARATOR,XREF_SEPAR"{trunked}static StringTAXIDConstantTAXID="taxid"static StringUNKNOWN_DATABASEConstantUNKNOWN_DATABASE="unknown"static StringUNKNOWN_IDConstantUNKNOWN_ID="unknown"static StringUNKNOWN_NAMEConstantUNKNOWN_NAME="unspecified name"static StringUNKNOWN_TYPEConstantUNKNOWN_TYPE="unknown"static StringXREF_SEPARATORConstantXREF_SEPARATOR=":"
-
Constructor Summary
Constructors Constructor Description MitabUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String[]buildHeader(MitabVersion version)Build the header and return an array of String which is an array of column namesstatic MitabAlias[]findBestShortNameAndFullNameFromAliases(Collection<MitabAlias> aliases)Find the best alias to use as a shortname and fullName.static MitabXreffindBestShortNameFromAlternativeIdentifiers(Collection<MitabXref> altids)Find the best id to use as a shortname.static StringfindDbSourceForAlias(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.static StringfindDbSourceForAlias(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.static StringfindDbSourceForAlias(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.static booleanisAnnotationAnInteractionTag(Annotation annot)To know if a publication annotation is an interactionTagstatic StringunescapeDoubleQuote(String stringToReplace)unescapeDoubleQuote.
-
-
-
Field Detail
-
LINE_BREAK
public static final String LINE_BREAK
ConstantLINE_BREAK="System.getProperty(line.separator)"
-
COLUMN_SEPARATOR
public static final String COLUMN_SEPARATOR
ConstantCOLUMN_SEPARATOR="\t"- See Also:
- Constant Field Values
-
FIELD_SEPARATOR
public static final String FIELD_SEPARATOR
ConstantFIELD_SEPARATOR="|"- See Also:
- Constant Field Values
-
EMPTY_COLUMN
public static final String EMPTY_COLUMN
ConstantEMPTY_COLUMN="-"- See Also:
- Constant Field Values
-
XREF_SEPARATOR
public static final String XREF_SEPARATOR
ConstantXREF_SEPARATOR=":"- See Also:
- Constant Field Values
-
RANGE_SEPARATOR
public static final String RANGE_SEPARATOR
ConstantRANGE_SEPARATOR=","- See Also:
- Constant Field Values
-
COMMENT_PREFIX
public static final String COMMENT_PREFIX
ConstantCOMMENT_PREFIX="#"- See Also:
- Constant Field Values
-
DATE_FORMAT
public static final DateFormat DATE_FORMAT
ConstantDATE_FORMAT
-
PUBLICATION_YEAR_FORMAT
public static final DateFormat PUBLICATION_YEAR_FORMAT
ConstantPUBLICATION_YEAR_FORMAT
-
UNKNOWN_DATABASE
public static final String UNKNOWN_DATABASE
ConstantUNKNOWN_DATABASE="unknown"- See Also:
- Constant Field Values
-
UNKNOWN_TYPE
public static final String UNKNOWN_TYPE
ConstantUNKNOWN_TYPE="unknown"- See Also:
- Constant Field Values
-
UNKNOWN_ID
public static final String UNKNOWN_ID
ConstantUNKNOWN_ID="unknown"- See Also:
- Constant Field Values
-
UNKNOWN_NAME
public static final String UNKNOWN_NAME
ConstantUNKNOWN_NAME="unspecified name"- See Also:
- Constant Field Values
-
AUTHOR_SUFFIX
public static final String AUTHOR_SUFFIX
ConstantAUTHOR_SUFFIX=" et al."- See Also:
- Constant Field Values
-
TAXID
public static final String TAXID
ConstantTAXID="taxid"- See Also:
- Constant Field Values
-
SHORTLABEL
public static final String SHORTLABEL
ConstantSHORTLABEL="shortlabel"- See Also:
- Constant Field Values
-
DISPLAY_SHORT
public static final String DISPLAY_SHORT
ConstantDISPLAY_SHORT="display_short"- See Also:
- Constant Field Values
-
DISPLAY_LONG
public static final String DISPLAY_LONG
ConstantDISPLAY_LONG="display_long"- See Also:
- Constant Field Values
-
SPECIAL_CHARACTERS
public static final String[] SPECIAL_CHARACTERS
ConstantSPECIAL_CHARACTERS="new String[]{FIELD_SEPARATOR,XREF_SEPAR"{trunked}
-
-
Method Detail
-
buildHeader
public static String[] buildHeader(MitabVersion version) throws IllegalArgumentException
Build the header and return an array of String which is an array of column names- Parameters:
version- aMitabVersionobject.- Returns:
- an array of
Stringobjects. - Throws:
IllegalArgumentException- if any.
-
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- aAliasobject.- 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- aParticipantEvidenceobject.alias- aAliasobject.- 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- aModelledParticipantobject.alias- aAliasobject.- Returns:
- a
Stringobject.
-
unescapeDoubleQuote
public static String unescapeDoubleQuote(String stringToReplace)
unescapeDoubleQuote.
-
isAnnotationAnInteractionTag
public static boolean isAnnotationAnInteractionTag(Annotation annot)
To know if a publication annotation is an interactionTag- Parameters:
annot- aAnnotationobject.- 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- aCollectionobject.- 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- aCollectionobject.- Returns:
- the best id to use as a shortname
-
-