/** * Load all global Experiment and Interaction succeptible to be used by the interactions described in the PSI data. * * @param entry */ private static void loadGlobalContext( Element entry ) { // process all eventual experiment (COULD BE EMPTY) globalExperiments = new ExperimentListParser(); globalExperiments.process( entry ); // process all eventual interactors (COULD BE EMPTY) globalParticipants = new ParticipantListParser(); globalParticipants.process( entry ); }
/** * Collect all primary and secondary Xrefs. * <p/> * <pre> * <xref> * <primaryRef db="Swiss-Prot" id="P10912"/> * <p/> * <secondaryRef db="Swiss-Prot" id="P11111"/> * <secondaryRef db="Swiss-Prot" id="P22222"/> * <secondaryRef db="Swiss-Prot" id="P33333"/> * </xref> * </pre> * * @return an intact Xref collection. Empty collection if something goes wrong. */ public static Collection process( final Element root ) { Collection xrefs; xrefs = processSecondaryRef( root ); XrefTag xref = processPrimaryRef( root ); if ( xref != null ) { xrefs.add( xref ); } return xrefs; }
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; } }
/** * @param entry */ public Collection process( final Element entry ) { final Element interactionList = DOMUtil.getFirstElement( entry, "interactionList" ); final NodeList someInteractions = interactionList.getElementsByTagName( "interaction" ); final int count = someInteractions.getLength(); final Collection interactions = new ArrayList( count ); for ( int i = 0; i < count; i++ ) { final Element interactionNode = (Element) someInteractions.item( i ); final InteractionParser interaction = new InteractionParser( experimentList, participantList, interactionNode ); InteractionTag interactionTag = interaction.process(); if ( interactionTag != null ) { interactions.add( interactionTag ); } } // interactions return interactions; } }
/** * Process a <interactorList> * * @param entry a <interactorList> Element */ public void process( final Element entry ) { final Element proteinsList = DOMUtil.getFirstElement( entry, "interactorList" ); if ( proteinsList != null ) { final NodeList someProteins = proteinsList.getElementsByTagName( "proteinInteractor" ); for ( int i = 0; i < someProteins.getLength(); i++ ) { final Node interactor = someProteins.item( i ); final ProteinInteractorParser proteinInteractor = new ProteinInteractorParser( this, (Element) interactor ); final LabelValueBean lvb = proteinInteractor.process(); if ( lvb != null ) { interactors.put( lvb.getLabel(), lvb.getValue() ); } } // interactors } } }
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; } }
/** * Load all global Experiment and Interaction succeptible to be used by the interactions described in the PSI data. * * @param entry */ private static void loadGlobalContext( Element entry ) { // process all eventual experiment (COULD BE EMPTY) globalExperiments = new ExperimentListParser(); globalExperiments.process( entry ); // process all eventual interactors (COULD BE EMPTY) globalParticipants = new ParticipantListParser(); globalParticipants.process( entry ); }
/** * Collect all primary and secondary Xrefs. * <p/> * <pre> * <xref> * <primaryRef db="Swiss-Prot" id="P10912"/> * <p/> * <secondaryRef db="Swiss-Prot" id="P11111"/> * <secondaryRef db="Swiss-Prot" id="P22222"/> * <secondaryRef db="Swiss-Prot" id="P33333"/> * </xref> * </pre> * * @return an intact Xref collection. Empty collection if something goes wrong. */ public static Collection process( final Element root ) { Collection xrefs; xrefs = processSecondaryRef( root ); XrefTag xref = processPrimaryRef( root ); if ( xref != null ) { xrefs.add( xref ); } return xrefs; }
/** * @param entry */ public Collection process( final Element entry ) { final Element interactionList = DOMUtil.getFirstElement( entry, "interactionList" ); final NodeList someInteractions = interactionList.getElementsByTagName( "interaction" ); final int count = someInteractions.getLength(); final Collection interactions = new ArrayList( count ); for ( int i = 0; i < count; i++ ) { final Element interactionNode = (Element) someInteractions.item( i ); final InteractionParser interaction = new InteractionParser( experimentList, participantList, interactionNode ); InteractionTag interactionTag = interaction.process(); if ( interactionTag != null ) { interactions.add( interactionTag ); } } // interactions return interactions; } }
/** * Process a <interactorList> * * @param entry a <interactorList> Element */ public void process( final Element entry ) { final Element proteinsList = DOMUtil.getFirstElement( entry, "interactorList" ); if ( proteinsList != null ) { final NodeList someProteins = proteinsList.getElementsByTagName( "proteinInteractor" ); for ( int i = 0; i < someProteins.getLength(); i++ ) { final Node interactor = someProteins.item( i ); final ProteinInteractorParser proteinInteractor = new ProteinInteractorParser( this, (Element) interactor ); final LabelValueBean lvb = proteinInteractor.process(); if ( lvb != null ) { interactors.put( lvb.getLabel(), lvb.getValue() ); } } // interactors } } }
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; } }
/** * Load all global Experiment and Interaction succeptible to be used by the interactions described in the PSI data. * * @param entry */ private static void loadGlobalContext( Element entry ) { // process all eventual experiment (COULD BE EMPTY) globalExperiments = new ExperimentListParser(); globalExperiments.process( entry ); // process all eventual interactors (COULD BE EMPTY) globalParticipants = new ParticipantListParser(); globalParticipants.process( entry ); }
/** * Collect all primary and secondary Xrefs. * <p/> * <pre> * <xref> * <primaryRef db="Swiss-Prot" id="P10912"/> * <p/> * <secondaryRef db="Swiss-Prot" id="P11111"/> * <secondaryRef db="Swiss-Prot" id="P22222"/> * <secondaryRef db="Swiss-Prot" id="P33333"/> * </xref> * </pre> * * @return an intact Xref collection. Empty collection if something goes wrong. */ public static Collection process( final Element root ) { Collection xrefs; xrefs = processSecondaryRef( root ); XrefTag xref = processPrimaryRef( root ); if ( xref != null ) { xrefs.add( xref ); } return xrefs; }
/** * @param entry */ public Collection process( final Element entry ) { final Element interactionList = DOMUtil.getFirstElement( entry, "interactionList" ); final NodeList someInteractions = interactionList.getElementsByTagName( "interaction" ); final int count = someInteractions.getLength(); final Collection interactions = new ArrayList( count ); for ( int i = 0; i < count; i++ ) { final Element interactionNode = (Element) someInteractions.item( i ); final InteractionParser interaction = new InteractionParser( experimentList, participantList, interactionNode ); InteractionTag interactionTag = interaction.process(); if ( interactionTag != null ) { interactions.add( interactionTag ); } } // interactions return interactions; } }