/** * Get from a feature object the primaryId of an Xref having the given database. * * @param feature * @param database * * @return the primaryId of null if we can't find it. */ private String getFeatureId( FeatureTag feature, String database ) { for ( Iterator iterator = feature.getXrefs().iterator(); iterator.hasNext(); ) { XrefTag xref = (XrefTag) iterator.next(); if ( xref.getDb().equalsIgnoreCase( database ) ) { return xref.getId(); } } return null; }
/** * Get from a feature object the primaryId of an Xref having the given database. * * @param feature * @param database * * @return the primaryId of null if we can't find it. */ private String getFeatureId( FeatureTag feature, String database ) { for ( Iterator iterator = feature.getXrefs().iterator(); iterator.hasNext(); ) { XrefTag xref = (XrefTag) iterator.next(); if ( xref.getDb().equalsIgnoreCase( database ) ) { return xref.getId(); } } return null; }
/** * Get from a feature object the primaryId of an Xref having the given database. * * @param feature * @param database * * @return the primaryId of null if we can't find it. */ private String getFeatureId( FeatureTag feature, String database ) { for ( Iterator iterator = feature.getXrefs().iterator(); iterator.hasNext(); ) { XrefTag xref = (XrefTag) iterator.next(); if ( xref.getDb().equalsIgnoreCase( database ) ) { return xref.getId(); } } return null; }
public String toString() { final StringBuffer buf = new StringBuffer(); buf.append( "HostOrganismTag" ); buf.append( "{taxId=" ).append( taxId ); buf.append( ", tissue=" ); if ( null == tissue || tissue.getPsiDefinition() == null) { buf.append( '-' ); } else { buf.append( tissue.getPsiDefinition().getId() ); } buf.append( ", cellType=" ); if ( null == cellType || cellType.getPsiDefinition() == null) { buf.append( '-' ); } else { buf.append( cellType.getPsiDefinition().getId() ); } buf.append( '}' ); return buf.toString(); } }
public String toString() { final StringBuffer buf = new StringBuffer(); buf.append( "HostOrganismTag" ); buf.append( "{taxId=" ).append( taxId ); buf.append( ", tissue=" ); if ( null == tissue || tissue.getPsiDefinition() == null) { buf.append( '-' ); } else { buf.append( tissue.getPsiDefinition().getId() ); } buf.append( ", cellType=" ); if ( null == cellType || cellType.getPsiDefinition() == null) { buf.append( '-' ); } else { buf.append( cellType.getPsiDefinition().getId() ); } buf.append( '}' ); return buf.toString(); } }
public String toString() { final StringBuffer buf = new StringBuffer(); buf.append( "HostOrganismTag" ); buf.append( "{taxId=" ).append( taxId ); buf.append( ", tissue=" ); if ( null == tissue || tissue.getPsiDefinition() == null) { buf.append( '-' ); } else { buf.append( tissue.getPsiDefinition().getId() ); } buf.append( ", cellType=" ); if ( null == cellType || cellType.getPsiDefinition() == null) { buf.append( '-' ); } else { buf.append( cellType.getPsiDefinition().getId() ); } buf.append( '}' ); return buf.toString(); } }
public static void check( final InteractionTypeTag interactionType ) { final XrefTag psiDef = interactionType.getPsiDefinition(); XrefChecker.check( psiDef ); final String id = psiDef.getId(); if ( !cache.keySet().contains( id ) ) { CvInteractionType cvInteractionType = null; try { cvInteractionType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvInteractionType.class, id); if ( cvInteractionType == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractionType " + "for the PSI definition: " + id ) ); } else { System.out.println( "Found InteractionType " + id + " as " + cvInteractionType.getShortLabel() ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvInteractionType " + "having the PSI definition: " + id ) ); e.printStackTrace(); } cache.put( id, cvInteractionType ); } } }
public static void check( final ParticipantDetectionTag participantDetection ) { final XrefTag psiDef = participantDetection.getPsiDefinition(); XrefChecker.check( psiDef ); final String id = psiDef.getId(); if ( !cache.keySet().contains( id ) ) { CvIdentification cvIdentification = null; try { cvIdentification = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvIdentification.class,id); if ( cvIdentification == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvIdentification for the PSI definition: " + id ) ); } else { System.out.println( "Found ParticipantDetection " + id + " as " + cvIdentification.getShortLabel() ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvInteraction " + "having the PSI definition: " + id ) ); e.printStackTrace(); } cache.put( id, cvIdentification ); } } }
public static void check( final InteractionDetectionTag interactionDetection ) { final XrefTag psiDef = interactionDetection.getPsiDefinition(); XrefChecker.check( psiDef ); final String id = psiDef.getId(); if ( !cache.keySet().contains( id ) ) { CvInteraction cvInteraction = null; try { cvInteraction = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvInteraction.class,id); if ( cvInteraction == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteraction by PSI definition: " + id ) ); } else { System.out.println( "Found CvInteraction " + id + " as " + cvInteraction.getShortLabel() ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvInteraction " + "having the PSI definition: " + id ) ); e.printStackTrace(); } cache.put( id, cvInteraction ); } } }
private static void checkCvTypeIdentification( FeatureTag feature ) { XrefTag psiDef = feature.getFeatureType().getPsiDefinition(); XrefChecker.check( psiDef ); final String id = psiDef.getId(); if ( !featureTypeCache.keySet().contains( id ) ) { CvFeatureType featureType = null; try { featureType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvFeatureType.class,id); if ( featureType == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvFeatureType by PSI definition: " + id ) ); } else { System.out.println( "Found CvFeatureType " + id + " as " + featureType.getShortLabel() ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvFeatureType " + "having the PSI definition: " + id ) ); e.printStackTrace(); } featureTypeCache.put( id, featureType ); } }
private static void checkCvTypeIdentification( FeatureTag feature ) { XrefTag psiDef = feature.getFeatureType().getPsiDefinition(); XrefChecker.check( psiDef ); final String id = psiDef.getId(); if ( !featureTypeCache.keySet().contains( id ) ) { CvFeatureType featureType = null; try { featureType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvFeatureType.class,id); if ( featureType == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvFeatureType by PSI definition: " + id ) ); } else { System.out.println( "Found CvFeatureType " + id + " as " + featureType.getShortLabel() ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvFeatureType " + "having the PSI definition: " + id ) ); e.printStackTrace(); } featureTypeCache.put( id, featureType ); } }
public static void check( final InteractionTypeTag interactionType ) { final XrefTag psiDef = interactionType.getPsiDefinition(); XrefChecker.check( psiDef ); final String id = psiDef.getId(); if ( !cache.keySet().contains( id ) ) { CvInteractionType cvInteractionType = null; try { cvInteractionType = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvInteractionType.class).getByXref(id); if ( cvInteractionType == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractionType " + "for the PSI definition: " + id ) ); } else { System.out.println( "Found InteractionType " + id + " as " + cvInteractionType.getShortLabel() ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvInteractionType " + "having the PSI definition: " + id ) ); e.printStackTrace(); } cache.put( id, cvInteractionType ); } } }
private static void checkCvFeatureIdentification( FeatureTag feature ) { final XrefTag psiDef = feature.getFeatureDetection().getPsiDefinition(); XrefChecker.check( psiDef ); final String id = psiDef.getId(); if ( !featureIdentificationCache.keySet().contains( id ) ) { CvFeatureIdentification cvFeatureIdentification = null; try { cvFeatureIdentification = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvFeatureIdentification.class).getByXref(id); if ( cvFeatureIdentification == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvFeatureIdentification by PSI definition: " + id ) ); } else { System.out.println( "Found CvFeatureIdentification " + id + " as " + cvFeatureIdentification.getShortLabel() ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvFeatureIdentification " + "having the PSI definition: " + id ) ); e.printStackTrace(); } featureIdentificationCache.put( id, cvFeatureIdentification ); } } }
private static void checkCvTypeIdentification( FeatureTag feature ) { XrefTag psiDef = feature.getFeatureType().getPsiDefinition(); XrefChecker.check( psiDef ); final String id = psiDef.getId(); if ( !featureTypeCache.keySet().contains( id ) ) { CvFeatureType featureType = null; try { featureType = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvFeatureType.class).getByXref(id); if ( featureType == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvFeatureType by PSI definition: " + id ) ); } else { System.out.println( "Found CvFeatureType " + id + " as " + featureType.getShortLabel() ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvFeatureType " + "having the PSI definition: " + id ) ); e.printStackTrace(); } featureTypeCache.put( id, featureType ); } }
/** * Get an Intact Protein out of a ProteinInteractorTag. * * @param proteinParticipant * * @return the IntAct Protein correcponding to the given ProteinParticipantTag. */ private static ProteinHolder getProtein( final ProteinParticipantTag proteinParticipant ) { final ProteinInteractorTag proteinInteractor = proteinParticipant.getProteinInteractor(); OrganismTag organism = proteinInteractor.getOrganism(); BioSource bioSource = null; if ( organism != null ) { bioSource = OrganismChecker.getBioSource( proteinInteractor.getOrganism() ); } String proteinId = proteinInteractor.getPrimaryXref().getId(); String db = proteinInteractor.getPrimaryXref().getDb(); // System.out.println( "Search interactor (" + proteinInteractor.getShortlabel() + ") from cache(" + // proteinId + ", " + db + ", " + bioSource.getShortLabel() + ")" ); return ProteinInteractorChecker.getProtein( proteinId, db, bioSource ); } }
/** * Get an Intact Protein out of a ProteinInteractorTag. * * @param proteinParticipant * * @return the IntAct Protein correcponding to the given ProteinParticipantTag. */ private static ProteinHolder getProtein( final ProteinParticipantTag proteinParticipant ) { final ProteinInteractorTag proteinInteractor = proteinParticipant.getProteinInteractor(); OrganismTag organism = proteinInteractor.getOrganism(); BioSource bioSource = null; if ( organism != null ) { bioSource = OrganismChecker.getBioSource( proteinInteractor.getOrganism() ); } String proteinId = proteinInteractor.getPrimaryXref().getId(); String db = proteinInteractor.getPrimaryXref().getDb(); // System.out.println( "Search interactor (" + proteinInteractor.getShortlabel() + ") from cache(" + // proteinId + ", " + db + ", " + bioSource.getShortLabel() + ")" ); return ProteinInteractorChecker.getProtein( proteinId, db, bioSource ); } }
/** * Get an Intact Protein out of a ProteinInteractorTag. * * @param proteinParticipant * * @return the IntAct Protein correcponding to the given ProteinParticipantTag. */ private static ProteinHolder getProtein( final ProteinParticipantTag proteinParticipant ) { final ProteinInteractorTag proteinInteractor = proteinParticipant.getProteinInteractor(); OrganismTag organism = proteinInteractor.getOrganism(); BioSource bioSource = null; if ( organism != null ) { bioSource = OrganismChecker.getBioSource( proteinInteractor.getOrganism() ); } String proteinId = proteinInteractor.getPrimaryXref().getId(); String db = proteinInteractor.getPrimaryXref().getDb(); // System.out.println( "Search interactor (" + proteinInteractor.getShortlabel() + ") from cache(" + // proteinId + ", " + db + ", " + bioSource.getShortLabel() + ")" ); return ProteinInteractorChecker.getProtein( proteinId, db, bioSource ); } }
private static void createXref( Protein protein, XrefTag xrefTag, boolean identity ) throws IntactException { CvXrefQualifier qualifier = null; if ( identity ) { qualifier = ControlledVocabularyRepository.getIdentityQualifier(); } CvDatabase database = XrefChecker.getCvDatabase( xrefTag.getDb() ); if ( database == null ) { // failed to find the database, skip the Xref creation } else { InteractorXref xref = new InteractorXref( IntactContext.getCurrentInstance().getInstitution(), database, xrefTag.getId(), xrefTag.getSecondary(), xrefTag.getVersion(), qualifier ); protein.addXref( xref ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref ); } }
private static void createXref( Protein protein, XrefTag xrefTag, boolean identity ) throws IntactException { CvXrefQualifier qualifier = null; if ( identity ) { qualifier = ControlledVocabularyRepository.getIdentityQualifier(); } CvDatabase database = XrefChecker.getCvDatabase( xrefTag.getDb() ); if ( database == null ) { // failed to find the database, skip the Xref creation } else { InteractorXref xref = new InteractorXref( IntactContext.getCurrentInstance().getInstitution(), database, xrefTag.getId(), xrefTag.getSecondary(), xrefTag.getVersion(), qualifier ); protein.addXref( xref ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref ); } }
private static void createXref( Protein protein, XrefTag xrefTag, boolean identity ) throws IntactException { CvXrefQualifier qualifier = null; if ( identity ) { qualifier = ControlledVocabularyRepository.getIdentityQualifier(); } CvDatabase database = XrefChecker.getCvDatabase( xrefTag.getDb() ); if ( database == null ) { // failed to find the database, skip the Xref creation } else { InteractorXref xref = new InteractorXref( IntactContext.getCurrentInstance().getInstitution(), database, xrefTag.getId(), xrefTag.getSecondary(), xrefTag.getVersion(), qualifier ); protein.addXref( xref ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getXrefDao().persist( xref ); } }