public Object clone() throws CloneNotSupportedException { final Set<TMHMMLocation> clonedLocations = new HashSet<TMHMMLocation>(this.getLocations().size()); for (TMHMMLocation location : this.getLocations()) { clonedLocations.add((TMHMMLocation) location.clone()); } return new TMHMMMatch(this.getSignature(), clonedLocations); }
@Transactional public void persist(Set<TMHMMProtein> proteins) { //load TMHMM signatures from database and map them by accession Map<String, Signature> sigAccToDbSignatureMap = loadPersistedSignatures(); //load proteins from database and map them by protein identifier Map<String, Protein> proteinIdToProteinMap = getProteinIdToProteinMap(proteins); for (TMHMMProtein protein : proteins) { final Protein persistentProtein = proteinIdToProteinMap.get(protein.getProteinIdentifier()); if (persistentProtein == null) { throw new IllegalArgumentException("Attempting to store a TMHMM match for a protein with id " + protein.getProteinIdentifier() + ", however this does not exist in the database."); } for (TMHMMMatch match : protein.getMatches()) { final Signature signature = sigAccToDbSignatureMap.get(match.getSignature().getAccession()); TMHMMMatch newMatch = new TMHMMMatch(signature, signature.getAccession(), match.getLocations()); persistentProtein.addMatch(newMatch); entityManager.persist(newMatch); } } }
private TMHMMMatch createNewTmhmmMatch(TMHMMSignature prediction, Set<TMHMMMatch.TMHMMLocation> locations) { Signature signature = new Signature.Builder(prediction.getAccession()). description(prediction.getShortDesc()). signatureLibraryRelease(signatureLibraryRelease). build(); return new TMHMMMatch(signature, locations); } }
private TMHMMMatch createNewTmhmmMatch(TMHMMSignature prediction, Set<TMHMMMatch.TMHMMLocation> locations) { Signature signature = new Signature.Builder(prediction.getAccession()). description(prediction.getShortDesc()). signatureLibraryRelease(signatureLibraryRelease). build(); return new TMHMMMatch(signature, locations); }
private TMHMMMatch createNewTmhmmMatch(TMHMMSignature prediction, Set<TMHMMMatch.TMHMMLocation> locations) { Signature signature = new Signature.Builder(prediction.getAccession()). description(prediction.getShortDesc()). signatureLibraryRelease(signatureLibraryRelease). build(); String signatureModel = signature.getAccession(); return new TMHMMMatch(signature, signatureModel, locations); }
private TMHMMMatch createNewTmhmmMatch(TMHMMSignature prediction, Set<TMHMMMatch.TMHMMLocation> locations) { Signature signature = new Signature.Builder(prediction.getAccession()). description(prediction.getShortDesc()). signatureLibraryRelease(signatureLibraryRelease). build(); String signatureModel = signature.getAccession(); return new TMHMMMatch(signature, signatureModel, locations); } }