(no commit message)
[jalview.git] / forester / java / src / org / forester / surfacing / DomainSimilarity.java
1 // $Id:
2 //
3 // FORESTER -- software libraries and applications
4 // for evolutionary biology research and applications.
5 //
6 // Copyright (C) 2008-2009 Christian M. Zmasek
7 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
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: www.phylosoft.org/forester
26
27 package org.forester.surfacing;
28
29 import java.util.SortedMap;
30 import java.util.SortedSet;
31
32 /*
33  * This is to represent a measure of similarity between two or more domains from
34  * different genomes.
35  */
36 public interface DomainSimilarity extends Comparable<DomainSimilarity> {
37
38     public SortedSet<DomainId> getCombinableDomainIds( final Species species_of_combinable_domain );;
39
40     public DomainId getDomainId();
41
42     /**
43      * For pairwise similarities, this should return the "difference"; for example the difference in counts
44      * for copy number based features (the same as getMaximalDifferenceInCounts(), or the number
45      * of actually different domain combinations. 
46      * For pairwise similarities, this should return the difference,
47      * while for comparisons of more than two domains, this should return the maximal difference
48      * 
49      * 
50      * 
51      * @return
52      */
53     public int getMaximalDifference();
54
55     /**
56      * For pairwise similarities, this should return the difference in counts,
57      * while for comparisons of more than two domains, this should return the maximal difference
58      * in counts
59      * 
60      * 
61      * @return the (maximal) difference in counts
62      */
63     public int getMaximalDifferenceInCounts();
64
65     public double getMaximalSimilarityScore();
66
67     public double getMeanSimilarityScore();
68
69     public double getMinimalSimilarityScore();
70
71     /**
72      * This should return the number of pairwise distances used to calculate
73      * this similarity score
74      * 
75      * @return the number of pairwise distances
76      */
77     public int getN();
78
79     public SortedSet<Species> getSpecies();
80
81     /**
82      * This should return a map, which maps species names to
83      * SpeciesSpecificDomainSimilariyData
84      * 
85      * 
86      * @return SortedMap<String, SpeciesSpecificDomainSimilariyData>
87      */
88     public SortedMap<Species, SpeciesSpecificDomainSimilariyData> getSpeciesData();
89
90     public double getStandardDeviationOfSimilarityScore();
91
92     public StringBuffer toStringBuffer( final PrintableDomainSimilarity.PRINT_OPTION print_option );
93
94     static public enum DomainSimilarityScoring {
95         DOMAINS, PROTEINS, COMBINATIONS;
96     }
97
98     public static enum DomainSimilaritySortField {
99         MIN, MAX, SD, MEAN, ABS_MAX_COUNTS_DIFFERENCE, MAX_COUNTS_DIFFERENCE, MAX_DIFFERENCE, SPECIES_COUNT, DOMAIN_ID,
100     }
101 }