public Collection<GeneralMessage> check(Protein protein) throws SanityRuleException { Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>(); String sequence = protein.getSequence(); if (sequence != null) { String calculatedCrc64 = Crc64.getCrc64(sequence); String storedCrc64 = protein.getCrc64(); if(!calculatedCrc64.equals(storedCrc64)){ messages.add(new GeneralMessage(MessageDefinition.PROTEIN_INCORRECT_CRC64, protein)); } } return messages; } }
public Protein createProtein(String uniprotId, String shortLabel, BioSource bioSource) { CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.PROTEIN_MI_REF, CvInteractorType.PROTEIN); Protein protein = new ProteinImpl(getInstitution(), bioSource, shortLabel, intType); InteractorXref idXref = createIdentityXrefUniprot(protein, uniprotId); protein.addXref(idXref); InteractorAlias alias = createAliasGeneName(protein, shortLabel.toUpperCase()); protein.addAlias(alias); String sequence = randomPeptideSequence(); String crc64 = Crc64.getCrc64(sequence); protein.setSequence(sequence); protein.setCrc64(crc64); return protein; }
private Protein createProtein(String uniprotId, String shortLabel, String geneName, BioSource bioSource, CvInteractorType intType) { Protein protein = new ProteinImpl(getInstitution(), bioSource, shortLabel, intType); InteractorXref idXref = createIdentityXrefUniprot(protein, uniprotId); protein.addXref(idXref); InteractorAlias alias = createAliasGeneName(protein, geneName); protein.addAlias(alias); String sequence = randomPeptideSequence(); String crc64 = Crc64.getCrc64(sequence); protein.setSequence(sequence); protein.setCrc64(crc64); return protein; }
private Protein createProtein(String uniprotId, String shortLabel, String geneName, BioSource bioSource, CvInteractorType intType) { Protein protein = new ProteinImpl(getInstitution(), bioSource, shortLabel, intType); InteractorXref idXref = createIdentityXrefUniprot(protein, uniprotId); protein.addXref(idXref); InteractorAlias alias = createAliasGeneName(protein, geneName); protein.addAlias(alias); String sequence = randomPeptideSequence(); String crc64 = Crc64.getCrc64(sequence); protein.setSequence(sequence); protein.setCrc64(crc64); return protein; }
protein.setCrc64( Crc64.getCrc64( proteinInteractor.getSequence() ) );
tremblEntry = SearchReplace.replace( tremblEntry, PROTEIN_CREATION_DATE, time.toUpperCase() ); tremblEntry = SearchReplace.replace( tremblEntry, PROTEIN_CRC64, Crc64.getCrc64( protein.getSequence() ) ); String formatedSequence = formatSequence( protein.getSequence() ); tremblEntry = SearchReplace.replace( tremblEntry, PROTEIN_SEQUENCE, formatedSequence );
protein.setCrc64( Crc64.getCrc64( proteinInteractor.getSequence() ) );
protein.setCrc64( Crc64.getCrc64( proteinInteractor.getSequence() ) );
Polymer polymer = ( Polymer ) interactor; polymer.setSequence( sequence ); polymer.setCrc64( Crc64.getCrc64( sequence ) );