/** * create the lucene index. Gets first all search objects (experiments, interactions, proteins, cvs and biosources) * out of the database and creates then the index of these objects. This is a very trivial (first) version it writes * everything on scratch without using the RAM. It is recommanded to use instead the method 'createLuceneIndex' * * @param aSearchObject a search object */ public void createIndex( final SearchObject aSearchObject ) { SearchObjectIndexer searchObjectIndexer = new SearchObjectIndexer( analyzer, index.getPath() ); logger.info( "Write the index into: " + index.getPath() ); Collection allSearchObjects = null; Chrono time = new Chrono(); try { time.start(); allSearchObjects = dao.getAllSearchObjects(); time.stop(); System.out.println( "time to get " + allSearchObjects.size() + " search objects: " + time.toString() ); } catch ( IntactException e ) { logger.error( e ); e.printStackTrace(); } for ( Iterator iterator = allSearchObjects.iterator(); iterator.hasNext(); ) { SearchObject searchObject = ( SearchObject ) iterator.next(); searchObjectIndexer.createIndex( searchObject ); } }
/** * create the lucene index. Gets first all search objects (experiments, interactions, proteins, cvs and biosources) * out of the database and creates then the index of these objects. This is a very trivial (first) version it writes * everything on scratch without using the RAM. It is recommanded to use instead the method 'createLuceneIndex' * * @param aSearchObject a search object */ public void createIndex( final SearchObject aSearchObject ) { SearchObjectIndexer searchObjectIndexer = new SearchObjectIndexer( analyzer, index.getPath() ); logger.info( "Write the index into: " + index.getPath() ); Collection allSearchObjects = null; Chrono time = new Chrono(); try { time.start(); allSearchObjects = dao.getAllSearchObjects(); time.stop(); System.out.println( "time to get " + allSearchObjects.size() + " search objects: " + time.toString() ); } catch ( IntactException e ) { logger.error( e ); e.printStackTrace(); } for ( Iterator iterator = allSearchObjects.iterator(); iterator.hasNext(); ) { SearchObject searchObject = (SearchObject) iterator.next(); searchObjectIndexer.createIndex( searchObject ); } }
public static void check( final XrefTag xref ) { final String db = xref.getDb(); if ( !cache.keySet().contains( db ) ) { CvDatabase cvDatabase = null; try { cvDatabase = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvDatabase.class, db ); if ( cvDatabase != null ) { System.out.println( "Found CvDatabase with shortlabel: " + db ); } else { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvDatabase " + "by shortlabel: " + db ) ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " + "for CvDatabase " + "having the shortlabel: " + db ) ); e.printStackTrace(); } cache.put( db, cvDatabase ); } } }
public static void check( final XrefTag xref ) { final String db = xref.getDb(); if ( !cache.keySet().contains( db ) ) { CvDatabase cvDatabase = null; try { cvDatabase = IntactContext.getCurrentInstance().getCvContext().getByLabel(CvDatabase.class, db ); if ( cvDatabase != null ) { System.out.println( "Found CvDatabase with shortlabel: " + db ); } else { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvDatabase " + "by shortlabel: " + db ) ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " + "for CvDatabase " + "having the shortlabel: " + db ) ); e.printStackTrace(); } cache.put( db, cvDatabase ); } } }
public static void check( final XrefTag xref ) { final String db = xref.getDb(); if ( !cache.keySet().contains( db ) ) { CvDatabase cvDatabase = null; try { cvDatabase = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvDatabase.class).getByShortLabel( db ); if ( cvDatabase != null ) { System.out.println( "Found CvDatabase with shortlabel: " + db ); } else { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvDatabase " + "by shortlabel: " + db ) ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " + "for CvDatabase " + "having the shortlabel: " + db ) ); e.printStackTrace(); } cache.put( db, cvDatabase ); } } }
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 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 ); } } }
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 ); } } }
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 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 ); } } }
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 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().getCvContext().getByMiRef(CvFeatureIdentification.class,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().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 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().getCvContext().getByMiRef(CvFeatureIdentification.class,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 ); } } }
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().getDataContext().getDaoFactory().getCvObjectDao(CvIdentification.class).getByXref(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().getDataContext().getDaoFactory().getCvObjectDao(CvInteraction.class).getByXref(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 ); } } }
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 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 ); } }
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 ); } } }