public UniprotFeatureChain retrieveUniprotFeatureChain( UniprotProtein uniProtEntry, String ac) { if (uniProtEntry != null && ac != null){ for (UniprotFeatureChain fc : uniProtEntry.getFeatureChains()){ String acFixed = ac; // if not of type primaryAc-PRO_xxxxx, it is not a feature chain. we have to build the feature chain ac if (ac.indexOf("-") == -1){ acFixed = uniProtEntry.getPrimaryAc() + "-" + ac; } if (acFixed.equals(fc.getPrimaryAc())){ return fc; } } } return null; } }
/** * Extract the ensembl gene accession from this uniprotProtein * @param protein : the protein * @return the ensembl gene accession (if any) of this protein, null otherwise */ public static String extractENSEMBLGeneAccessionFrom(UniprotProtein protein){ if (protein != null){ String ensemblGene = extractENSEMBLGeneAccessionFrom(protein.getCrossReferences()); return ensemblGene; } return null; }
protected void processSpliceVariants( UniProtEntry uniProtEntry, UniprotProtein protein ) { Map<String,String> seqMap = new HashMap<String,String>(); List<UniprotSpliceVariant> spliceVariants = findSpliceVariants(uniProtEntry, protein.getOrganism(), seqMap); // add the splice variant to the original protein protein.getSpliceVariants().addAll( spliceVariants ); }
protected void processGeneNames( UniProtEntry uniProtEntry, UniprotProtein protein ) { List<Gene> genes = uniProtEntry.getGenes(); for ( Gene gene : genes ) { if (gene.hasGeneName() ) { protein.getGenes().add( gene.getGeneName().getValue() ); } for ( GeneNameSynonym synonym : gene.getGeneNameSynonyms() ) { protein.getSynomyms().add( synonym.getValue() ); } for ( ORFName orf : gene.getORFNames() ) { protein.getOrfs().add( orf.getValue() ); } for ( OrderedLocusName locus : gene.getOrderedLocusNames() ) { protein.getLocuses().add( locus.getValue() ); } } }
String sequence = tremblEntry.getSequence(); String ensemblGene = extractENSEMBLGeneAccessionFrom(tremblEntry.getCrossReferences()); blastContext.setEnsemblGene(ensemblGene); r.setTremblAccession(tremblEntry.getPrimaryAc());
UniprotProtein uniprotProtein = new UniprotProtein( uniProtEntry.getUniProtId().getValue(), uniProtEntry.getPrimaryUniProtAccession().getValue(), o, uniprotProtein.getSecondaryAcs().add( secondaryAc.getValue() ); uniprotProtein.setReleaseVersion( getSPTREntryReleaseVersion( uniProtEntry ) ); uniprotProtein.setLastAnnotationUpdate( uniProtEntry.getEntryAudit().getLastAnnotationUpdateDate() ); uniprotProtein.setLastSequenceUpdate( uniProtEntry.getEntryAudit().getLastSequenceUpdateDate() ); uniprotProtein.setSource( UniprotProteinType.SWISSPROT ); } else if ( UniProtEntryType.TREMBL.equals( uniProtEntry.getType() ) ) { uniprotProtein.setSource( UniprotProteinType.TREMBL ); } else if ( UniProtEntryType.UNKNOWN.equals( uniProtEntry.getType() ) ) { uniprotProtein.setSource( UniprotProteinType.UNKNOWN ); } else { throw new IllegalStateException( "Only SWISSPROT, TREMBL and UNKNOWN source are supported: " + uniprotProtein.getSynomyms().add(fullField.getValue()); uniprotProtein.getFunctions().add( function.getValue() ); uniprotProtein.getFunctions().add( disease.getDisease().getDescription().getValue() ); uniprotProtein.getKeywords().add( keyword.getValue() ); uniprotProtein.setSequence( uniProtEntry.getSequence().getValue() ); uniprotProtein.setSequenceLength( uniProtEntry.getSequence().getLength() ); uniprotProtein.setCrc64( uniProtEntry.getSequence().getCRC64() );
final String sequence = protein.getSequence(); if( sequence.length() < end ) { throw new IllegalArgumentException( "The AA sequence (length:"+ sequence.length() +") of parent " + UniprotFeatureChain chain = new UniprotFeatureChain( id, protein.getOrganism(), chainSequence ); chain.setDescription( description ); chain.setStart( begin ); protein.getFeatureChains().add( chain );
@Override public ProteinUpdateError createMatchSeveralUniprotEntriesError(String proteinAc, String uniprotAc, String taxId, UpdateError errorLabel, Collection<UniprotProtein> identitiesSameOrganism, Collection<UniprotProtein> identitiesDifferentOrganism) { MatchSeveralUniprotEntries error = new MatchSeveralUniprotEntries(null, proteinAc, uniprotAc, taxId, errorLabel); for (UniprotProtein p : identitiesSameOrganism){ error.getUniprotIdentities().add(p.getPrimaryAc()); } for (UniprotProtein p : identitiesDifferentOrganism){ error.getUniprotFromDifferentOrganisms().add(p.getPrimaryAc()); } return error; }
UniprotProtein prot = proteins.iterator().next(); if (prot.getOrganism() != null){ String tax = Integer.toString(prot.getOrganism().getTaxid()); if (taxId.equalsIgnoreCase(tax)){ return true;
String sequence = tremblEntry.getSequence(); String ensemblGene = extractENSEMBLGeneAccessionFrom(tremblEntry.getCrossReferences()); blastContext.setEnsemblGene(ensemblGene); r.setTremblAccession(tremblEntry.getPrimaryAc());
final String sequence = protein.getSequence(); if( sequence.length() < end ) { throw new IllegalArgumentException( "The AA sequence (length:"+ sequence.length() +") of parent " + UniprotFeatureChain chain = new UniprotFeatureChain( id, protein.getOrganism(), chainSequence ); chain.setDescription( description ); chain.setStart( begin ); protein.getFeatureChains().add( chain );
String uniprotId = evt.getProtein() != null ? evt.getProtein().getPrimaryAc() : null;
String sequence = tremblEntry.getSequence(); String ensemblGene = extractENSEMBLGeneAccessionFrom(tremblEntry.getCrossReferences()); blastContext.setEnsemblGene(ensemblGene); r.setTremblAccession(tremblEntry.getPrimaryAc());
final String sequence = protein.getSequence(); if( sequence.length() < end ) { throw new IllegalArgumentException( "The AA sequence (length:"+ sequence.length() +") of parent " + UniprotFeatureChain chain = new UniprotFeatureChain( id, protein.getOrganism(), chainSequence ); chain.setDescription( description ); chain.setStart( begin ); protein.getFeatureChains().add( chain );
@Override @Transactional( "update" ) public void onSecondaryAcsFound(UpdateCaseEvent evt) throws ProcessorException { // reattach the updateProcess to the entity manager ProteinUpdateProcess updateProcess = IntactUpdateContext.getCurrentInstance().getUpdateFactory().getEntityManager().merge(this.updateProcess); Collection<Protein> secondaryProteins = evt.getSecondaryProteins(); Collection<ProteinTranscript> secondaryIsoforms = evt.getSecondaryIsoforms(); Collection<XrefUpdaterReport> secondaryXrefReports = evt.getXrefUpdaterReports(); for (Protein prot : secondaryProteins){ InteractorXref oldPrimary = ProteinUtils.getUniprotXref(prot); String oldAc = oldPrimary != null ? oldPrimary.getPrimaryId() : null; SecondaryProteinEvent protEvt = new SecondaryProteinEvent(updateProcess, prot, oldAc, evt.getProtein().getPrimaryAc()); IntactUpdateContext.getCurrentInstance().getUpdateFactory().getSecondaryProteinEventDao().persist(protEvt); } for (ProteinTranscript protTrans : secondaryIsoforms){ Protein prot = protTrans.getProtein(); InteractorXref oldPrimary = ProteinUtils.getUniprotXref(prot); String oldAc = oldPrimary != null ? oldPrimary.getPrimaryId() : null; SecondaryProteinEvent protEvt = new SecondaryProteinEvent(updateProcess, prot, oldAc, protTrans.getUniprotVariant().getPrimaryAc()); IntactUpdateContext.getCurrentInstance().getUpdateFactory().getSecondaryProteinEventDao().persist(protEvt); } }
/** * Get the uniprot cross references of the uniprot entry matching this accession and extract the ensembl gene accession if any * @param uniprotAccession : the uniprot accession * @return the ensembl gene accession (if any) of this protein, null otherwise * @throws StrategyException */ public static String extractENSEMBLGeneAccessionFrom(String uniprotAccession) throws StrategyException{ UniprotProtein entry = getUniprotProteinFor(uniprotAccession); if (entry != null){ String ensemblGene = extractENSEMBLGeneAccessionFrom(entry.getCrossReferences()); return ensemblGene; } else { throw new StrategyException("We couldn't find an Uniprot entry which matches this accession number " + uniprotAccession); } }
String sequence = tremblEntry.getSequence(); String ensemblGene = extractENSEMBLGeneAccessionFrom(tremblEntry.getCrossReferences()); blastContext.setEnsemblGene(ensemblGene); r.setTremblAccession(tremblEntry.getPrimaryAc());
protein.getCrossReferences().add( new UniprotXref( ac, db, desc ) ); protein.getCrossReferences().add( new UniprotXref( geneName, "HUGE" ) ); String syn = synonym.getValue(); if ( syn.startsWith( "KIAA" ) ) { protein.getCrossReferences().add( new UniprotXref( syn, "HUGE" ) );