From ceba202c97c435a5a0f70307961ba74316bd8312 Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Tue, 5 Apr 2022 14:18:13 +0200 Subject: [PATCH] JAL-3878 Add char[] constructor to Sequence --- src/jalview/datamodel/Sequence.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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. -- 1.7.10.2