3 // forester -- software libraries and applications
4 // for genomics and evolutionary biology research.
6 // Copyright (C) 2010 Christian M Zmasek
7 // Copyright (C) 2010 Sanford-Burnham Medical Research Institute
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 // Contact: phylosoft @ gmail . com
25 // WWW: https://sites.google.com/site/cmzmasek/home/software/forester
27 package org.forester.sequence;
29 public interface Sequence {
31 public static final char UNSPECIFIED_AA = 'X';
32 public static final char UNSPECIFIED_NUC = 'N';
33 public static final char GAP = '-';
34 public static final String GAP_STR = Character.toString( GAP );
35 public static final char TERMINATE = '*';
36 static final String AA_REGEXP = "[^ARNDBCQEZGHILKMFPSTWYVXU\\-\\*]";
37 static final String DNA_REGEXP = "[^ACGTRYMKWSN\\-\\*]";
38 static final String RNA_REGEXP = "[^ACGURYMKWSN\\-\\*]";
40 public abstract String getIdentifier();
42 public abstract int getLength();
44 public abstract int getNumberOfGapResidues();
46 public abstract char[] getMolecularSequence();
48 public abstract String getMolecularSequenceAsString();
50 public abstract char getResidueAt( final int position );
52 public abstract TYPE getType();