public void map(Protein p) throws BridgeFailedException { String newID = null; if(p.getSequence() != null) { newID = localRemap.get(p.getSequence()); if(newID != null){ p.setUniprotkb(newID); if( listener != null ) listener.onSuccessfulMapping(p, Collections.<String>emptyList()); } return; } if(! p.getXrefs().isEmpty()) { newID = localRemap.get(p.getXrefs().iterator().next().getId()); if(newID != null){ p.setUniprotkb(newID); if( listener != null ) listener.onSuccessfulMapping(p, Collections.<String>emptyList()); } return; } if( listener != null ) listener.onFailedMapping(p, Collections.<String>emptyList()); }
private void generateChecksums(Protein p) throws BridgeFailedException { // CHECKSUMS if(p.getSequence() != null){ //TODO add an MI term if one is created p.getChecksums().add(ChecksumUtils.createChecksum("crc64", Crc64Generator.computeCrc64For(p.getSequence()))); if(p.getOrganism() != null){ try { String rogidValue = rogidGenerator.computeRogidFrom( p.getSequence(), Integer.toString(p.getOrganism().getTaxId())); p.setRogid(rogidValue); } catch (SeguidException e) { throw new BridgeFailedException( "Error was encountered whilst generating RogID in protein fetcher.",e); } } } }
if (interactor.getSequence() != null){ MiContext context = RuleUtils.buildContext(interactor, "interactor"); messages=Collections.singletonList(new ValidatorMessage("Proteins should have a Xref to UniProtKB or RefSeq with a ref type 'identity' ",
throws BridgeFailedException { report.push("Priority to sequence."); IdentificationResults sequenceMapping = identifyProtein(proteinToMap.getSequence(), context); if (sequenceMapping == null || ! sequenceMapping.hasUniqueUniprotId()){ report.push("Sequence mapping FAILED: No mapping found for sequence.");
IdentificationResults sequenceMapping = identifyProtein(proteinToMap.getSequence(), context); if (sequenceMapping == null || ! sequenceMapping.hasUniqueUniprotId()){ report.push("Sequence mapping FAILED: No mapping found for sequence.");
IdentificationResults sequenceMapping = identifyProtein(proteinToMap.getSequence(), context); if (sequenceMapping == null || ! sequenceMapping.hasUniqueUniprotId()){ report.push("Sequence mapping FAILED: No mapping found for sequence.");