/** * Generates an proteinInteractorRef out of an IntAct Protein. * * @param session * @param parent the Element to which we will add the proteinInteractorRef. * @param protein the IntAct Protein that we convert to PSI. * * @return the generated proteinInteractorRef Element. */ public Element createProteinInteracorReference( UserSessionDownload session, Element parent, Protein protein ) { // TODO test that. // 1. Checking... if ( session == null ) { throw new IllegalArgumentException( "You must give a non null UserSessionDownload." ); } if ( parent == null ) { throw new IllegalArgumentException( "You must give a non null parent to build an " + PROTEIN_INTERACTOR_REF_TAG_NAME + "." ); } if ( protein == null ) { throw new IllegalArgumentException( "You must give a non null protein to build an " + PROTEIN_INTERACTOR_REF_TAG_NAME + "." ); } // 2. Initialising the element... Element element = session.createElement( PROTEIN_INTERACTOR_REF_TAG_NAME ); element.setAttribute( "ref", getProteinId( session, protein ) ); // 3. Attaching the newly created element to the parent... parent.appendChild( element ); return element; }
element.setAttribute( "id", getProteinId( session, protein ) ); createNames( session, element, protein ); createProteinXrefs( session, element, protein ); createAttributeList( session, element, protein );
/** * Gives the right version of the Psi XML generator according to the user's session * * @param session the user session that will indicate which version of the Psi generator is required * * @return */ public static Protein2xmlI getInstance( UserSessionDownload session ) { if ( session.getPsiVersion().equals( PsiVersion.VERSION_1 ) ) { return Protein2xmlPSI1.getInstance(); } else if ( session.getPsiVersion().equals( PsiVersion.VERSION_2 ) ) { return Protein2xmlPSI2.getInstance(); } else if ( session.getPsiVersion().equals( PsiVersion.VERSION_25 ) ) { throw new IllegalStateException( "We do not support PSI version " + session.getPsiVersion() + ". Please use Interactor2xmlPSI25 instead." ); } else { throw new IllegalStateException( "We do not support PSI version " + session.getPsiVersion() ); } } }
element.setAttribute( "id", getProteinId( session, protein ) ); createNames( session, element, protein ); createProteinXrefs( session, element, protein ); createAttributeList( session, element, protein );
/** * Gives the right version of the Psi XML generator according to the user's session * * @param session the user session that will indicate which version of the Psi generator is required * * @return */ public static Protein2xmlI getInstance( UserSessionDownload session ) { if ( session.getPsiVersion().equals( PsiVersion.VERSION_1 ) ) { return Protein2xmlPSI1.getInstance(); } else if ( session.getPsiVersion().equals( PsiVersion.VERSION_2 ) ) { return Protein2xmlPSI2.getInstance(); } else if ( session.getPsiVersion().equals( PsiVersion.VERSION_25 ) ) { throw new IllegalStateException( "We do not support PSI version " + session.getPsiVersion() + ". Please use Interactor2xmlPSI25 instead." ); } else { throw new IllegalStateException( "We do not support PSI version " + session.getPsiVersion() ); } } }
element.setAttribute( "id", getProteinId( session, protein ) ); createNames( session, element, protein ); createProteinXrefs( session, element, protein ); createAttributeList( session, element, protein );
/** * Generates an proteinInteractorRef out of an IntAct Protein. * * @param session * @param parent the Element to which we will add the proteinInteractorRef. * @param protein the IntAct Protein that we convert to PSI. * * @return the generated proteinInteractorRef Element. */ public Element createProteinInteracorReference( UserSessionDownload session, Element parent, Protein protein ) { // TODO test that. // 1. Checking... if ( session == null ) { throw new IllegalArgumentException( "You must give a non null UserSessionDownload." ); } if ( parent == null ) { throw new IllegalArgumentException( "You must give a non null parent to build an " + PROTEIN_INTERACTOR_REF_TAG_NAME + "." ); } if ( protein == null ) { throw new IllegalArgumentException( "You must give a non null protein to build an " + PROTEIN_INTERACTOR_REF_TAG_NAME + "." ); } // 2. Initialising the element... Element element = session.createElement( PROTEIN_INTERACTOR_REF_TAG_NAME ); element.setAttribute( "ref", getProteinId( session, protein ) ); // 3. Attaching the newly created element to the parent... parent.appendChild( element ); return element; }
/** * Gives the right version of the Psi XML generator according to the user's session * * @param session the user session that will indicate which version of the Psi generator is required * * @return */ public static Protein2xmlI getInstance( UserSessionDownload session ) { if ( session.getPsiVersion().equals( PsiVersion.VERSION_1 ) ) { return Protein2xmlPSI1.getInstance(); } else if ( session.getPsiVersion().equals( PsiVersion.VERSION_2 ) ) { return Protein2xmlPSI2.getInstance(); } else if ( session.getPsiVersion().equals( PsiVersion.VERSION_25 ) ) { throw new IllegalStateException( "We do not support PSI version " + session.getPsiVersion() + ". Please use Interactor2xmlPSI25 instead." ); } else { throw new IllegalStateException( "We do not support PSI version " + session.getPsiVersion() ); } } }
/** * Generates an proteinParticipantRef out of an IntAct Protein. * * @param session * @param parent the Element to which we will add the proteinParticipantRef. * @param protein the IntAct Protein that we convert to PSI. * * @return the generated proteinParticipantRef Element. */ public Element createParticipantReference( UserSessionDownload session, Element parent, Protein protein ) { // TODO test that. // 1. Checking... if ( session == null ) { throw new IllegalArgumentException( "You must give a non null UserSessionDownload." ); } if ( parent == null ) { throw new IllegalArgumentException( "You must give a non null parent to build an " + PROTEIN_PARTICIPANT_REF_TAG_NAME + "." ); } if ( protein == null ) { throw new IllegalArgumentException( "You must give a non null protein to build an " + PROTEIN_PARTICIPANT_REF_TAG_NAME + "." ); } // 2. Initialising the element... Element element = session.createElement( PROTEIN_PARTICIPANT_REF_TAG_NAME ); element.setAttribute( "ref", getProteinId( session, protein ) ); // 3. Attaching the newly created element to the parent... parent.appendChild( element ); return element; }
/** * Generates an proteinParticipantRef out of an IntAct Protein. * * @param session * @param parent the Element to which we will add the proteinParticipantRef. * @param protein the IntAct Protein that we convert to PSI. * * @return the generated proteinParticipantRef Element. */ public Element createParticipantReference( UserSessionDownload session, Element parent, Protein protein ) { // TODO test that. // 1. Checking... if ( session == null ) { throw new IllegalArgumentException( "You must give a non null UserSessionDownload." ); } if ( parent == null ) { throw new IllegalArgumentException( "You must give a non null parent to build an " + PROTEIN_PARTICIPANT_REF_TAG_NAME + "." ); } if ( protein == null ) { throw new IllegalArgumentException( "You must give a non null protein to build an " + PROTEIN_PARTICIPANT_REF_TAG_NAME + "." ); } // 2. Initialising the element... Element element = session.createElement( PROTEIN_PARTICIPANT_REF_TAG_NAME ); element.setAttribute( "ref", getProteinId( session, protein ) ); // 3. Attaching the newly created element to the parent... parent.appendChild( element ); return element; }
/** * Generates an proteinParticipantRef out of an IntAct Protein. * * @param session * @param parent the Element to which we will add the proteinParticipantRef. * @param protein the IntAct Protein that we convert to PSI. * * @return the generated proteinParticipantRef Element. */ public Element createParticipantReference( UserSessionDownload session, Element parent, Protein protein ) { // TODO test that. // 1. Checking... if ( session == null ) { throw new IllegalArgumentException( "You must give a non null UserSessionDownload." ); } if ( parent == null ) { throw new IllegalArgumentException( "You must give a non null parent to build an " + PROTEIN_PARTICIPANT_REF_TAG_NAME + "." ); } if ( protein == null ) { throw new IllegalArgumentException( "You must give a non null protein to build an " + PROTEIN_PARTICIPANT_REF_TAG_NAME + "." ); } // 2. Initialising the element... Element element = session.createElement( PROTEIN_PARTICIPANT_REF_TAG_NAME ); element.setAttribute( "ref", getProteinId( session, protein ) ); // 3. Attaching the newly created element to the parent... parent.appendChild( element ); return element; }
/** * Generates an proteinInteractorRef out of an IntAct Protein. * * @param session * @param parent the Element to which we will add the proteinInteractorRef. * @param protein the IntAct Protein that we convert to PSI. * * @return the generated proteinInteractorRef Element. */ public Element createProteinInteracorReference( UserSessionDownload session, Element parent, Protein protein ) { // TODO test that. // 1. Checking... if ( session == null ) { throw new IllegalArgumentException( "You must give a non null UserSessionDownload." ); } if ( parent == null ) { throw new IllegalArgumentException( "You must give a non null parent to build an " + PROTEIN_INTERACTOR_REF_TAG_NAME + "." ); } if ( protein == null ) { throw new IllegalArgumentException( "You must give a non null protein to build an " + PROTEIN_INTERACTOR_REF_TAG_NAME + "." ); } // 2. Initialising the element... Element element = session.createElement( PROTEIN_INTERACTOR_REF_TAG_NAME ); element.setAttribute( "ref", getProteinId( session, protein ) ); // 3. Attaching the newly created element to the parent... parent.appendChild( element ); return element; }