3 // FORESTER -- software libraries and applications
4 // for evolutionary biology research and applications.
6 // Copyright (C) 2008-2009 Christian M. Zmasek
7 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
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: www.phylosoft.org/forester
27 package org.forester.surfacing;
29 import java.util.SortedMap;
30 import java.util.SortedSet;
32 import org.forester.protein.DomainId;
33 import org.forester.species.Species;
36 * This is to represent a measure of similarity between two or more domains from
39 public interface DomainSimilarity extends Comparable<DomainSimilarity> {
41 public SortedSet<DomainId> getCombinableDomainIds( final Species species_of_combinable_domain );;
43 public DomainId getDomainId();
46 * For pairwise similarities, this should return the "difference"; for example the difference in counts
47 * for copy number based features (the same as getMaximalDifferenceInCounts(), or the number
48 * of actually different domain combinations.
49 * For pairwise similarities, this should return the difference,
50 * while for comparisons of more than two domains, this should return the maximal difference
56 public int getMaximalDifference();
59 * For pairwise similarities, this should return the difference in counts,
60 * while for comparisons of more than two domains, this should return the maximal difference
64 * @return the (maximal) difference in counts
66 public int getMaximalDifferenceInCounts();
68 public double getMaximalSimilarityScore();
70 public double getMeanSimilarityScore();
72 public double getMinimalSimilarityScore();
75 * This should return the number of pairwise distances used to calculate
76 * this similarity score
78 * @return the number of pairwise distances
82 public SortedSet<Species> getSpecies();
85 * This should return a map, which maps species names to
86 * SpeciesSpecificDomainSimilariyData
89 * @return SortedMap<String, SpeciesSpecificDomainSimilariyData>
91 public SortedMap<Species, SpeciesSpecificDomainSimilariyData> getSpeciesData();
93 public double getStandardDeviationOfSimilarityScore();
95 public StringBuffer toStringBuffer( final PrintableDomainSimilarity.PRINT_OPTION print_option );
97 static public enum DomainSimilarityScoring {
98 DOMAINS, PROTEINS, COMBINATIONS;
101 public static enum DomainSimilaritySortField {
102 MIN, MAX, SD, MEAN, ABS_MAX_COUNTS_DIFFERENCE, MAX_COUNTS_DIFFERENCE, MAX_DIFFERENCE, SPECIES_COUNT, DOMAIN_ID,