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 ); } } }
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; } }
public void clearAllMessages() { clearParserMessage(); clearCheckerMessage(); }
final MessageHolder messages = MessageHolder.getInstance(); entrySet = entrySetParser.process( rootElement ); } catch ( RuntimeException re ) { if ( messages.parserMessageExists() ) { System.err.println( "Before to exit, here are the messages creating during the parsing:" ); messages.printParserReport( System.err ); System.err.println( "\nPlease fix your file and try again." ); System.err.println( "abort." ); if ( messages.parserMessageExists() ) { messages.printParserReport( System.err ); System.err.println( "\nPlease fix your file and try again." ); System.err.println( "abort." ); if ( messages.checkerMessageExists() ) { MessageHolder.getInstance().printCheckerReport( System.err ); System.err.println( "abort." ); System.exit( 1 ); if ( messages.checkerMessageExists() ) { MessageHolder.getInstance().printPersisterReport( System.err ); System.err.println( "abort." ); System.exit( 1 );
final MessageHolder messages = MessageHolder.getInstance(); entrySet = entrySetParser.process( rootElement ); } catch ( RuntimeException re ) { if ( messages.parserMessageExists() ) { System.err.println( "Before to exit, here are the messages creating during the parsing:" ); messages.printParserReport( System.err ); System.err.println( "\nPlease fix your file and try again." ); System.err.println( "abort." ); if ( messages.parserMessageExists() ) { messages.printParserReport( System.err ); System.err.println( "\nPlease fix your file and try again." ); System.err.println( "abort." ); if ( messages.checkerMessageExists() ) { MessageHolder.getInstance().printCheckerReport( System.err ); System.err.println( "abort." ); System.exit( 1 ); if ( messages.checkerMessageExists() ) { MessageHolder.getInstance().printPersisterReport( System.err ); System.err.println( "abort." ); System.exit( 1 );
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 ); } } }
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; } }
final MessageHolder messages = MessageHolder.getInstance(); entrySet = entrySetParser.process( rootElement ); } catch ( RuntimeException re ) { if ( messages.parserMessageExists() ) { System.err.println( "Before to exit, here are the messages creating during the parsing:" ); messages.printParserReport( System.err ); System.err.println( "\nPlease fix your file and try again." ); System.err.println( "abort." ); if ( messages.parserMessageExists() ) { messages.printParserReport( System.err ); System.err.println( "\nPlease fix your file and try again." ); System.err.println( "abort." ); if ( messages.checkerMessageExists() ) { MessageHolder.getInstance().printCheckerReport( System.err ); System.err.println( "abort." ); System.exit( 1 ); if ( messages.checkerMessageExists() ) { MessageHolder.getInstance().printPersisterReport( System.err ); System.err.println( "abort." ); System.exit( 1 );
public void clearAllMessages() { clearParserMessage(); clearCheckerMessage(); }
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; } }
/** * Process a <cellType> in an organism. <br> In order to map it to the IntAct data, we look for the psi-mi * <code>primaryRef</code>, and look-up in intact using its <code>id</code>. * * @param element <cellType>. * * @return a <code>CellTypeTag</code> if the XML contains a walid psi-mi descriptor. * * @see uk.ac.ebi.intact.application.dataConversion.psiUpload.model.CellTypeTag */ public static ConfidenceTag process( final Element element ) { if ( false == "confidence".equals( element.getNodeName() ) ) { MessageHolder.getInstance().addParserMessage( new Message( element, "ERROR - We should be in confidence tag." ) ); } String unit = element.getAttribute( "unit" ); String value = element.getAttribute( "value" ); ConfidenceTag confidenceTag = null; try { confidenceTag = new ConfidenceTag( unit, value ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( element, e.getMessage() ) ); } return confidenceTag; } }
public void clearAllMessages() { clearParserMessage(); clearCheckerMessage(); }
MessageHolder.getInstance().addCheckerMessage( new Message( "Found more than one BioSource (expressedIn) " + "having the shortlabel: " + shortlabel ) ); } else if ( bioSources.size() == 0 ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Found no BioSource (expressedIn) " + "having the shortlabel: " + shortlabel ) ); MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " + "for BioSource (expressedIn)" + "having the shortlabel: " + shortlabel ) );
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; } }
MessageHolder.getInstance().addCheckerMessage( new Message( "Found more than one BioSource (expressedIn) " + "having the shortlabel: " + shortlabel ) ); } else if ( bioSources.size() == 0 ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Found no BioSource (expressedIn) " + "having the shortlabel: " + shortlabel ) ); MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " + "for BioSource (expressedIn)" + "having the shortlabel: " + shortlabel ) );
/** * Process a <cellType> in an organism. <br> In order to map it to the IntAct data, we look for the psi-mi * <code>primaryRef</code>, and look-up in intact using its <code>id</code>. * * @param element <cellType>. * * @return a <code>CellTypeTag</code> if the XML contains a walid psi-mi descriptor. * * @see uk.ac.ebi.intact.application.dataConversion.psiUpload.model.CellTypeTag */ public static ConfidenceTag process( final Element element ) { if ( false == "confidence".equals( element.getNodeName() ) ) { MessageHolder.getInstance().addParserMessage( new Message( element, "ERROR - We should be in confidence tag." ) ); } String unit = element.getAttribute( "unit" ); String value = element.getAttribute( "value" ); ConfidenceTag confidenceTag = null; try { confidenceTag = new ConfidenceTag( unit, value ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( element, e.getMessage() ) ); } return confidenceTag; } }
MessageHolder.getInstance().addCheckerMessage( new Message( "Found more than one BioSource (expressedIn) " + "having the shortlabel: " + shortlabel ) ); } else if ( bioSources.size() == 0 ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Found no BioSource (expressedIn) " + "having the shortlabel: " + shortlabel ) ); MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching " + "for BioSource (expressedIn)" + "having the shortlabel: " + shortlabel ) );
/** * Process a <cellType> in an organism. <br> In order to map it to the IntAct data, we look for the psi-mi * <code>primaryRef</code>, and look-up in intact using its <code>id</code>. * * @param element <cellType>. * * @return a <code>CellTypeTag</code> if the XML contains a walid psi-mi descriptor. * * @see uk.ac.ebi.intact.application.dataConversion.psiUpload.model.CellTypeTag */ public static ConfidenceTag process( final Element element ) { if ( false == "confidence".equals( element.getNodeName() ) ) { MessageHolder.getInstance().addParserMessage( new Message( element, "ERROR - We should be in confidence tag." ) ); } String unit = element.getAttribute( "unit" ); String value = element.getAttribute( "value" ); ConfidenceTag confidenceTag = null; try { confidenceTag = new ConfidenceTag( unit, value ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( element, e.getMessage() ) ); } return confidenceTag; } }
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; } }
/** * 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; } }