X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignment.java;h=5d97fe3bd3759235e7ad84571297bc079157e568;hb=b2f9a8d7bce642ff4011bc6d49e02bb0569fbb11;hp=588134ae7ca7cdd3e2f0d4c66f66e024d7e337de;hpb=8963cf56e542ec741295e8c4dfcee06ba3e140fb;p=jalview.git diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 588134a..5d97fe3 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -1,819 +1,1515 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1) + * Copyright (C) 2014 The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.datamodel; -import jalview.analysis.*; - -import jalview.util.*; - import java.util.*; -/** Data structure to hold and manipulate a multiple sequence alignment +/** + * Data structure to hold and manipulate a multiple sequence alignment + */ +/** + * @author JimP + * */ public class Alignment implements AlignmentI { - protected Alignment dataset; - protected Vector sequences; - protected Vector groups = new Vector(); - protected char gapCharacter = '-'; - protected int type = NUCLEOTIDE; - public static final int PROTEIN = 0; - public static final int NUCLEOTIDE = 1; + protected Alignment dataset; - /** DOCUMENT ME!! */ - public AlignmentAnnotation[] annotations; + protected List sequences; - HiddenSequences hiddenSequences = new HiddenSequences(this); + protected List groups = java.util.Collections + .synchronizedList(new ArrayList()); - private void initAlignment(SequenceI[] seqs) { - int i=0; + protected char gapCharacter = '-'; - if( jalview.util.Comparison.isNucleotide(seqs)) - type = NUCLEOTIDE; - else - type = PROTEIN; + protected int type = NUCLEOTIDE; - sequences = new Vector(); + public static final int PROTEIN = 0; - for (i = 0; i < seqs.length; i++) - { - sequences.addElement(seqs[i]); - } + public static final int NUCLEOTIDE = 1; + + public boolean hasRNAStructure = false; + + /** DOCUMENT ME!! */ + public AlignmentAnnotation[] annotations; + HiddenSequences hiddenSequences = new HiddenSequences(this); + + public Hashtable alignmentProperties; + + private void initAlignment(SequenceI[] seqs) + { + int i = 0; + + if (jalview.util.Comparison.isNucleotide(seqs)) + { + type = NUCLEOTIDE; } - /** Make an alignment from an array of Sequences. - * - * @param sequences - */ - public Alignment(SequenceI[] seqs) + else { - initAlignment(seqs); + type = PROTEIN; } - /** - * Make a new alignment from an array of SeqCigars - * @param seqs SeqCigar[] - */ - public Alignment(SeqCigar[] alseqs) { - SequenceI[] seqs = new SequenceI[alseqs.length]; - for (int i=0; i