private static XrefTag createXref( final Element xrefNode, final short type ) { XrefTag xref = null; try { String db = xrefNode.getAttribute( "db" ); if ( db != null ) { db = db.toLowerCase(); } xref = new XrefTag( type, xrefNode.getAttribute( "id" ), db, xrefNode.getAttribute( "secondary" ), xrefNode.getAttribute( "version" ) ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( xrefNode, e.getMessage() ) ); } return xref; } }
private static XrefTag createXref( final Element xrefNode, final short type ) { XrefTag xref = null; try { String db = xrefNode.getAttribute( "db" ); if ( db != null ) { db = db.toLowerCase(); } xref = new XrefTag( type, xrefNode.getAttribute( "id" ), db, xrefNode.getAttribute( "secondary" ), xrefNode.getAttribute( "version" ) ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( xrefNode, e.getMessage() ) ); } return xref; } }
private static XrefTag createXref( final Element xrefNode, final short type ) { XrefTag xref = null; try { String db = xrefNode.getAttribute( "db" ); if ( db != null ) { db = db.toLowerCase(); } xref = new XrefTag( type, xrefNode.getAttribute( "id" ), db, xrefNode.getAttribute( "secondary" ), xrefNode.getAttribute( "version" ) ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( xrefNode, e.getMessage() ) ); } return xref; } }
/** * Take <featureList> in parameter. * * @param element */ public static Collection process( final Element element ) { Collection features = new ArrayList( 2 ); final String name = element.getNodeName(); if ( false == "featureList".equals( name ) ) { MessageHolder.getInstance().addParserMessage( new Message( element, "ERROR - We should be in a " + "featureList tag." ) ); // TODO should we carry on here ? If the tag is not right ... the parsing can only fail ! } final NodeList someFeatures = element.getElementsByTagName( "feature" ); final int count = someFeatures.getLength(); for ( int i = 0; i < count; i++ ) { final Node featureNode = someFeatures.item( i ); final FeatureTag feature = FeatureParser.process( (Element) featureNode ); features.add( feature ); } // features return features; } }
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 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 ); } } }
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 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 checkCvInteractorType( ) { if ( false == interatorTypeChecked ) { // Load CvInteractorType( interaction / MI: ) cvInteractionType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvInteractorType.class, CvInteractorType.getInteractionMI()); if ( cvInteractionType == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractorType( interaction )." ) ); } interatorTypeChecked = true; } }
public static void checkCvInteractorType( ) { if ( false == interatorTypeChecked ) { // Load CvInteractorType( interaction / MI: ) cvProteinType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvInteractorType.class, CvInteractorType.getInteractionMI()); if ( cvProteinType == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractorType( interaction )." ) ); } interatorTypeChecked = true; } }
public static void checkCvInteractorType( ) { if ( false == interatorTypeChecked ) { // Load CvInteractorType( interaction / MI: ) cvProteinType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvInteractorType.class, CvInteractorType.getInteractionMI()); if ( cvProteinType == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractorType( interaction )." ) ); } interatorTypeChecked = true; } }
public static void checkCvInteractorType( ) { if ( false == interatorTypeChecked ) { // Load CvInteractorType( interaction / MI: ) cvInteractionType = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvInteractorType.class, CvInteractorType.getInteractionMI()); if ( cvInteractionType == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractorType( interaction )." ) ); } interatorTypeChecked = true; } }
public static EntryTag process( Element entry ) { loadGlobalContext( entry ); // process all interactions InteractionListParser interactionList = new InteractionListParser( globalExperiments, globalParticipants ); Collection interactions = interactionList.process( entry ); EntryTag entryTag = null; try { entryTag = new EntryTag( globalExperiments.getExperiments(), globalParticipants.getInteractors(), interactions ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( entry, e.getMessage() ) ); } return entryTag; } }
public static EntryTag process( Element entry ) { loadGlobalContext( entry ); // process all interactions InteractionListParser interactionList = new InteractionListParser( globalExperiments, globalParticipants ); Collection interactions = interactionList.process( entry ); EntryTag entryTag = null; try { entryTag = new EntryTag( globalExperiments.getExperiments(), globalParticipants.getInteractors(), interactions ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( entry, e.getMessage() ) ); } return entryTag; } }
public static EntryTag process( Element entry ) { loadGlobalContext( entry ); // process all interactions InteractionListParser interactionList = new InteractionListParser( globalExperiments, globalParticipants ); Collection interactions = interactionList.process( entry ); EntryTag entryTag = null; try { entryTag = new EntryTag( globalExperiments.getExperiments(), globalParticipants.getInteractors(), interactions ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( entry, e.getMessage() ) ); } return entryTag; } }
public static void checkCvInteractorType( ) { if ( false == interatorTypeChecked ) { // Load CvInteractorType( interaction / MI: ) cvInteractionType = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvInteractorType.class).getByXref(CvInteractorType.getInteractionMI()); if ( cvInteractionType == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractorType( interaction )." ) ); } interatorTypeChecked = true; } }
public static void checkCvInteractorType( ) { if ( false == interatorTypeChecked ) { // Load CvInteractorType( interaction / MI: ) cvProteinType = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvInteractorType.class).getByXref(CvInteractorType.getInteractionMI()); if ( cvProteinType == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvInteractorType( interaction )." ) ); } interatorTypeChecked = true; } }