001/*
002 *                  BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 * Created on Jan 29, 2006
021 *
022 */
023package org.biojava.nbio.structure.align.pairwise;
024
025import org.biojava.nbio.structure.align.helper.AligMatEl;
026import org.biojava.nbio.structure.align.helper.IndexPair;
027
028
029public class StrCompAlignment
030implements Alignable
031{
032
033
034        AligMatEl[][] aligmat;
035        int rows;
036        int cols;
037        IndexPair[] path;
038        int pathSize;
039        float gapOpenCol;
040        float gapOpenRow;
041        float gapExtCol;
042        float gapExtRow;
043        float score;
044
045        public StrCompAlignment(int rows, int cols){
046                //System.out.println("new alignment " + rows + " " + cols);
047                this.rows = rows;
048                this.cols = cols;
049                aligmat = new AligMatEl[rows+1][cols+1];
050
051                /*for (int i=0;i<rows+1;i++){
052                        for(int j=0;j<cols+1;j++){
053                                aligmat[i][j] = new AligMatEl();
054                        }
055                }*/
056                path = new IndexPair[0];
057                score = 0;
058        }
059
060        @Override
061        public int getRows(){
062                return rows;
063        }
064
065        @Override
066        public int getCols() {
067                return cols;
068        }
069
070        public void setAligMat(int i, int j,AligMatEl el){
071                aligmat[i][j] = el;
072        }
073        public AligMatEl getAligMat(int i,int j){
074                return aligmat[i][j];
075        }
076
077        @Override
078        public AligMatEl[][] getAligMat(){
079                return aligmat;
080        }
081
082        @Override
083        public void setAligMat(AligMatEl[][] al){
084                //System.out.println("setting alig mat: " + al.length + " " + al[0].length);
085                rows = al.length -1;
086                cols = al[0].length -1;
087                aligmat = al;
088        }
089
090        @Override
091        public float getGapExtCol() {
092                return gapExtCol;
093        }
094
095        @Override
096        public void setGapExtCol(float gapExtCol) {
097                this.gapExtCol = gapExtCol;
098        }
099
100        @Override
101        public float getGapExtRow() {
102                return gapExtRow;
103        }
104
105        @Override
106        public void setGapExtRow(float gapExtRow) {
107                this.gapExtRow = gapExtRow;
108        }
109
110        @Override
111        public float getGapOpenCol() {
112                return gapOpenCol;
113        }
114
115        @Override
116        public void setGapOpenCol(float gapOpenCol) {
117                this.gapOpenCol = gapOpenCol;
118        }
119
120        @Override
121        public float getGapOpenRow() {
122                return gapOpenRow;
123        }
124
125        @Override
126        public void setGapOpenRow(float gapOpenRow) {
127                this.gapOpenRow = gapOpenRow;
128        }
129
130        @Override
131        public float getScore() {
132          return score;
133        }
134
135        @Override
136        public void setScore(float score) {
137                //System.out.println("StrCompAlig got score " +score);
138           this.score = score;
139        }
140
141        @Override
142        public IndexPair[] getPath() {
143                return path;
144        }
145
146        @Override
147        public void setPath(IndexPair[] path) {
148                this.path = path;
149        }
150
151        @Override
152        public int getPathSize() {
153                return pathSize;
154        }
155
156        @Override
157        public void setPathSize(int pathSize) {
158                this.pathSize = pathSize;
159        }
160
161
162
163}
164
165
166
167
168