From: jprocter Date: Wed, 2 May 2007 12:21:26 +0000 (+0000) Subject: subsequence bound checks and constructor for selectively duplicating sequence associa... X-Git-Tag: Release_2_3~83 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=cd3f71819a7f5277e4f34f1c062c9c9db45a58af;p=jalview.git subsequence bound checks and constructor for selectively duplicating sequence associated alignment annotation in copy constructor --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 673177c..d64e133 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -136,10 +136,21 @@ public class Sequence */ public Sequence(SequenceI seq) { + this(seq, seq.getAnnotation()); + } + /** + * Create a new sequence object with new features, DBRefEntries, and PDBIds + * but inherits any existing dataset sequence reference, and duplicate of + * any annotation that is present in the given annotation array. + * @param seq the sequence to be copied + * @param alAnnotation an array of annotation including some associated with seq + */ + public Sequence(SequenceI seq, AlignmentAnnotation[] alAnnotation) + { this(seq.getName(), - seq.getSequence(), - seq.getStart(), - seq.getEnd()); + seq.getSequence(), + seq.getStart(), + seq.getEnd()); description = seq.getDescription(); if (seq.getSequenceFeatures()!=null) { SequenceFeature[] sf = seq.getSequenceFeatures(); @@ -154,10 +165,18 @@ public class Sequence } } setDatasetSequence(seq.getDatasetSequence()); - if (seq.getAnnotation()!=null) { + if (seq.getAnnotation()!=null && alAnnotation!=null) { AlignmentAnnotation[] sqann = seq.getAnnotation(); for (int i=0;i= sequence.length) {