Package psidev.psi.mi.jami.utils
Class XrefUtils
- java.lang.Object
-
- psidev.psi.mi.jami.utils.XrefUtils
-
public class XrefUtils extends Object
Utility class for Xrefs- Since:
24/01/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description XrefUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Collection<Xref>
collectAllIdentifiersFrom(Collection<? extends Xref> refs)
Method to return a sub collection of identifiers (qualifier identity or secondary) in a list of Xrefsstatic Collection<Xref>
collectAllXrefsHavingDatabase(Collection<? extends Xref> refs, String dbId, String dbName)
Collect all cross references having a specific databasestatic Collection<Xref>
collectAllXrefsHavingDatabaseAndId(Collection<? extends Xref> refs, String dbId, String dbName, String id)
Collect all cross references having a specific databasestatic Collection<Xref>
collectAllXrefsHavingDatabaseAndQualifier(Collection<? extends Xref> refs, String dbId, String dbName, String qualifierId, String qualifierName)
Collect all cross references having a specific database and qualifierstatic Collection<Xref>
collectAllXrefsHavingDatabaseQualifierAndId(Collection<? extends Xref> refs, String dbId, String dbName, String id, String qualifierId, String qualifierName)
Collect all cross references having a specific database and qualifierstatic Collection<Xref>
collectAllXrefsHavingQualifier(Collection<? extends Xref> refs, String qualifierId, String qualifierName)
Collect all cross references having a specific qualifierstatic Collection<Xref>
collectAllXrefsHavingQualifierAndId(Collection<? extends Xref> refs, String qualifierId, String qualifierName, String id)
Collect all cross references having a specific qualifierstatic Xref
collectFirstIdentifierWithDatabase(Collection<? extends Xref> refs, String dbId, String dbName)
This method will return the first Xref from this database having : - identity qualifier - secondary identifier if no identity qualifier - first Xref from this database if no identity or secondary qualifier It will return null if there are no Xrefs with this database id/namestatic Xref
collectFirstIdentifierWithDatabaseAndId(Collection<? extends Xref> refs, String dbId, String dbName, String id)
This method will return the first Xref from this database having : - identity qualifier - secondary identifier if no identity qualifier - first Xref from this database if no identity or secondary qualifier It will return null if there are no Xrefs with this database id/namestatic Xref
createChebiIdentity(String id)
createChebiIdentitystatic Xref
createChebiSecondary(String id)
createChebiSecondarystatic Xref
createDdbjEmblGenbankIdentity(String id)
createDdbjEmblGenbankIdentitystatic Xref
createDdbjEmblGenbankSecondary(String id)
createDdbjEmblGenbankSecondarystatic Xref
createDoiIdentity(String id)
createDoiIdentitystatic Xref
createEnsemblGenomesIdentity(String ensembl)
createEnsemblGenomesIdentitystatic Xref
createEnsemblGenomesSecondary(String ensembl)
createEnsemblGenomesSecondarystatic Xref
createEnsemblIdentity(String ensembl)
createEnsemblIdentitystatic Xref
createEnsemblSecondary(String ensembl)
createEnsemblSecondarystatic Xref
createEntrezGeneIdIdentity(String geneId)
createEntrezGeneIdIdentitystatic Xref
createEntrezGeneIdSecondary(String geneId)
createEntrezGeneIdSecondarystatic Xref
createIdentityXref(String databaseName, String id)
createIdentityXrefstatic Xref
createIdentityXref(String databaseName, String databaseMi, String id)
createIdentityXrefstatic Xref
createPrimaryXref(String databaseName, String id)
createPrimaryXrefstatic Xref
createPrimaryXref(String databaseName, String databaseMi, String id)
createPrimaryXrefstatic Xref
createPsiMiIdentity(String id)
createPsiMiIdentitystatic Xref
createPsiMiSecondary(String id)
createPsiMiSecondarystatic Xref
createPsiModIdentity(String id)
createPsiModIdentitystatic Xref
createPsiModSecondary(String id)
createPsiModSecondarystatic Xref
createPubmedIdentity(String id)
createPubmedIdentitystatic Xref
createRefseqIdentity(String refseq)
createRefseqIdentitystatic Xref
createRefseqSecondary(String refseq)
createRefseqSecondarystatic Xref
createSecondaryXref(String databaseName, String id)
createSecondaryXrefstatic Xref
createSecondaryXref(String databaseName, String databaseMi, String id)
createSecondaryXrefstatic Xref
createUniprotIdentity(String uniprot)
createUniprotIdentitystatic Xref
createUniprotSecondary(String uniprot)
createUniprotSecondarystatic Xref
createXref(String databaseName, String id)
createXrefstatic Xref
createXref(String databaseName, String databaseMi, String id)
createXrefstatic Xref
createXrefWithQualifier(String databaseName, String id, String qualifierName)
createXrefWithQualifierstatic Xref
createXrefWithQualifier(String databaseName, String databaseMi, String id, String qualifierName, String qualifierMi)
createXrefWithQualifierstatic Xref
createXrefWithQualifier(String databaseName, String databaseMi, String id, String version, String qualifierName, String qualifierMi)
createXrefWithQualifierAndVersionstatic boolean
doesXrefHaveDatabaseAndId(Xref ref, String dbId, String dbName, String id)
Method to know if a Xref is from the same database (dbId is the MI identifier and dbName is the database shortname)static boolean
doesXrefHaveQualifier(Xref ref, String qualifierId, String qualifierName)
Method to know if a Xref has the same qualifier (qualifierId is the MI identifier and qualifierName is the qualifier shortname)static boolean
doesXrefHaveQualifierAndId(Xref ref, String qualifierId, String qualifierName, String id)
Method to know if a Xref has the same qualifier (qualifierId is the MI identifier and qualifierName is the qualifier shortname)static boolean
isXrefAnIdentifier(Xref ref)
Method to know if a Xref is a potential identifier.static boolean
isXrefFromDatabase(Xref ref, String dbId, String dbName)
Method to know if a Xref is from the same database (dbId is the MI identifier and dbName is the database shortname)static void
removeAllXrefsWithDatabase(Collection<? extends Xref> refs, String dbId, String dbName)
Remove all Xrefs having this database name/database id from the collection of xrefsstatic void
removeAllXrefsWithDatabaseAndId(Collection<? extends Xref> refs, String dbId, String dbName, String id)
Remove all Xrefs having this database name/database id from the collection of xrefsstatic Collection<Xref>
searchAllXrefsHavingDatabaseAndQualifier(Collection<Xref> xrefs, Collection<String> dbMiRefs, Collection<String> dbRefs, Collection<String> typeMiRefs, Collection<String> typeRefs)
Collect all cross references having specific databases and qualifiersstatic Collection<Xref>
searchAllXrefsHavingDatabases(Collection<Xref> xrefs, Collection<String> dbMiRefs, Collection<String> dbRefs)
Collect all Xrefs having specific databases
-
-
-
Method Detail
-
isXrefAnIdentifier
public static boolean isXrefAnIdentifier(Xref ref)
Method to know if a Xref is a potential identifier. It can be an identity xref or a secondary xref.- Parameters:
ref
- : the Xref- Returns:
- true if the Xref has a qualifier identity or secondary-ac
-
isXrefFromDatabase
public static boolean isXrefFromDatabase(Xref ref, String dbId, String dbName)
Method to know if a Xref is from the same database (dbId is the MI identifier and dbName is the database shortname)- Parameters:
ref
- : the XrefdbId
- : the database MI identifierdbName
- : the database shortname- Returns:
- true if the Xref has a database MI which is dbId or database shortname which is dbName
-
doesXrefHaveQualifier
public static boolean doesXrefHaveQualifier(Xref ref, String qualifierId, String qualifierName)
Method to know if a Xref has the same qualifier (qualifierId is the MI identifier and qualifierName is the qualifier shortname)- Parameters:
ref
- : the XrefqualifierId
- : the qualifier MI identifierqualifierName
- : the qualifier shortname- Returns:
- true if the Xref has a qualifier MI which is qualifierId or qualifier shortname which is qualifierName
-
doesXrefHaveDatabaseAndId
public static boolean doesXrefHaveDatabaseAndId(Xref ref, String dbId, String dbName, String id)
Method to know if a Xref is from the same database (dbId is the MI identifier and dbName is the database shortname)- Parameters:
ref
- : the XrefdbId
- : the database MI identifierdbName
- : the database shortnameid
- : database id- Returns:
- true if the Xref has a database MI which is dbId or database shortname which is dbName
-
doesXrefHaveQualifierAndId
public static boolean doesXrefHaveQualifierAndId(Xref ref, String qualifierId, String qualifierName, String id)
Method to know if a Xref has the same qualifier (qualifierId is the MI identifier and qualifierName is the qualifier shortname)- Parameters:
ref
- : the XrefqualifierId
- : the qualifier MI identifierqualifierName
- : the qualifier shortnameid
- : database id- Returns:
- true if the Xref has a qualifier MI which is qualifierId or qualifier shortname which is qualifierName
-
collectAllIdentifiersFrom
public static Collection<Xref> collectAllIdentifiersFrom(Collection<? extends Xref> refs)
Method to return a sub collection of identifiers (qualifier identity or secondary) in a list of Xrefs- Parameters:
refs
- aCollection
object.- Returns:
- the sublist of identifiers (qualifier identity or secondary) from the list of Xrefs
-
collectAllXrefsHavingQualifier
public static Collection<Xref> collectAllXrefsHavingQualifier(Collection<? extends Xref> refs, String qualifierId, String qualifierName)
Collect all cross references having a specific qualifier- Parameters:
refs
- aCollection
object.qualifierId
- aString
object.qualifierName
- aString
object.- Returns:
- a
Collection
object.
-
collectAllXrefsHavingDatabase
public static Collection<Xref> collectAllXrefsHavingDatabase(Collection<? extends Xref> refs, String dbId, String dbName)
Collect all cross references having a specific database- Parameters:
refs
- aCollection
object.dbId
- aString
object.dbName
- aString
object.- Returns:
- a
Collection
object.
-
collectAllXrefsHavingDatabaseAndQualifier
public static Collection<Xref> collectAllXrefsHavingDatabaseAndQualifier(Collection<? extends Xref> refs, String dbId, String dbName, String qualifierId, String qualifierName)
Collect all cross references having a specific database and qualifier- Parameters:
refs
- aCollection
object.dbId
- aString
object.dbName
- aString
object.qualifierId
- aString
object.qualifierName
- aString
object.- Returns:
- a
Collection
object.
-
collectAllXrefsHavingQualifierAndId
public static Collection<Xref> collectAllXrefsHavingQualifierAndId(Collection<? extends Xref> refs, String qualifierId, String qualifierName, String id)
Collect all cross references having a specific qualifier- Parameters:
refs
- aCollection
object.qualifierId
- aString
object.qualifierName
- aString
object.id
- aString
object.- Returns:
- a
Collection
object.
-
collectAllXrefsHavingDatabaseAndId
public static Collection<Xref> collectAllXrefsHavingDatabaseAndId(Collection<? extends Xref> refs, String dbId, String dbName, String id)
Collect all cross references having a specific database- Parameters:
refs
- aCollection
object.dbId
- aString
object.dbName
- aString
object.id
- aString
object.- Returns:
- a
Collection
object.
-
collectAllXrefsHavingDatabaseQualifierAndId
public static Collection<Xref> collectAllXrefsHavingDatabaseQualifierAndId(Collection<? extends Xref> refs, String dbId, String dbName, String id, String qualifierId, String qualifierName)
Collect all cross references having a specific database and qualifier- Parameters:
refs
- aCollection
object.dbId
- aString
object.dbName
- aString
object.qualifierId
- aString
object.qualifierName
- aString
object.id
- aString
object.- Returns:
- a
Collection
object.
-
searchAllXrefsHavingDatabaseAndQualifier
public static Collection<Xref> searchAllXrefsHavingDatabaseAndQualifier(Collection<Xref> xrefs, Collection<String> dbMiRefs, Collection<String> dbRefs, Collection<String> typeMiRefs, Collection<String> typeRefs)
Collect all cross references having specific databases and qualifiers- Parameters:
xrefs
- aCollection
object.dbMiRefs
- aCollection
object.dbRefs
- aCollection
object.typeMiRefs
- aCollection
object.typeRefs
- aCollection
object.- Returns:
- a
Collection
object.
-
searchAllXrefsHavingDatabases
public static Collection<Xref> searchAllXrefsHavingDatabases(Collection<Xref> xrefs, Collection<String> dbMiRefs, Collection<String> dbRefs)
Collect all Xrefs having specific databases- Parameters:
xrefs
- aCollection
object.dbMiRefs
- aCollection
object.dbRefs
- aCollection
object.- Returns:
- a
Collection
object.
-
collectFirstIdentifierWithDatabase
public static Xref collectFirstIdentifierWithDatabase(Collection<? extends Xref> refs, String dbId, String dbName)
This method will return the first Xref from this database having : - identity qualifier - secondary identifier if no identity qualifier - first Xref from this database if no identity or secondary qualifier It will return null if there are no Xrefs with this database id/name- Parameters:
refs
- : the collection of XrefsdbId
- : the database id to look fordbName
- : the database name to look for- Returns:
- the first identifier having this database name/id, null if no Xrefs with this database name/id
-
removeAllXrefsWithDatabase
public static void removeAllXrefsWithDatabase(Collection<? extends Xref> refs, String dbId, String dbName)
Remove all Xrefs having this database name/database id from the collection of xrefs- Parameters:
refs
- : the collection of XrefsdbId
- : the database id to look fordbName
- : the database name to look for
-
collectFirstIdentifierWithDatabaseAndId
public static Xref collectFirstIdentifierWithDatabaseAndId(Collection<? extends Xref> refs, String dbId, String dbName, String id)
This method will return the first Xref from this database having : - identity qualifier - secondary identifier if no identity qualifier - first Xref from this database if no identity or secondary qualifier It will return null if there are no Xrefs with this database id/name- Parameters:
refs
- : the collection of XrefsdbId
- : the database id to look fordbName
- : the database name to look forid
- aString
object.- Returns:
- the first identifier having this database name/id, null if no Xrefs with this database name/id
-
removeAllXrefsWithDatabaseAndId
public static void removeAllXrefsWithDatabaseAndId(Collection<? extends Xref> refs, String dbId, String dbName, String id)
Remove all Xrefs having this database name/database id from the collection of xrefs- Parameters:
refs
- : the collection of XrefsdbId
- : the database id to look fordbName
- : the database name to look forid
- aString
object.
-
createXref
public static Xref createXref(String databaseName, String databaseMi, String id)
createXref
-
createXrefWithQualifier
public static Xref createXrefWithQualifier(String databaseName, String databaseMi, String id, String version, String qualifierName, String qualifierMi)
createXrefWithQualifierAndVersion
-
createXrefWithQualifier
public static Xref createXrefWithQualifier(String databaseName, String databaseMi, String id, String qualifierName, String qualifierMi)
createXrefWithQualifier
-
createXrefWithQualifier
public static Xref createXrefWithQualifier(String databaseName, String id, String qualifierName)
createXrefWithQualifier
-
createIdentityXref
public static Xref createIdentityXref(String databaseName, String databaseMi, String id)
createIdentityXref
-
createIdentityXref
public static Xref createIdentityXref(String databaseName, String id)
createIdentityXref
-
createSecondaryXref
public static Xref createSecondaryXref(String databaseName, String databaseMi, String id)
createSecondaryXref
-
createSecondaryXref
public static Xref createSecondaryXref(String databaseName, String id)
createSecondaryXref
-
createPrimaryXref
public static Xref createPrimaryXref(String databaseName, String databaseMi, String id)
createPrimaryXref
-
createPrimaryXref
public static Xref createPrimaryXref(String databaseName, String id)
createPrimaryXref
-
createUniprotIdentity
public static Xref createUniprotIdentity(String uniprot)
createUniprotIdentity
-
createEnsemblIdentity
public static Xref createEnsemblIdentity(String ensembl)
createEnsemblIdentity
-
createEnsemblGenomesIdentity
public static Xref createEnsemblGenomesIdentity(String ensembl)
createEnsemblGenomesIdentity
-
createEntrezGeneIdIdentity
public static Xref createEntrezGeneIdIdentity(String geneId)
createEntrezGeneIdIdentity
-
createDdbjEmblGenbankIdentity
public static Xref createDdbjEmblGenbankIdentity(String id)
createDdbjEmblGenbankIdentity
-
createUniprotSecondary
public static Xref createUniprotSecondary(String uniprot)
createUniprotSecondary
-
createRefseqSecondary
public static Xref createRefseqSecondary(String refseq)
createRefseqSecondary
-
createEnsemblSecondary
public static Xref createEnsemblSecondary(String ensembl)
createEnsemblSecondary
-
createEnsemblGenomesSecondary
public static Xref createEnsemblGenomesSecondary(String ensembl)
createEnsemblGenomesSecondary
-
createEntrezGeneIdSecondary
public static Xref createEntrezGeneIdSecondary(String geneId)
createEntrezGeneIdSecondary
-
createDdbjEmblGenbankSecondary
public static Xref createDdbjEmblGenbankSecondary(String id)
createDdbjEmblGenbankSecondary
-
-