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; } }
/** * 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; } }
/** * 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; } }
MessageHolder.getInstance().addParserMessage( new Message( entrySet, "ERROR - We should be in entrySet tag." ) );
MessageHolder.getInstance().addParserMessage( new Message( entrySet, "ERROR - We should be in entrySet tag." ) );
/** * 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().addParserMessage( new Message( entrySet, "ERROR - We should be in entrySet tag." ) );
/** * 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; } }
/** * 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; } }
/** * Extract Primary Xref. * <p/> * <pre> * <xref> * <primaryRef db="Swiss-Prot" id="P10912"/> * </xref> * </pre> * * @return an intact Xref or null if something goes wrong. */ public static XrefTag processPrimaryRef( final Element root ) { XrefTag xref = null; final String nodeName = root.getNodeName(); if ( false == "xref".equals( nodeName ) ) { MessageHolder.getInstance().addParserMessage( new Message( root, "ERROR - We should be in xref tag, <" + root.getNodeName() + "> instead." ) ); } final Element xrefNode = DOMUtil.getFirstElement( root, "primaryRef" ); // and the secondary ?! try { xref = createXref( xrefNode, XrefTag.PRIMARY_REF ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( root, e.getMessage() ) ); } return xref; }
/** * Extract Primary Xref. * <p/> * <pre> * <xref> * <primaryRef db="Swiss-Prot" id="P10912"/> * </xref> * </pre> * * @return an intact Xref or null if something goes wrong. */ public static XrefTag processPrimaryRef( final Element root ) { XrefTag xref = null; final String nodeName = root.getNodeName(); if ( false == "xref".equals( nodeName ) ) { MessageHolder.getInstance().addParserMessage( new Message( root, "ERROR - We should be in xref tag, <" + root.getNodeName() + "> instead." ) ); } final Element xrefNode = DOMUtil.getFirstElement( root, "primaryRef" ); // and the secondary ?! try { xref = createXref( xrefNode, XrefTag.PRIMARY_REF ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( root, e.getMessage() ) ); } return xref; }
/** * Extract Primary Xref. * <p/> * <pre> * <xref> * <primaryRef db="Swiss-Prot" id="P10912"/> * </xref> * </pre> * * @return an intact Xref or null if something goes wrong. */ public static XrefTag processPrimaryRef( final Element root ) { XrefTag xref = null; final String nodeName = root.getNodeName(); if ( false == "xref".equals( nodeName ) ) { MessageHolder.getInstance().addParserMessage( new Message( root, "ERROR - We should be in xref tag, <" + root.getNodeName() + "> instead." ) ); } final Element xrefNode = DOMUtil.getFirstElement( root, "primaryRef" ); // and the secondary ?! try { xref = createXref( xrefNode, XrefTag.PRIMARY_REF ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( root, e.getMessage() ) ); } return xref; }
MessageHolder.getInstance().addParserMessage( new Message( element, "ERROR - We should be in interactionType tag." ) ); interactionType = new InteractionTypeTag( xref ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( element, e.getMessage() ) );
MessageHolder.getInstance().addParserMessage( new Message( element, "ERROR - We should be in interactionType tag." ) ); interactionType = new InteractionTypeTag( xref ); } catch ( IllegalArgumentException e ) { MessageHolder.getInstance().addParserMessage( new Message( element, e.getMessage() ) );
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; } }