From: Mateusz Warowny Date: Tue, 5 Apr 2022 12:18:13 +0000 (+0200) Subject: JAL-3878 Add char[] constructor to Sequence X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ceba202c97c435a5a0f70307961ba74316bd8312;p=jalview.git JAL-3878 Add char[] constructor to Sequence --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 009a290..bb9c0f5 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -259,6 +259,21 @@ public class Sequence extends ASequence implements SequenceI } /** + * Create a new sequence object from a characters array using default values + * of 1 and -1 for start and end. The array used to create the sequence is + * copied and is not stored internally. + * + * @param name + * sequence name + * @param sequence + * list of residues + */ + public Sequence(String name, char[] sequence) + { + this(name, Arrays.copyOf(sequence, sequence.length), 1, -1); + } + + /** * Creates a new Sequence object with new AlignmentAnnotations but inherits * any existing dataset sequence reference. If non exists, everything is * copied.