X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignment.java;h=cec2abcabe44a367208caa009544dc0ca7153ca9;hb=77b038f418aea84563953ad94f839592317ea500;hp=a770264d648a04ca733eb2159ae138bc04122bea;hpb=d69ea8f1997771890b44e4b332a7ca84fe6f0893;p=jalview.git diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index a770264..cec2abc 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2007 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 @@ -18,824 +18,713 @@ */ package jalview.datamodel; -import jalview.analysis.*; - -import jalview.util.*; - import java.util.*; +import jalview.analysis.*; + /** Data structure to hold and manipulate a multiple sequence alignment */ -public class Alignment implements AlignmentI +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; + 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; - /** DOCUMENT ME!! */ - public AlignmentAnnotation[] annotations; + /** DOCUMENT ME!! */ + public AlignmentAnnotation[] annotations; - HiddenSequences hiddenSequences = new HiddenSequences(this); + HiddenSequences hiddenSequences = new HiddenSequences(this); - private void initAlignment(SequenceI[] seqs) { - int i=0; + public Hashtable alignmentProperties; - if( jalview.util.Comparison.isNucleotide(seqs)) - type = NUCLEOTIDE; - else - type = PROTEIN; - - sequences = new Vector(); - - for (i = 0; i < seqs.length; i++) - { - sequences.addElement(seqs[i]); - } + private void initAlignment(SequenceI[] seqs) + { + int i = 0; - } - /** Make an alignment from an array of Sequences. - * - * @param sequences - */ - public Alignment(SequenceI[] seqs) + if (jalview.util.Comparison.isNucleotide(seqs)) { - initAlignment(seqs); - } - /** - * Make a new alignment from an array of SeqCigars - * @param seqs SeqCigar[] - */ - public Alignment(SeqCigar[] alseqs) { - SequenceI[] seqs = SeqCigar.createAlignmentSequences(alseqs, gapCharacter, new ColumnSelection(), null); - initAlignment(seqs); + type = NUCLEOTIDE; } - /** - * Make a new alignment from an CigarArray - * JBPNote - can only do this when compactAlignment does not contain hidden regions. - * JBPNote - must also check that compactAlignment resolves to a set of SeqCigars - or construct them appropriately. - * @param compactAlignment CigarArray - */ - public static AlignmentI createAlignment(CigarArray compactAlignment) { - throw new Error("Alignment(CigarArray) not yet implemented"); - // this(compactAlignment.refCigars); - } - - /** - * DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public Vector getSequences() + else { - return sequences; + type = PROTEIN; } - public SequenceI [] getSequencesArray() + sequences = new Vector(); + + for (i = 0; i < seqs.length; i++) { - SequenceI [] reply = new SequenceI[sequences.size()]; - for(int i=0; i