本文整理了Java中uk.ac.ebi.intact.model.util.XrefUtils.getIdentityXref()
方法的一些代码示例,展示了XrefUtils.getIdentityXref()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XrefUtils.getIdentityXref()
方法的具体详情如下:
包路径:uk.ac.ebi.intact.model.util.XrefUtils
类名称:XrefUtils
方法名:getIdentityXref
暂无
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly
public static <X extends Xref> X getIdentityXref(AnnotatedObject<X, ?> annotatedObject, CvDatabase cvDatabase) {
String dbMi = cvDatabase.getIdentifier();
return getIdentityXref(annotatedObject, dbMi);
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
/**
* Gets the unique identifier of a CvObject. If it has PSI MI Identifier (miIdentifier) return it,
* if not, return the 'CvDatabase.intact' identifier; otherwise return the primaryId of the first identity xref found.
*
* @param cvObject The object to get the identifier from.
* @return The identifier. Will be null if no miIdentifier or identity xref is found.
* @since 1.8.0
*/
public static String getIdentity(CvObject cvObject) {
if (cvObject == null) return null;
// try the PSI MI first
if (cvObject.getIdentifier() != null) {
return cvObject.getIdentifier();
}
// try to get the identity with CvDatabase 'intact'
CvObjectXref idXref = XrefUtils.getIdentityXref(cvObject, CvDatabase.INTACT);
// get the first identity, if any
if (idXref == null) {
Collection<CvObjectXref> idXrefs = XrefUtils.getIdentityXrefs(cvObject);
if (!idXrefs.isEmpty()) {
idXref = idXrefs.iterator().next();
}
}
return (idXref != null) ? idXref.getPrimaryId() : null;
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly
/**
* Gets the unique identifier of a CvObject. If it has PSI MI Identifier (miIdentifier) return it,
* if not, return the 'CvDatabase.intact' identifier; otherwise return the primaryId of the first identity xref found.
*
* @param cvObject The object to get the identifier from.
* @return The identifier. Will be null if no miIdentifier or identity xref is found.
* @since 1.8.0
*/
public static String getIdentity(CvObject cvObject) {
if (cvObject == null) return null;
// try the PSI MI first
if (cvObject.getIdentifier() != null) {
return cvObject.getIdentifier();
}
// try to get the identity with CvDatabase 'intact'
CvObjectXref idXref = XrefUtils.getIdentityXref(cvObject, CvDatabase.INTACT);
// get the first identity, if any
if (idXref == null) {
Collection<CvObjectXref> idXrefs = XrefUtils.getIdentityXrefs(cvObject);
if (!idXrefs.isEmpty()) {
idXref = idXrefs.iterator().next();
}
}
return (idXref != null) ? idXref.getPrimaryId() : null;
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
public static <X extends Xref> X getIdentityXref(AnnotatedObject<X, ?> annotatedObject, CvDatabase cvDatabase) {
String dbMi = cvDatabase.getIdentifier();
return getIdentityXref(annotatedObject, dbMi);
}
代码示例来源:origin: uk.ac.ebi.intact.dbupdate/intact-cv-update
private void initializeIdentityValue(IntactOntologyAccess ontologyAccess){
CvObjectXref currentIdentityXref = XrefUtils.getIdentityXref(currentIntactParent, ontologyAccess.getDatabaseIdentifier());
// this parent cannot be updated because is not from the same ontology
if (currentIdentityXref == null && ontologyAccess.getDatabaseRegexp() != null){
Matcher matcher = ontologyAccess.getDatabaseRegexp().matcher(currentIntactParent.getIdentifier());
if (matcher.find() && matcher.group().equalsIgnoreCase(currentIntactParent.getIdentifier())){
currentIdentity = currentIntactParent.getIdentifier();
}
else {
currentIdentity = null;
}
}
else {
currentIdentity = currentIdentityXref.getPrimaryId();
}
}
代码示例来源:origin: uk.ac.ebi.intact.dbupdate/intact-cv-update
private void initializeIdentityValue(IntactOntologyAccess ontologyAccess){
CvObjectXref currentIdentityXref = XrefUtils.getIdentityXref(currentIntactParent, ontologyAccess.getDatabaseIdentifier());
// this parent cannot be updated because is not from the same ontology
if (currentIdentityXref == null && ontologyAccess.getDatabaseRegexp() != null){
Matcher matcher = ontologyAccess.getDatabaseRegexp().matcher(currentIntactParent.getIdentifier());
if (matcher.find() && matcher.group().equalsIgnoreCase(currentIntactParent.getIdentifier())){
currentIdentity = currentIntactParent.getIdentifier();
}
else {
currentIdentity = null;
}
}
else {
currentIdentity = currentIdentityXref.getPrimaryId();
}
}
代码示例来源:origin: uk.ac.ebi.intact.dbupdate/intact-cv-update
CvObjectXref identity1 = XrefUtils.getIdentityXref(o1, dbIdentifier);
CvObjectXref identity2 = XrefUtils.getIdentityXref(o2, dbIdentifier);
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly
InteractorXref idPdbXref = XrefUtils.getIdentityXref(interaction, CvDatabase.RCSB_PDB_MI_REF);
InteractorXref idMsdXref = XrefUtils.getIdentityXref(interaction, CvDatabase.MSD_PDB_MI_REF);
InteractorXref idWwXref = XrefUtils.getIdentityXref(interaction, CvDatabase.WWPDB_MI_REF);
if (idPdbXref != null) sb.append(idPdbXref.getPrimaryId());
if (idMsdXref != null) sb.append(idMsdXref.getPrimaryId());
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
InteractorXref idPdbXref = XrefUtils.getIdentityXref(interaction, CvDatabase.RCSB_PDB_MI_REF);
InteractorXref idMsdXref = XrefUtils.getIdentityXref(interaction, CvDatabase.MSD_PDB_MI_REF);
InteractorXref idWwXref = XrefUtils.getIdentityXref(interaction, CvDatabase.WWPDB_MI_REF);
if (idPdbXref != null) sb.append(idPdbXref.getPrimaryId());
if (idMsdXref != null) sb.append(idMsdXref.getPrimaryId());
内容来源于网络,如有侵权,请联系作者删除!