/** * Assess if a protein is a aplice variant on the basis of its shortlabel as we use the following format SPID-# and * if it has a isoform-parent cross reference. <br> Thought it doesn't mean we will find a master protein for it. * * @param protein the protein we are interrested in knowing if it is a splice variant. * * @return true if the name complies to the splice variant format. */ protected boolean isSpliceVariant(Protein protein) { // TODO check here is it has a master or not. if (protein.getShortLabel().indexOf("-") != -1) { // eg. P12345-2 if (getMasterAc(protein) != null) { return true; } } return false; }
/** * Assess if a protein is a aplice variant on the basis of its shortlabel as we use the following format SPID-# and * if it has a isoform-parent cross reference. <br> Thought it doesn't mean we will find a master protein for it. * * @param protein the protein we are interrested in knowing if it is a splice variant. * * @return true if the name complies to the splice variant format. */ protected boolean isSpliceVariant(Protein protein) { // TODO check here is it has a master or not. if (protein.getShortLabel().indexOf("-") != -1) { // eg. P12345-2 if (getMasterAc(protein) != null) { return true; } } return false; }
protected List<ProteinImpl> getProteinTranscripts( Protein protein, String cvXRefQualifier) { if ( protein == null ) { throw new NullPointerException( "The master protein must not be null." ); } if ( cvXRefQualifier == null ) { throw new NullPointerException( "The Cv Xref qualifier must not be null." ); } String ac = protein.getAc(); if ( ac == null ) { // This protein doesn't have an AC, it cannot have protein transcripts. if (log.isWarnEnabled()) log.warn("Cannot find protein transcripts for a protein without AC: "+protein.getShortLabel()); return Collections.EMPTY_LIST; } Query query = getEntityManager().createQuery("select prot from ProteinImpl prot inner join " + "prot.xrefs as xref where " + "xref.cvXrefQualifier.identifier = :transcriptParentMi " + "and xref.cvDatabase.identifier = :intactMi " + "and xref.primaryId = :masterAc"); query.setParameter("transcriptParentMi", cvXRefQualifier); query.setParameter("intactMi", CvDatabase.INTACT_MI_REF); query.setParameter("masterAc", ac); return query.getResultList(); }
protected List<ProteinImpl> getProteinTranscripts( Protein protein, String cvXRefQualifier) { if ( protein == null ) { throw new NullPointerException( "The master protein must not be null." ); } if ( cvXRefQualifier == null ) { throw new NullPointerException( "The Cv Xref qualifier must not be null." ); } String ac = protein.getAc(); if ( ac == null ) { // This protein doesn't have an AC, it cannot have protein transcripts. if (log.isWarnEnabled()) log.warn("Cannot find protein transcripts for a protein without AC: "+protein.getShortLabel()); return Collections.EMPTY_LIST; } Query query = getEntityManager().createQuery("select prot from ProteinImpl prot inner join " + "prot.xrefs as xref where " + "xref.cvXrefQualifier.identifier = :transcriptParentMi " + "and xref.cvDatabase.identifier = :intactMi " + "and xref.primaryId = :masterAc"); query.setParameter("transcriptParentMi", cvXRefQualifier); query.setParameter("intactMi", CvDatabase.INTACT_MI_REF); query.setParameter("masterAc", ac); return query.getResultList(); }
/** * Get all interaction related to the given Protein. * * @param protein the protein of which we want the interactions. * * @return a Collection if Interaction. */ protected final List<Interaction> getInteractions(final Protein protein) { Collection<Component> components = protein.getActiveInstances(); int componentsSize = components.size(); List<Interaction> interactions = new ArrayList<Interaction>(componentsSize); out.println("Found " + componentsSize + " components for protein " + protein.getShortLabel() + ". Starting to get the interactions from those components."); for (Component component : components) { Interaction interaction = component.getInteraction(); if (!interactions.contains(interaction)) { interactions.add(interaction); } } return interactions; // return IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().getInteractionsByInteractorAc(protein.getAc()); }
/** * Get all interaction related to the given Protein. * * @param protein the protein of which we want the interactions. * * @return a Collection if Interaction. */ protected final List<Interaction> getInteractions(final Protein protein) { Collection<Component> components = protein.getActiveInstances(); int componentsSize = components.size(); List<Interaction> interactions = new ArrayList<Interaction>(componentsSize); out.println("Found " + componentsSize + " components for protein " + protein.getShortLabel() + ". Starting to get the interactions from those components."); for (Component component : components) { Interaction interaction = component.getInteraction(); if (!interactions.contains(interaction)) { interactions.add(interaction); } } return interactions; // return IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().getInteractionsByInteractorAc(protein.getAc()); }
geneName = protein.getShortLabel(); System.out.println( "NOTICE: protein " + protein.getShortLabel() + " does not have a gene name, we will use it's SPTR ID: " + geneName );
geneName = protein.getShortLabel(); System.out.println( "NOTICE: protein " + protein.getShortLabel() + " does not have a gene name, we will use it's SPTR ID: " + geneName );
geneName = protein.getShortLabel(); System.out.println( "NOTICE: protein " + protein.getShortLabel() + " does not have a gene name, we will use it's SPTR ID: " + geneName );
protected ProteinImpl getProteinTranscriptsMasterProtein( Protein proteinTranscript, String cvXRefQualifier) { if ( proteinTranscript == null ) { throw new NullPointerException( "proteinTranscript must not be null." ); } if ( cvXRefQualifier == null ) { throw new NullPointerException( "The Cv Xref qualifier must not be null." ); } String masterProtAc = null; for (InteractorXref xref : proteinTranscript.getXrefs()) { if (xref.getCvXrefQualifier() != null && cvXRefQualifier.equals(xref.getCvXrefQualifier().getIdentifier())) { if (masterProtAc == null) { masterProtAc = xref.getPrimaryId(); } else { throw new IntactException("This protein transcript contains more than one "+cvXRefQualifier+" xrefs: "+proteinTranscript.getShortLabel() ); } } } // search protein by AC return getByAc(masterProtAc); }
protected ProteinImpl getProteinTranscriptsMasterProtein( Protein proteinTranscript, String cvXRefQualifier) { if ( proteinTranscript == null ) { throw new NullPointerException( "proteinTranscript must not be null." ); } if ( cvXRefQualifier == null ) { throw new NullPointerException( "The Cv Xref qualifier must not be null." ); } String masterProtAc = null; for (InteractorXref xref : proteinTranscript.getXrefs()) { if (xref.getCvXrefQualifier() != null && cvXRefQualifier.equals(xref.getCvXrefQualifier().getIdentifier())) { if (masterProtAc == null) { masterProtAc = xref.getPrimaryId(); } else { throw new IntactException("This protein transcript contains more than one "+cvXRefQualifier+" xrefs: "+proteinTranscript.getShortLabel() ); } } } // search protein by AC return getByAc(masterProtAc); }
protein.getAc() + " / " + protein.getShortLabel() + "). "); } else { CvTopic.NON_UNIPROT + "' (eg. " + protein.getAc() + " / " + protein.getShortLabel() + "). ");
protein.getAc() + " / " + protein.getShortLabel() + "). "); } else { CvTopic.NON_UNIPROT + "' (eg. " + protein.getAc() + " / " + protein.getShortLabel() + "). ");
protein.getAc() + ", " + protein.getShortLabel());
public Protein createProteinSpliceVariant(Protein masterProt, String uniprotId, String shortLabel) { Protein spliceVariant = createProtein(uniprotId, shortLabel); if (masterProt.getAc() == null) { throw new IllegalArgumentException("Cannot create an splice variant if the master protein does not have an AC: "+masterProt.getShortLabel()); } CvXrefQualifier isoformParent = createCvObject(CvXrefQualifier.class, CvXrefQualifier.ISOFORM_PARENT_MI_REF, CvXrefQualifier.ISOFORM_PARENT); CvDatabase uniprotKb = createCvObject(CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT); InteractorXref isoformXref = createXref(spliceVariant, masterProt.getAc(), isoformParent, uniprotKb); spliceVariant.addXref(isoformXref); return spliceVariant; }
public Protein createProteinChain(Protein masterProt, String uniprotId, String shortLabel) { Protein chain = createProtein(uniprotId, shortLabel); if (masterProt.getAc() == null) { throw new IllegalArgumentException("Cannot create a chain if the master protein does not have an AC: "+masterProt.getShortLabel()); } CvXrefQualifier chainParent = createCvObject(CvXrefQualifier.class, CvXrefQualifier.CHAIN_PARENT_MI_REF, CvXrefQualifier.CHAIN_PARENT); CvDatabase uniprotKb = createCvObject(CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT); InteractorXref isoformXref = createXref(chain, masterProt.getAc(), chainParent, uniprotKb); chain.addXref(isoformXref); return chain; }
public Protein createProteinSpliceVariant(Protein masterProt, String uniprotId, String shortLabel) { Protein spliceVariant = createProtein(uniprotId, shortLabel); if (masterProt.getAc() == null) { throw new IllegalArgumentException("Cannot create an splice variant if the master protein does not have an AC: "+masterProt.getShortLabel()); } CvXrefQualifier isoformParent = createCvObject(CvXrefQualifier.class, CvXrefQualifier.ISOFORM_PARENT_MI_REF, CvXrefQualifier.ISOFORM_PARENT); CvDatabase uniprotKb = createCvObject(CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT); InteractorXref isoformXref = createXref(spliceVariant, masterProt.getAc(), isoformParent, uniprotKb); spliceVariant.addXref(isoformXref); return spliceVariant; }
public Protein createProteinChain(Protein masterProt, String uniprotId, String shortLabel) { Protein chain = createProtein(uniprotId, shortLabel); if (masterProt.getAc() == null) { throw new IllegalArgumentException("Cannot create a chain if the master protein does not have an AC: "+masterProt.getShortLabel()); } CvXrefQualifier chainParent = createCvObject(CvXrefQualifier.class, CvXrefQualifier.CHAIN_PARENT_MI_REF, CvXrefQualifier.CHAIN_PARENT); CvDatabase uniprotKb = createCvObject(CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT); InteractorXref isoformXref = createXref(chain, masterProt.getAc(), chainParent, uniprotKb); chain.addXref(isoformXref); return chain; }
protein.getAc() + ", " + protein.getShortLabel());
getOut().println("\n\nChecking on Protein: " + uniprotID + "(" + protein.getAc() + ", " + protein.getShortLabel() + ") ...");