// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
package org.forester.surfacing;
import java.util.SortedMap;
import java.util.TreeMap;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
import org.forester.util.BasicDescriptiveStatistics;
import org.forester.util.DescriptiveStatistics;
public class DomainLengths {
- final DomainId _domain_id;
+ final String _domain_id;
final SortedMap<Species, DescriptiveStatistics> _length_statistics;
- public DomainLengths( final DomainId domain_id ) {
+ public DomainLengths( final String domain_id ) {
_domain_id = domain_id;
_length_statistics = new TreeMap<Species, DescriptiveStatistics>();
}
getLengthStatistic( species ).addValue( domain_length );
}
- private void addLengthStatistics( final Species species, final DescriptiveStatistics length_statistic ) {
- if ( getLengthStatistics().containsKey( species ) ) {
- throw new IllegalArgumentException( "length statistics for [" + species.getSpeciesId() + "] already added" );
- }
- getLengthStatistics().put( species, length_statistic );
- }
-
/**
* Returns descriptive statistics based on the arithmetic means
- * for each species.
- *
- *
+ * for each species.
+ *
+ *
* @return
*/
public DescriptiveStatistics calculateMeanBasedStatistics() {
}
/**
- *
+ *
* Note. This is not technically a Z-score since the distribution
* of means is unknown (and not normal).
- *
+ *
* @param species
* @return
*/
return ( species_mean - population_mean ) / population_sd;
}
- public DomainId getDomainId() {
+ public String getDomainId() {
return _domain_id;
}
return getLengthStatistics().get( species );
}
- private SortedMap<Species, DescriptiveStatistics> getLengthStatistics() {
- return _length_statistics;
- }
-
public List<DescriptiveStatistics> getLengthStatisticsList() {
final List<DescriptiveStatistics> list = new ArrayList<DescriptiveStatistics>();
for( final DescriptiveStatistics stats : _length_statistics.values() ) {
public boolean isHasLengthStatistic( final Species species ) {
return getLengthStatistics().containsKey( species );
}
+
+ private void addLengthStatistics( final Species species, final DescriptiveStatistics length_statistic ) {
+ if ( getLengthStatistics().containsKey( species ) ) {
+ throw new IllegalArgumentException( "length statistics for [" + species.getSpeciesId() + "] already added" );
+ }
+ getLengthStatistics().put( species, length_statistic );
+ }
+
+ private SortedMap<Species, DescriptiveStatistics> getLengthStatistics() {
+ return _length_statistics;
+ }
}