in progress...
[jalview.git] / forester / java / src / org / forester / sequence / MolecularSequence.java
1 // $Id:
2 //
3 // forester -- software libraries and applications
4 // for genomics and evolutionary biology research.
5 //
6 // Copyright (C) 2010 Christian M Zmasek
7 // Copyright (C) 2010 Sanford-Burnham Medical Research Institute
8 // All rights reserved
9 //
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.
14 //
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.
19 //
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
23 //
24 // Contact: phylosoft @ gmail . com
25 // WWW: https://sites.google.com/site/cmzmasek/home/software/forester
26
27 package org.forester.sequence;
28
29 public interface MolecularSequence {
30
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       = "[^ARNDBCQEZGHILKMFPSTWYVXUO\\-\\*]";
37     static final String        DNA_REGEXP      = "[^ACGTRYMKWSN\\-\\*]";
38     static final String        RNA_REGEXP      = "[^ACGURYMKWSN\\-\\*]";
39
40     public abstract String getIdentifier();
41
42     public abstract int getLength();
43
44     public abstract int getNumberOfGapResidues();
45
46     public abstract char[] getMolecularSequence();
47
48     public abstract String getMolecularSequenceAsString();
49
50     public abstract char getResidueAt( final int position );
51
52     public abstract boolean isGapAt( final int position );
53
54     public abstract TYPE getType();
55
56     public enum TYPE {
57         RNA, DNA, AA, GENERAL;
58     }
59 }