+
+ private URI createExternalUri(String baseUri){
+ if (StringUtils.isNotBlank(geneticAccessionNumber)){
+ return URI.create(String.format(baseUri, geneticAccessionNumber.trim()));
+ }else{
+ return null;
+ }
+ }
+
+
+ //*********************** CLONE ********************************************************/
+ /**
+ * Clones <i>this</i> sequence. This is a shortcut that enables to create
+ * a new instance that differs only slightly from <i>this</i> sequencing by
+ * modifying only some of the attributes.<BR><BR>
+ *
+ *
+ * @see eu.etaxonomy.cdm.model.media.IdentifiableEntity#clone()
+ * @see java.lang.Object#clone()
+ */
+ @Override
+ public Object clone() {
+ try{
+ Sequence result = (Sequence)super.clone();
+
+ //sequences
+ result.consensusSequence = (SequenceString)this.consensusSequence.clone();
+ result.barcodeSequencePart = (SequenceString)this.barcodeSequencePart.clone();
+
+
+ //single sequences
+ result.singleReads = new HashSet<SingleRead>();
+ for (SingleRead seq: this.singleReads){
+ result.singleReads.add((SingleRead) seq);
+ }
+
+ //citations //TODO do we really want to copy these ??
+ result.citations = new HashSet<Reference>();
+ for (Reference ref: this.citations){
+ result.citations.add((Reference) ref);
+ }
+
+
+
+ return result;
+ }catch (CloneNotSupportedException e) {
+ logger.warn("Object does not implement cloneable");
+ e.printStackTrace();
+ return null;
+ }