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 */
021package org.biojava.nbio.ws.hmmer;
022
023import java.io.Serializable;
024
025/** Provides the details of a domain hit
026 *
027 * @author Andreas Prlic
028 * @since 3.0.3
029 */
030public class HmmerDomain implements Comparable<HmmerDomain>, Serializable{
031
032
033        /**
034         *
035         */
036        private static final long serialVersionUID = 8004302800150892757L;
037
038        Integer sqFrom;
039        Integer sqTo;
040        Integer aliLenth;
041        Integer simCount;
042        Integer hmmFrom;
043        Integer hmmTo;
044        String hmmName;
045        String hmmDesc;
046        String hmmAcc;
047        Float evalue;
048
049        public Float getEvalue() {
050                return evalue;
051        }
052        public void setEvalue(Float evalue) {
053                this.evalue = evalue;
054        }
055
056        public Integer getSqFrom() {
057                return sqFrom;
058        }
059        public void setSqFrom(Integer sqFrom) {
060                this.sqFrom = sqFrom;
061        }
062        public Integer getSqTo() {
063                return sqTo;
064        }
065        public void setSqTo(Integer sqTo) {
066                this.sqTo = sqTo;
067        }
068        public Integer getAliLenth() {
069                return aliLenth;
070        }
071        public void setAliLenth(Integer aliLenth) {
072                this.aliLenth = aliLenth;
073        }
074        public Integer getSimCount() {
075                return simCount;
076        }
077        public void setSimCount(Integer simCount) {
078                this.simCount = simCount;
079        }
080        public Integer getHmmFrom() {
081                return hmmFrom;
082        }
083        public void setHmmFrom(Integer hmmFrom) {
084                this.hmmFrom = hmmFrom;
085        }
086        public Integer getHmmTo() {
087                return hmmTo;
088        }
089        public void setHmmTo(Integer hmmTo) {
090                this.hmmTo = hmmTo;
091        }
092        public String getHmmName() {
093                return hmmName;
094        }
095        public void setHmmName(String hmmName) {
096                this.hmmName = hmmName;
097        }
098        public String getHmmDesc() {
099                return hmmDesc;
100        }
101        public void setHmmDesc(String hmmDesc) {
102                this.hmmDesc = hmmDesc;
103        }
104        public String getHmmAcc() {
105                return hmmAcc;
106        }
107        public void setHmmAcc(String hmmAcc) {
108                this.hmmAcc = hmmAcc;
109        }
110        @Override
111        public String toString() {
112                return "HmmerDomain [hmmAcc=" + hmmAcc + ", hmmDesc=" + hmmDesc
113                                + "sqFrom=" + sqFrom + ", sqTo=" + sqTo
114                                + ", aliLenth=" + aliLenth + ", simCount=" + simCount
115                                + ", hmmFrom=" + hmmFrom + ", hmmTo=" + hmmTo + ", hmmName="
116                                + hmmName  + "]" ;
117
118        }
119        @Override
120        public int compareTo(HmmerDomain o) {
121                if (emptyDomain(this) &&emptyDomain(o))
122                        return 0;
123
124                if ( ! emptyDomain(this) &&emptyDomain(o))
125                        return -1;
126                if (emptyDomain(this) && (! emptyDomain(o)))
127                        return 1;
128
129                return (this.getSqFrom().compareTo(o.getSqFrom()));
130        }
131        private boolean emptyDomain(HmmerDomain o) {
132
133                if  ( o.getSqFrom() == null)
134                        return true;
135                return false;
136        }
137
138        /*
139         *
140         * that's the full data that is currently responded from the JSON api:
141        [{"ievalue":"0.021","cevalue":"1.0e-05",
142                "alimline":"+++Wc+ ++++ +GW+ ++ +","jali":62,
143                "alicsline":0,"aliIdCount":4,"aliSimCount":17,
144                "aliM":55,"alisqto":"62","aliL":164,"alimemsize":
145                        "kenWcrvradGatGWiyqslL\u0000+++Wc+ ++++ +GW+ ++ +\u0000NGEWCEAQTKNGQGWVPSNYI\u000089**************98765\u0000000010555\u0000PF06347.7\u0000Bacterial SH3 domain\u0000seq\u0000\u0000",
146                        "alihmmacc":"PF06347.7","oasc":"0.88",
147                        "aliaseq":"NGEWCEAQTKNGQGWVPSNYI","aliN":21,
148                        "iali":42,"alihindex":"10555","is_reported":"1",
149                        "alimodel":"kenWcrvradGatGWiyqslL","alippline":"89**************98765",
150                        "aliSim":0.80952380952381,"alisqacc":"","jenv":"64",
151                        "alihmmname":"SH3_4","alihmmdesc":"Bacterial SH3 domain",
152                        "alihmmto":"53","alirfline":0,
153                        "bitscore":14.0345134735107,"bias":"0.20",
154                        "alisqfrom":"42",
155                        "alisqname":"1","aliappline":0,
156                        "alihmmfrom":"33","alimem":46912854337136,
157                        "aliId":0.19047619047619,"is_included":"0",
158                        "alisqdesc":"","ienv":"36"}] */
159
160
161
162}