// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
public final class AncestralTaxonomyInference {
- private static final int MAX_CACHE_SIZE = 100000;
- private static final int MAX_TAXONOMIES_TO_RETURN = 100;
- private static final HashMap<String, UniProtTaxonomy> _sn_up_cache_map = new HashMap<String, UniProtTaxonomy>();
- private static final HashMap<String, UniProtTaxonomy> _code_up_cache_map = new HashMap<String, UniProtTaxonomy>();
- private static final HashMap<String, UniProtTaxonomy> _cn_up_cache_map = new HashMap<String, UniProtTaxonomy>();
- private static final HashMap<String, UniProtTaxonomy> _id_up_cache_map = new HashMap<String, UniProtTaxonomy>();
+ private static final int MAX_CACHE_SIZE = 100000;
+ private static final int MAX_TAXONOMIES_TO_RETURN = 100;
+ private static final HashMap<String, UniProtTaxonomy> _sn_up_cache_map = new HashMap<String, UniProtTaxonomy>();
+ private static final HashMap<String, UniProtTaxonomy> _code_up_cache_map = new HashMap<String, UniProtTaxonomy>();
+ private static final HashMap<String, UniProtTaxonomy> _cn_up_cache_map = new HashMap<String, UniProtTaxonomy>();
+ private static final HashMap<String, UniProtTaxonomy> _id_up_cache_map = new HashMap<String, UniProtTaxonomy>();
- synchronized private static void clearCachesIfTooLarge() {
- if (getSnTaxCacheMap().size() > MAX_CACHE_SIZE) {
- getSnTaxCacheMap().clear();
- }
- if (getCnTaxCacheMap().size() > MAX_CACHE_SIZE) {
- getCnTaxCacheMap().clear();
- }
- if (getCodeTaxCacheMap().size() > MAX_CACHE_SIZE) {
- getCodeTaxCacheMap().clear();
- }
- if (getIdTaxCacheMap().size() > MAX_CACHE_SIZE) {
- getIdTaxCacheMap().clear();
- }
- }
+ synchronized private static void clearCachesIfTooLarge() {
+ if ( getSnTaxCacheMap().size() > MAX_CACHE_SIZE ) {
+ getSnTaxCacheMap().clear();
+ }
+ if ( getCnTaxCacheMap().size() > MAX_CACHE_SIZE ) {
+ getCnTaxCacheMap().clear();
+ }
+ if ( getCodeTaxCacheMap().size() > MAX_CACHE_SIZE ) {
+ getCodeTaxCacheMap().clear();
+ }
+ if ( getIdTaxCacheMap().size() > MAX_CACHE_SIZE ) {
+ getIdTaxCacheMap().clear();
+ }
+ }
- synchronized private static HashMap<String, UniProtTaxonomy> getCnTaxCacheMap() {
- return _cn_up_cache_map;
- }
+ synchronized private static HashMap<String, UniProtTaxonomy> getCnTaxCacheMap() {
+ return _cn_up_cache_map;
+ }
- synchronized private static HashMap<String, UniProtTaxonomy> getCodeTaxCacheMap() {
- return _code_up_cache_map;
- }
+ synchronized private static HashMap<String, UniProtTaxonomy> getCodeTaxCacheMap() {
+ return _code_up_cache_map;
+ }
- synchronized private static HashMap<String, UniProtTaxonomy> getIdTaxCacheMap() {
- return _id_up_cache_map;
- }
+ synchronized private static HashMap<String, UniProtTaxonomy> getIdTaxCacheMap() {
+ return _id_up_cache_map;
+ }
- synchronized private static HashMap<String, UniProtTaxonomy> getSnTaxCacheMap() {
- return _sn_up_cache_map;
- }
+ synchronized private static HashMap<String, UniProtTaxonomy> getSnTaxCacheMap() {
+ return _sn_up_cache_map;
+ }
- synchronized private static UniProtTaxonomy getTaxonomies(
- final HashMap<String, UniProtTaxonomy> cache, final String query,
- final QUERY_TYPE qt) throws IOException {
- if (cache.containsKey(query)) {
- return cache.get(query).copy();
- } else {
- List<UniProtTaxonomy> up_taxonomies = null;
- switch (qt) {
- case ID:
- up_taxonomies = getTaxonomiesFromId(query);
- break;
- case CODE:
- up_taxonomies = getTaxonomiesFromTaxonomyCode(query);
- break;
- case SN:
- up_taxonomies = getTaxonomiesFromScientificName(query);
- break;
- case CN:
- up_taxonomies = getTaxonomiesFromCommonName(query);
- break;
- default:
- throw new RuntimeException();
- }
- if ((up_taxonomies != null) && (up_taxonomies.size() == 1)) {
- final UniProtTaxonomy up_tax = up_taxonomies.get(0);
- if (!ForesterUtil.isEmpty(up_tax.getScientificName())) {
- getSnTaxCacheMap().put(up_tax.getScientificName(), up_tax);
- }
- if (!ForesterUtil.isEmpty(up_tax.getCode())) {
- getCodeTaxCacheMap().put(up_tax.getCode(), up_tax);
- }
- if (!ForesterUtil.isEmpty(up_tax.getCommonName())) {
- getCnTaxCacheMap().put(up_tax.getCommonName(), up_tax);
- }
- if (!ForesterUtil.isEmpty(up_tax.getId())) {
- getIdTaxCacheMap().put(up_tax.getId(), up_tax);
- }
- return up_tax;
- } else {
- return null;
- }
- }
- }
+ synchronized private static UniProtTaxonomy getTaxonomies( final HashMap<String, UniProtTaxonomy> cache,
+ final String query,
+ final QUERY_TYPE qt ) throws IOException {
+ if ( cache.containsKey( query ) ) {
+ return cache.get( query ).copy();
+ }
+ else {
+ List<UniProtTaxonomy> up_taxonomies = null;
+ switch ( qt ) {
+ case ID:
+ up_taxonomies = getTaxonomiesFromId( query );
+ break;
+ case CODE:
+ up_taxonomies = getTaxonomiesFromTaxonomyCode( query );
+ break;
+ case SN:
+ up_taxonomies = getTaxonomiesFromScientificName( query );
+ break;
+ case CN:
+ up_taxonomies = getTaxonomiesFromCommonName( query );
+ break;
+ default:
+ throw new RuntimeException();
+ }
+ if ( ( up_taxonomies != null ) && ( up_taxonomies.size() == 1 ) ) {
+ final UniProtTaxonomy up_tax = up_taxonomies.get( 0 );
+ if ( !ForesterUtil.isEmpty( up_tax.getScientificName() ) ) {
+ getSnTaxCacheMap().put( up_tax.getScientificName(), up_tax );
+ }
+ if ( !ForesterUtil.isEmpty( up_tax.getCode() ) ) {
+ getCodeTaxCacheMap().put( up_tax.getCode(), up_tax );
+ }
+ if ( !ForesterUtil.isEmpty( up_tax.getCommonName() ) ) {
+ getCnTaxCacheMap().put( up_tax.getCommonName(), up_tax );
+ }
+ if ( !ForesterUtil.isEmpty( up_tax.getId() ) ) {
+ getIdTaxCacheMap().put( up_tax.getId(), up_tax );
+ }
+ return up_tax;
+ }
+ else {
+ return null;
+ }
+ }
+ }
- synchronized private static List<UniProtTaxonomy> getTaxonomiesFromCommonName(
- final String query) throws IOException {
- return UniProtWsTools.getTaxonomiesFromCommonNameStrict(query,
- MAX_TAXONOMIES_TO_RETURN);
- }
+ synchronized private static List<UniProtTaxonomy> getTaxonomiesFromCommonName( final String query )
+ throws IOException {
+ return UniProtWsTools.getTaxonomiesFromCommonNameStrict( query, MAX_TAXONOMIES_TO_RETURN );
+ }
- synchronized private static List<UniProtTaxonomy> getTaxonomiesFromId(
- final String query) throws IOException {
- return UniProtWsTools.getTaxonomiesFromId(query,
- MAX_TAXONOMIES_TO_RETURN);
- }
+ synchronized private static List<UniProtTaxonomy> getTaxonomiesFromId( final String query ) throws IOException {
+ return UniProtWsTools.getTaxonomiesFromId( query, MAX_TAXONOMIES_TO_RETURN );
+ }
- synchronized private static List<UniProtTaxonomy> getTaxonomiesFromScientificName(
- final String query) throws IOException {
- return UniProtWsTools.getTaxonomiesFromScientificNameStrict(query,
- MAX_TAXONOMIES_TO_RETURN);
- }
+ synchronized private static List<UniProtTaxonomy> getTaxonomiesFromScientificName( final String query )
+ throws IOException {
+ return UniProtWsTools.getTaxonomiesFromScientificNameStrict( query, MAX_TAXONOMIES_TO_RETURN );
+ }
- synchronized private static List<UniProtTaxonomy> getTaxonomiesFromTaxonomyCode(
- final String query) throws IOException {
- return UniProtWsTools.getTaxonomiesFromTaxonomyCode(query,
- MAX_TAXONOMIES_TO_RETURN);
- }
+ synchronized private static List<UniProtTaxonomy> getTaxonomiesFromTaxonomyCode( final String query )
+ throws IOException {
+ return UniProtWsTools.getTaxonomiesFromTaxonomyCode( query, MAX_TAXONOMIES_TO_RETURN );
+ }
- synchronized public static SortedSet<String> inferTaxonomyFromDescendents(
- final Phylogeny phy) throws IOException {
- clearCachesIfTooLarge();
- final SortedSet<String> not_found = new TreeSet<String>();
- for (final PhylogenyNodeIterator iter = phy.iteratorPostorder(); iter
- .hasNext();) {
- final PhylogenyNode node = iter.next();
- // final QUERY_TYPE qt = null;
- // Taxonomy tax = null;
- // if ( node.getNodeData().isHasTaxonomy() ) {
- // tax = node.getNodeData().getTaxonomy();
- // }
- // UniProtTaxonomy up_tax = null;
- // if ( ( tax != null )
- // && ( isHasAppropriateId( tax ) || !ForesterUtil.isEmpty(
- // tax.getScientificName() )
- // || !ForesterUtil.isEmpty( tax.getTaxonomyCode() ) ||
- // !ForesterUtil.isEmpty( tax
- // .getCommonName() ) ) ) {
- // final String query = null;
- // up_tax = obtainUniProtTaxonomy( tax, query, qt );
- // if ( up_tax == null ) {
- // not_found.add( query );
- // }
- // else {
- // updateTaxonomy( qt, node, tax, up_tax );
- // }
- // }
- if (!node.isExternal()) {
- inferTaxonomyFromDescendents(node, not_found);
- }
- }
- return not_found;
- }
+ synchronized public static SortedSet<String> inferTaxonomyFromDescendents( final Phylogeny phy ) throws IOException {
+ clearCachesIfTooLarge();
+ final SortedSet<String> not_found = new TreeSet<String>();
+ for( final PhylogenyNodeIterator iter = phy.iteratorPostorder(); iter.hasNext(); ) {
+ final PhylogenyNode node = iter.next();
+ // final QUERY_TYPE qt = null;
+ // Taxonomy tax = null;
+ // if ( node.getNodeData().isHasTaxonomy() ) {
+ // tax = node.getNodeData().getTaxonomy();
+ // }
+ // UniProtTaxonomy up_tax = null;
+ // if ( ( tax != null )
+ // && ( isHasAppropriateId( tax ) || !ForesterUtil.isEmpty(
+ // tax.getScientificName() )
+ // || !ForesterUtil.isEmpty( tax.getTaxonomyCode() ) ||
+ // !ForesterUtil.isEmpty( tax
+ // .getCommonName() ) ) ) {
+ // final String query = null;
+ // up_tax = obtainUniProtTaxonomy( tax, query, qt );
+ // if ( up_tax == null ) {
+ // not_found.add( query );
+ // }
+ // else {
+ // updateTaxonomy( qt, node, tax, up_tax );
+ // }
+ // }
+ if ( !node.isExternal() ) {
+ inferTaxonomyFromDescendents( node, not_found );
+ }
+ }
+ return not_found;
+ }
- synchronized private static void inferTaxonomyFromDescendents(
- final PhylogenyNode n, final SortedSet<String> not_found)
- throws IOException {
- if (n.isExternal()) {
- throw new IllegalArgumentException(
- "attempt to infer taxonomy from descendants of external node");
- }
- n.getNodeData().setTaxonomy(null);
- final List<PhylogenyNode> descs = n.getDescendants();
- final List<String[]> lineages = new ArrayList<String[]>();
- int shortest_lin_length = Integer.MAX_VALUE;
- for (final PhylogenyNode desc : descs) {
- if (desc.getNodeData().isHasTaxonomy()
- && (isHasAppropriateId(desc.getNodeData().getTaxonomy())
- || !ForesterUtil.isEmpty(desc.getNodeData()
- .getTaxonomy().getScientificName())
- || !ForesterUtil.isEmpty(desc.getNodeData()
- .getTaxonomy().getTaxonomyCode()) || !ForesterUtil
- .isEmpty(desc.getNodeData().getTaxonomy()
- .getCommonName()))) {
- final QUERY_TYPE qt = null;
- final String query = null;
- final UniProtTaxonomy up_tax = obtainUniProtTaxonomy(desc
- .getNodeData().getTaxonomy(), query, qt);
- String[] lineage = null;
- if (up_tax != null) {
- lineage = obtainLineagePlusOwnScientificName(up_tax);
- }
- if ((lineage == null) || (lineage.length < 1)) {
- not_found.add(desc.getNodeData().getTaxonomy().asText()
- .toString());
- return;
- }
- if (lineage.length < shortest_lin_length) {
- shortest_lin_length = lineage.length;
- }
- lineages.add(lineage);
- } else {
- String msg = "Node(s) with no or inappropriate taxonomic information found";
- if (!ForesterUtil.isEmpty(desc.getName())) {
- msg = "Node " + desc.getName()
- + " has no or inappropriate taxonomic information";
- }
- throw new IllegalArgumentException(msg);
- }
- }
- String last_common_lineage = null;
- if (shortest_lin_length > 0) {
- I: for (int i = 0; i < shortest_lin_length; ++i) {
- final String lineage_0 = lineages.get(0)[i];
- for (int j = 1; j < lineages.size(); ++j) {
- if (!lineage_0.equals(lineages.get(j)[i])) {
- break I;
- }
- }
- last_common_lineage = lineage_0;
- }
- }
- if (last_common_lineage == null) {
- return;
- }
- // if ( !n.getNodeData().isHasTaxonomy() ) {
- // n.getNodeData().setTaxonomy( new Taxonomy() );
- // }
- final Taxonomy tax = new Taxonomy();
- n.getNodeData().setTaxonomy(tax);
- tax.setScientificName(last_common_lineage);
- final UniProtTaxonomy up_tax = obtainUniProtTaxonomyFromSn(last_common_lineage);
- if (up_tax != null) {
- if (!ForesterUtil.isEmpty(up_tax.getRank())) {
- try {
- tax.setRank(up_tax.getRank().toLowerCase());
- } catch (final PhyloXmlDataFormatException ex) {
- tax.setRank("");
- }
- }
- if (!ForesterUtil.isEmpty(up_tax.getId())) {
- tax.setIdentifier(new Identifier(up_tax.getId(), "uniprot"));
- }
- if (!ForesterUtil.isEmpty(up_tax.getCommonName())) {
- tax.setCommonName(up_tax.getCommonName());
- }
- if (!ForesterUtil.isEmpty(up_tax.getSynonym())
- && !tax.getSynonyms().contains(up_tax.getSynonym())) {
- tax.getSynonyms().add(up_tax.getSynonym());
- }
- }
- for (final PhylogenyNode desc : descs) {
- if (!desc.isExternal() && desc.getNodeData().isHasTaxonomy()
- && desc.getNodeData().getTaxonomy().isEqual(tax)) {
- desc.getNodeData().setTaxonomy(null);
- }
- }
- }
+ synchronized private static void inferTaxonomyFromDescendents( final PhylogenyNode n,
+ final SortedSet<String> not_found )
+ throws IOException {
+ if ( n.isExternal() ) {
+ throw new IllegalArgumentException( "attempt to infer taxonomy from descendants of external node" );
+ }
+ n.getNodeData().setTaxonomy( null );
+ final List<PhylogenyNode> descs = n.getDescendants();
+ final List<String[]> lineages = new ArrayList<String[]>();
+ int shortest_lin_length = Integer.MAX_VALUE;
+ for( final PhylogenyNode desc : descs ) {
+ if ( desc.getNodeData().isHasTaxonomy()
+ && ( isHasAppropriateId( desc.getNodeData().getTaxonomy() )
+ || !ForesterUtil.isEmpty( desc.getNodeData().getTaxonomy().getScientificName() )
+ || !ForesterUtil.isEmpty( desc.getNodeData().getTaxonomy().getTaxonomyCode() ) || !ForesterUtil
+ .isEmpty( desc.getNodeData().getTaxonomy().getCommonName() ) ) ) {
+ final QUERY_TYPE qt = null;
+ final String query = null;
+ final UniProtTaxonomy up_tax = obtainUniProtTaxonomy( desc.getNodeData().getTaxonomy(), query, qt );
+ String[] lineage = null;
+ if ( up_tax != null ) {
+ lineage = obtainLineagePlusOwnScientificName( up_tax );
+ }
+ if ( ( lineage == null ) || ( lineage.length < 1 ) ) {
+ not_found.add( desc.getNodeData().getTaxonomy().asText().toString() );
+ return;
+ }
+ if ( lineage.length < shortest_lin_length ) {
+ shortest_lin_length = lineage.length;
+ }
+ lineages.add( lineage );
+ }
+ else {
+ String msg = "Node(s) with no or inappropriate taxonomic information found";
+ if ( !ForesterUtil.isEmpty( desc.getName() ) ) {
+ msg = "Node " + desc.getName() + " has no or inappropriate taxonomic information";
+ }
+ throw new IllegalArgumentException( msg );
+ }
+ }
+ String last_common_lineage = null;
+ if ( shortest_lin_length > 0 ) {
+ I: for( int i = 0; i < shortest_lin_length; ++i ) {
+ final String lineage_0 = lineages.get( 0 )[ i ];
+ for( int j = 1; j < lineages.size(); ++j ) {
+ if ( !lineage_0.equals( lineages.get( j )[ i ] ) ) {
+ break I;
+ }
+ }
+ last_common_lineage = lineage_0;
+ }
+ }
+ if ( last_common_lineage == null ) {
+ return;
+ }
+ // if ( !n.getNodeData().isHasTaxonomy() ) {
+ // n.getNodeData().setTaxonomy( new Taxonomy() );
+ // }
+ final Taxonomy tax = new Taxonomy();
+ n.getNodeData().setTaxonomy( tax );
+ tax.setScientificName( last_common_lineage );
+ final UniProtTaxonomy up_tax = obtainUniProtTaxonomyFromSn( last_common_lineage );
+ if ( up_tax != null ) {
+ if ( !ForesterUtil.isEmpty( up_tax.getRank() ) ) {
+ try {
+ tax.setRank( up_tax.getRank().toLowerCase() );
+ }
+ catch ( final PhyloXmlDataFormatException ex ) {
+ tax.setRank( "" );
+ }
+ }
+ if ( !ForesterUtil.isEmpty( up_tax.getId() ) ) {
+ tax.setIdentifier( new Identifier( up_tax.getId(), "uniprot" ) );
+ }
+ if ( !ForesterUtil.isEmpty( up_tax.getCommonName() ) ) {
+ tax.setCommonName( up_tax.getCommonName() );
+ }
+ if ( !ForesterUtil.isEmpty( up_tax.getSynonym() ) && !tax.getSynonyms().contains( up_tax.getSynonym() ) ) {
+ tax.getSynonyms().add( up_tax.getSynonym() );
+ }
+ }
+ for( final PhylogenyNode desc : descs ) {
+ if ( !desc.isExternal() && desc.getNodeData().isHasTaxonomy()
+ && desc.getNodeData().getTaxonomy().isEqual( tax ) ) {
+ desc.getNodeData().setTaxonomy( null );
+ }
+ }
+ }
- synchronized private static boolean isHasAppropriateId(final Taxonomy tax) {
- return ((tax.getIdentifier() != null) && (!ForesterUtil.isEmpty(tax
- .getIdentifier().getValue()) && (tax.getIdentifier()
- .getProvider().equalsIgnoreCase("ncbi")
- || tax.getIdentifier().getProvider()
- .equalsIgnoreCase("uniprot") || tax.getIdentifier()
- .getProvider().equalsIgnoreCase("uniprotkb"))));
- }
+ synchronized private static boolean isHasAppropriateId( final Taxonomy tax ) {
+ return ( ( tax.getIdentifier() != null ) && ( !ForesterUtil.isEmpty( tax.getIdentifier().getValue() ) && ( tax
+ .getIdentifier().getProvider().equalsIgnoreCase( "ncbi" )
+ || tax.getIdentifier().getProvider().equalsIgnoreCase( "uniprot" ) || tax.getIdentifier().getProvider()
+ .equalsIgnoreCase( "uniprotkb" ) ) ) );
+ }
- synchronized public static SortedSet<String> obtainDetailedTaxonomicInformation(
- final Phylogeny phy) throws IOException {
- clearCachesIfTooLarge();
- final SortedSet<String> not_found = new TreeSet<String>();
- for (final PhylogenyNodeIterator iter = phy.iteratorPostorder(); iter
- .hasNext();) {
- final PhylogenyNode node = iter.next();
- final QUERY_TYPE qt = null;
- Taxonomy tax = null;
- if (node.getNodeData().isHasTaxonomy()) {
- tax = node.getNodeData().getTaxonomy();
- } else if (node.isExternal()) {
- if (!ForesterUtil.isEmpty(node.getName())) {
- not_found.add(node.getName());
- } else {
- not_found.add(node.toString());
- }
- }
- UniProtTaxonomy up_tax = null;
- if ((tax != null)
- && (isHasAppropriateId(tax)
- || !ForesterUtil.isEmpty(tax.getScientificName())
- || !ForesterUtil.isEmpty(tax.getTaxonomyCode()) || !ForesterUtil
- .isEmpty(tax.getCommonName()))) {
- up_tax = obtainUniProtTaxonomy(tax, null, qt);
- if (up_tax != null) {
- updateTaxonomy(qt, node, tax, up_tax);
- } else {
- not_found.add(tax.toString());
- }
- }
- }
- return not_found;
- }
+ synchronized public static SortedSet<String> obtainDetailedTaxonomicInformation( final Phylogeny phy )
+ throws IOException {
+ clearCachesIfTooLarge();
+ final SortedSet<String> not_found = new TreeSet<String>();
+ for( final PhylogenyNodeIterator iter = phy.iteratorPostorder(); iter.hasNext(); ) {
+ final PhylogenyNode node = iter.next();
+ final QUERY_TYPE qt = null;
+ Taxonomy tax = null;
+ if ( node.getNodeData().isHasTaxonomy() ) {
+ tax = node.getNodeData().getTaxonomy();
+ }
+ else if ( node.isExternal() ) {
+ if ( !ForesterUtil.isEmpty( node.getName() ) ) {
+ not_found.add( node.getName() );
+ }
+ else {
+ not_found.add( node.toString() );
+ }
+ }
+ UniProtTaxonomy up_tax = null;
+ if ( ( tax != null )
+ && ( isHasAppropriateId( tax ) || !ForesterUtil.isEmpty( tax.getScientificName() )
+ || !ForesterUtil.isEmpty( tax.getTaxonomyCode() ) || !ForesterUtil.isEmpty( tax
+ .getCommonName() ) ) ) {
+ up_tax = obtainUniProtTaxonomy( tax, null, qt );
+ if ( up_tax != null ) {
+ updateTaxonomy( qt, node, tax, up_tax );
+ }
+ else {
+ not_found.add( tax.toString() );
+ }
+ }
+ }
+ return not_found;
+ }
- synchronized private static String[] obtainLineagePlusOwnScientificName(
- final UniProtTaxonomy up_tax) {
- final String[] lineage = up_tax.getLineage();
- final String[] lin_plus_self = new String[lineage.length + 1];
- for (int i = 0; i < lineage.length; ++i) {
- lin_plus_self[i] = lineage[i];
- }
- lin_plus_self[lineage.length] = up_tax.getScientificName();
- return lin_plus_self;
- }
+ synchronized private static String[] obtainLineagePlusOwnScientificName( final UniProtTaxonomy up_tax ) {
+ final String[] lineage = up_tax.getLineage();
+ final String[] lin_plus_self = new String[ lineage.length + 1 ];
+ for( int i = 0; i < lineage.length; ++i ) {
+ lin_plus_self[ i ] = lineage[ i ];
+ }
+ lin_plus_self[ lineage.length ] = up_tax.getScientificName();
+ return lin_plus_self;
+ }
- synchronized private static UniProtTaxonomy obtainUniProtTaxonomy(
- final Taxonomy tax, String query, QUERY_TYPE qt) throws IOException {
- if (isHasAppropriateId(tax)) {
- query = tax.getIdentifier().getValue();
- qt = QUERY_TYPE.ID;
- return getTaxonomies(getIdTaxCacheMap(), query, qt);
- } else if (!ForesterUtil.isEmpty(tax.getScientificName())) {
- query = tax.getScientificName();
- qt = QUERY_TYPE.SN;
- return getTaxonomies(getSnTaxCacheMap(), query, qt);
- } else if (!ForesterUtil.isEmpty(tax.getTaxonomyCode())) {
- query = tax.getTaxonomyCode();
- qt = QUERY_TYPE.CODE;
- return getTaxonomies(getCodeTaxCacheMap(), query, qt);
- } else {
- query = tax.getCommonName();
- qt = QUERY_TYPE.CN;
- return getTaxonomies(getCnTaxCacheMap(), query, qt);
- }
- }
+ synchronized private static UniProtTaxonomy obtainUniProtTaxonomy( final Taxonomy tax, String query, QUERY_TYPE qt )
+ throws IOException {
+ if ( isHasAppropriateId( tax ) ) {
+ query = tax.getIdentifier().getValue();
+ qt = QUERY_TYPE.ID;
+ return getTaxonomies( getIdTaxCacheMap(), query, qt );
+ }
+ else if ( !ForesterUtil.isEmpty( tax.getScientificName() ) ) {
+ query = tax.getScientificName();
+ qt = QUERY_TYPE.SN;
+ return getTaxonomies( getSnTaxCacheMap(), query, qt );
+ }
+ else if ( !ForesterUtil.isEmpty( tax.getTaxonomyCode() ) ) {
+ query = tax.getTaxonomyCode();
+ qt = QUERY_TYPE.CODE;
+ return getTaxonomies( getCodeTaxCacheMap(), query, qt );
+ }
+ else {
+ query = tax.getCommonName();
+ qt = QUERY_TYPE.CN;
+ return getTaxonomies( getCnTaxCacheMap(), query, qt );
+ }
+ }
- synchronized private static UniProtTaxonomy obtainUniProtTaxonomyFromSn(
- final String sn) throws IOException {
- UniProtTaxonomy up_tax = null;
- if (getSnTaxCacheMap().containsKey(sn)) {
- up_tax = getSnTaxCacheMap().get(sn).copy();
- } else {
- final List<UniProtTaxonomy> up_taxonomies = getTaxonomiesFromScientificName(sn);
- if ((up_taxonomies != null) && (up_taxonomies.size() == 1)) {
- up_tax = up_taxonomies.get(0);
- getSnTaxCacheMap().put(sn, up_tax);
- if (!ForesterUtil.isEmpty(up_tax.getCode())) {
- getCodeTaxCacheMap().put(up_tax.getCode(), up_tax);
- }
- if (!ForesterUtil.isEmpty(up_tax.getCommonName())) {
- getCnTaxCacheMap().put(up_tax.getCommonName(), up_tax);
- }
- if (!ForesterUtil.isEmpty(up_tax.getId())) {
- getIdTaxCacheMap().put(up_tax.getId(), up_tax);
- }
- }
- }
- return up_tax;
- }
+ synchronized private static UniProtTaxonomy obtainUniProtTaxonomyFromSn( final String sn ) throws IOException {
+ UniProtTaxonomy up_tax = null;
+ if ( getSnTaxCacheMap().containsKey( sn ) ) {
+ up_tax = getSnTaxCacheMap().get( sn ).copy();
+ }
+ else {
+ final List<UniProtTaxonomy> up_taxonomies = getTaxonomiesFromScientificName( sn );
+ if ( ( up_taxonomies != null ) && ( up_taxonomies.size() == 1 ) ) {
+ up_tax = up_taxonomies.get( 0 );
+ getSnTaxCacheMap().put( sn, up_tax );
+ if ( !ForesterUtil.isEmpty( up_tax.getCode() ) ) {
+ getCodeTaxCacheMap().put( up_tax.getCode(), up_tax );
+ }
+ if ( !ForesterUtil.isEmpty( up_tax.getCommonName() ) ) {
+ getCnTaxCacheMap().put( up_tax.getCommonName(), up_tax );
+ }
+ if ( !ForesterUtil.isEmpty( up_tax.getId() ) ) {
+ getIdTaxCacheMap().put( up_tax.getId(), up_tax );
+ }
+ }
+ }
+ return up_tax;
+ }
- synchronized private static void updateTaxonomy(final QUERY_TYPE qt,
- final PhylogenyNode node, final Taxonomy tax,
- final UniProtTaxonomy up_tax) {
- if ((qt != QUERY_TYPE.SN)
- && !ForesterUtil.isEmpty(up_tax.getScientificName())
- && ForesterUtil.isEmpty(tax.getScientificName())) {
- tax.setScientificName(up_tax.getScientificName());
- }
- if (node.isExternal()
- && ((qt != QUERY_TYPE.CODE)
- && !ForesterUtil.isEmpty(up_tax.getCode()) && ForesterUtil
- .isEmpty(tax.getTaxonomyCode()))) {
- tax.setTaxonomyCode(up_tax.getCode());
- }
- if ((qt != QUERY_TYPE.CN)
- && !ForesterUtil.isEmpty(up_tax.getCommonName())
- && ForesterUtil.isEmpty(tax.getCommonName())) {
- tax.setCommonName(up_tax.getCommonName());
- }
- if (!ForesterUtil.isEmpty(up_tax.getSynonym())
- && !tax.getSynonyms().contains(up_tax.getSynonym())) {
- tax.getSynonyms().add(up_tax.getSynonym());
- }
- if (!ForesterUtil.isEmpty(up_tax.getRank())
- && ForesterUtil.isEmpty(tax.getRank())) {
- try {
- tax.setRank(up_tax.getRank().toLowerCase());
- } catch (final PhyloXmlDataFormatException ex) {
- tax.setRank("");
- }
- }
- if ((qt != QUERY_TYPE.ID) && !ForesterUtil.isEmpty(up_tax.getId())
- && (tax.getIdentifier() == null)) {
- tax.setIdentifier(new Identifier(up_tax.getId(), "uniprot"));
- }
- }
+ synchronized private static void updateTaxonomy( final QUERY_TYPE qt,
+ final PhylogenyNode node,
+ final Taxonomy tax,
+ final UniProtTaxonomy up_tax ) {
+ if ( ( qt != QUERY_TYPE.SN ) && !ForesterUtil.isEmpty( up_tax.getScientificName() )
+ && ForesterUtil.isEmpty( tax.getScientificName() ) ) {
+ tax.setScientificName( up_tax.getScientificName() );
+ }
+ if ( node.isExternal()
+ && ( ( qt != QUERY_TYPE.CODE ) && !ForesterUtil.isEmpty( up_tax.getCode() ) && ForesterUtil
+ .isEmpty( tax.getTaxonomyCode() ) ) ) {
+ tax.setTaxonomyCode( up_tax.getCode() );
+ }
+ if ( ( qt != QUERY_TYPE.CN ) && !ForesterUtil.isEmpty( up_tax.getCommonName() )
+ && ForesterUtil.isEmpty( tax.getCommonName() ) ) {
+ tax.setCommonName( up_tax.getCommonName() );
+ }
+ if ( !ForesterUtil.isEmpty( up_tax.getSynonym() ) && !tax.getSynonyms().contains( up_tax.getSynonym() ) ) {
+ tax.getSynonyms().add( up_tax.getSynonym() );
+ }
+ if ( !ForesterUtil.isEmpty( up_tax.getRank() ) && ForesterUtil.isEmpty( tax.getRank() ) ) {
+ try {
+ tax.setRank( up_tax.getRank().toLowerCase() );
+ }
+ catch ( final PhyloXmlDataFormatException ex ) {
+ tax.setRank( "" );
+ }
+ }
+ if ( ( qt != QUERY_TYPE.ID ) && !ForesterUtil.isEmpty( up_tax.getId() ) && ( tax.getIdentifier() == null ) ) {
+ tax.setIdentifier( new Identifier( up_tax.getId(), "uniprot" ) );
+ }
+ }
- private enum QUERY_TYPE {
- CODE, SN, CN, ID;
- }
+ private enum QUERY_TYPE {
+ CODE, SN, CN, ID;
+ }
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
targets = factory.create( target_file, ForesterUtil.createParserDependingOnFileType( target_file, true ) );
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( PRG_NAME, "failed to read target phylogenies from [" + target_file + "]: "
- + e.getLocalizedMessage() );
+ ForesterUtil.fatalError( PRG_NAME,
+ "failed to read target phylogenies from [" + target_file + "]: "
+ + e.getLocalizedMessage() );
}
int counter = 0;
for( final Phylogeny target : targets ) {
ForesterUtil.programMessage( PRG_NAME, "read in a total of " + targets.length + " targets" );
}
try {
- evaluators = factory.create( evaluators_file, ForesterUtil
- .createParserDependingOnFileType( evaluators_file, true ) );
+ evaluators = factory.create( evaluators_file,
+ ForesterUtil.createParserDependingOnFileType( evaluators_file, true ) );
}
catch ( final IOException e ) {
ForesterUtil.fatalError( PRG_NAME, "failed to read evaluator topologies from [" + evaluators_file + "]: "
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
p = factory.create( phylogeny_infile, pp )[ 0 ];
}
catch ( final Exception e ) {
- ForesterUtil.fatalError( count_support.PRG_NAME, "Could not read \"" + phylogeny_infile + "\" ["
- + e.getMessage() + "]" );
+ ForesterUtil.fatalError( count_support.PRG_NAME,
+ "Could not read \"" + phylogeny_infile + "\" [" + e.getMessage() + "]" );
}
try {
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
ev = factory.create( evaluators_infile, pp );
}
catch ( final Exception e ) {
- ForesterUtil.fatalError( count_support.PRG_NAME, "Could not read \"" + evaluators_infile + "\" ["
- + e.getMessage() + "]" );
+ ForesterUtil.fatalError( count_support.PRG_NAME,
+ "Could not read \"" + evaluators_infile + "\" [" + e.getMessage() + "]" );
}
boolean strip = false;
if ( cla.isOptionSet( "s" ) ) {
else {
System.out.println( "Writing " + ev.length + " evaluator phylogenies to :" + evaluators_outfile );
if ( count_support.WRITE_EVALUATORS_AS_NHX ) {
- w.toNewHampshireX( Arrays.asList( ev ), evaluators_outfile, ";"
- + ForesterUtil.getLineSeparator() );
+ w.toNewHampshireX( Arrays.asList( ev ),
+ evaluators_outfile,
+ ";" + ForesterUtil.getLineSeparator() );
}
else {
w.toNewHampshire( Arrays.asList( ev ), true, branch_lengths_in_ev_out, evaluators_outfile, ";"
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
mapping_table = BasicTableParser.parse( mapping_infile, separator, decorator.USE_FIRST_SEPARATOR_ONLY );
}
catch ( final Exception e ) {
- ForesterUtil.fatalError( decorator.PRG_NAME, "failed to read [" + mapping_infile + "] ["
- + e.getMessage() + "]" );
+ ForesterUtil.fatalError( decorator.PRG_NAME,
+ "failed to read [" + mapping_infile + "] [" + e.getMessage() + "]" );
}
if ( ( key_column < 0 ) || ( key_column >= mapping_table.getNumberOfColumns() ) ) {
ForesterUtil.fatalError( decorator.PRG_NAME, "illegal value for key column" );
table = PhylogenyDecorator.parseMappingTable( mapping_infile );
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( decorator.PRG_NAME, "failed to read \"" + mapping_infile + "\" ["
- + e.getMessage() + "]" );
+ ForesterUtil.fatalError( decorator.PRG_NAME,
+ "failed to read \"" + mapping_infile + "\" [" + e.getMessage() + "]" );
}
PhylogenyDecorator.decorate( phylogenies,
table,
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2009 Christian M. Zmasek
// Copyright (C) 2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2009 Christian M. Zmasek
// Copyright (C) 2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2009 Christian M. Zmasek
// Copyright (C) 2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
public class phyloxml_converter {
- final static private String HELP_OPTION_1 = "help";
- final static private String HELP_OPTION_2 = "h";
- final static private String FIELD_OPTION = "f";
- final static private String FIELD_CLADE_NAME = "nn";
- final static private String FIELD_TAXONOMY_CODE = "tc";
- final static private String FIELD_TAXONOMY_SCI_NAME = "sn";
- final static private String FIELD_TAXONOMY_COMM_NAME = "cn";
- final static private String FIELD_SEQUENCE_GENE_NAME = "gn";
- final static private String FIELD_SEQUENCE_SYMBOL = "sy";
- final static private String FIELD_DUMMY = "dummy";
- final static private String INTERNAL_NAMES_ARE_BOOT_SUPPPORT = "i";
- final static private String MIDPOINT_REROOT = "m";
- final static private String EXTRACT_TAXONOMY = "xt";
- final static private String EXTRACT_TAXONOMY_PF = "xp";
- final static private String ORDER_SUBTREES = "o";
- final static private String NO_TREE_LEVEL_INDENDATION = "ni";
- final static private String REPLACE_UNDER_SCORES = "ru";
- final static private String PRG_NAME = "phyloxml_converter";
- final static private String PRG_VERSION = "1.21";
- final static private String PRG_DATE = "2010.10.02";
- final static private String E_MAIL = "czmasek@burnham.org";
- final static private String WWW = "www.phylosoft.org/forester/";
- final static private boolean SPECIAL = false;
+ final static private String HELP_OPTION_1 = "help";
+ final static private String HELP_OPTION_2 = "h";
+ final static private String FIELD_OPTION = "f";
+ final static private String FIELD_CLADE_NAME = "nn";
+ final static private String FIELD_TAXONOMY_CODE = "tc";
+ final static private String FIELD_TAXONOMY_SCI_NAME = "sn";
+ final static private String FIELD_TAXONOMY_COMM_NAME = "cn";
+ final static private String FIELD_SEQUENCE_GENE_NAME = "gn";
+ final static private String FIELD_SEQUENCE_SYMBOL = "sy";
+ final static private String FIELD_UNIPROT_TAXONOMY_ID_SPLIT_1 = "i1";
+ final static private String FIELD_UNIPROT_TAXONOMY_ID_SPLIT_2 = "i2";
+ final static private String FIELD_DUMMY = "dummy";
+ final static private String INTERNAL_NAMES_ARE_BOOT_SUPPPORT = "i";
+ final static private String MIDPOINT_REROOT = "m";
+ final static private String EXTRACT_TAXONOMY = "xt";
+ final static private String EXTRACT_TAXONOMY_PF = "xp";
+ final static private String ORDER_SUBTREES = "o";
+ final static private String NO_TREE_LEVEL_INDENDATION = "ni";
+ final static private String REPLACE_UNDER_SCORES = "ru";
+ final static private String PRG_NAME = "phyloxml_converter";
+ final static private String PRG_VERSION = "1.30";
+ final static private String PRG_DATE = "2011.03.01";
+ final static private String E_MAIL = "phylosoft@gmail.com";
+ final static private String WWW = "www.phylosoft.org/forester/";
+ final static private boolean SPECIAL = false;
public static void main( final String args[] ) {
ForesterUtil.printProgramInformation( PRG_NAME, PRG_VERSION, PRG_DATE, E_MAIL, WWW );
else if ( field_option_value.equals( FIELD_SEQUENCE_SYMBOL ) ) {
field = PhylogenyNodeField.SEQUENCE_SYMBOL;
}
+ else if ( field_option_value.equals( FIELD_UNIPROT_TAXONOMY_ID_SPLIT_1 ) ) {
+ field = PhylogenyNodeField.TAXONOMY_ID_UNIPROT_1;
+ }
+ else if ( field_option_value.equals( FIELD_UNIPROT_TAXONOMY_ID_SPLIT_2 ) ) {
+ field = PhylogenyNodeField.TAXONOMY_ID_UNIPROT_2;
+ }
else if ( field_option_value.equals( FIELD_DUMMY ) ) {
}
else {
System.out.println( " " + FIELD_TAXONOMY_COMM_NAME + ": transfer name to taxonomy common name" );
System.out.println( " " + FIELD_SEQUENCE_GENE_NAME + ": transfer name to sequence name" );
System.out.println( " " + FIELD_SEQUENCE_SYMBOL + ": transfer name to sequence symbol" );
+ System.out
+ .println( " "
+ + FIELD_UNIPROT_TAXONOMY_ID_SPLIT_1
+ + ": transfer/split name to taxonomy uniprot identifier\n (split at underscore if \"id_name\" pattern, e.g. \"817_SusD\")" );
+ System.out
+ .println( " "
+ + FIELD_UNIPROT_TAXONOMY_ID_SPLIT_2
+ + ": transfer/split name to taxonomy uniprot identifier\n (split at underscore if \"name_id\" pattern, e.g. \"SusD_817\")" );
System.out.println();
System.out.println( " options: " );
System.out.println( " -" + INTERNAL_NAMES_ARE_BOOT_SUPPPORT
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
species_tree = factory.create( species_tree_file, new PhyloXmlParser() )[ 0 ];
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( sdi.PRG_NAME, "Failed to read species tree from \"" + gene_tree_file + "\" ["
- + e.getMessage() + "]" );
+ ForesterUtil.fatalError( sdi.PRG_NAME,
+ "Failed to read species tree from \"" + gene_tree_file + "\" [" + e.getMessage()
+ + "]" );
}
try {
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
gene_tree = factory.create( gene_tree_file, new PhyloXmlParser() )[ 0 ];
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( sdi.PRG_NAME, "Failed to read gene tree from \"" + gene_tree_file + "\" ["
- + e.getMessage() + "]" );
+ ForesterUtil.fatalError( sdi.PRG_NAME,
+ "Failed to read gene tree from \"" + gene_tree_file + "\" [" + e.getMessage()
+ + "]" );
}
gene_tree.setRooted( true );
species_tree.setRooted( true );
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
species_tree = factory.create( species_tree_file, pp )[ 0 ];
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( PRG_NAME, "failed to read species tree [" + species_tree_file + "]: "
- + e.getLocalizedMessage() );
+ ForesterUtil.fatalError( PRG_NAME,
+ "failed to read species tree [" + species_tree_file + "]: "
+ + e.getLocalizedMessage() );
}
if ( !species_tree.isRooted() ) {
ForesterUtil.fatalError( PRG_NAME, "species tree [" + species_tree_file + "] is not rooted" );
gene_trees = factory.create( gene_tree_file, pp );
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( PRG_NAME, "failed to read gene trees [" + gene_tree_file + "]: "
- + e.getLocalizedMessage() );
+ ForesterUtil.fatalError( PRG_NAME,
+ "failed to read gene trees [" + gene_tree_file + "]: " + e.getLocalizedMessage() );
}
// Removes from gene_tree all species not found in species_tree.
int gene_tree_counter = 0;
+ ForesterUtil.FORMATTER_06.format( sdiunrooted.getMinimalTreeHeight() ) );
ForesterUtil.programMessage( PRG_NAME, "Minimal difference in subtree heights: "
+ ForesterUtil.FORMATTER_06.format( sdiunrooted.getMinimalDiffInSubTreeHeights() ) );
- ForesterUtil.programMessage( PRG_NAME, "Duplications in midpoint rooted tree : "
- + sdiunrooted.getMinimalDuplications() );
+ ForesterUtil.programMessage( PRG_NAME,
+ "Duplications in midpoint rooted tree : "
+ + sdiunrooted.getMinimalDuplications() );
}
else {
ForesterUtil.programMessage( PRG_NAME, "No (re) rooting was performed." );
w.toPhyloXML( outfile, all_result_trees, 0, ForesterUtil.LINE_SEPARATOR );
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( PRG_NAME, "failure to write output to [" + outfile + "]: "
- + e.getLocalizedMessage() );
+ ForesterUtil.fatalError( PRG_NAME,
+ "failure to write output to [" + outfile + "]: " + e.getLocalizedMessage() );
}
ForesterUtil.programMessage( PRG_NAME, "Wrote: " + outfile );
ForesterUtil.programMessage( PRG_NAME, "OK." );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
public class sdix {
- final static private String HELP_OPTION_1 = "help";
- final static private String HELP_OPTION_2 = "h";
- final static private String PRG_NAME = "sdix";
- final static private String PRG_VERSION = "0.001 alpha";
- final static private String PRG_DATE = "2009.10.14";
+ final static private String HELP_OPTION_1 = "help";
+ final static private String HELP_OPTION_2 = "h";
+ final static private String PRG_NAME = "sdix";
+ final static private String PRG_VERSION = "0.001 alpha";
+ final static private String PRG_DATE = "2009.10.14";
public static void main( final String args[] ) {
ForesterUtil.printProgramInformation( PRG_NAME, PRG_VERSION, PRG_DATE );
species_trees = factory.create( species_trees_file, new PhyloXmlParser() );
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( PRG_NAME, "failed to read species trees from [" + species_trees_file + "] ["
- + e.getMessage() + "]" );
+ ForesterUtil.fatalError( PRG_NAME,
+ "failed to read species trees from [" + species_trees_file + "] ["
+ + e.getMessage() + "]" );
}
if ( ( species_trees == null ) || ( species_trees.length < 1 ) ) {
ForesterUtil.fatalError( PRG_NAME, "failed to read species trees from [" + species_trees_file + "]" );
+ species_trees_file + "]" );
final FilenameFilter filter = new FilenameFilter() {
+ @Override
public boolean accept( final File dir, final String name ) {
return ( !name.startsWith( "." ) && !name.startsWith( "00_" ) && name.endsWith( ".xml" ) );
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
final List<String> ext_children_from = node_from.getAllExternalDescendantsNames();
if ( ( ext_children_from.size() == ext_children_to.size() )
&& ext_children_from.containsAll( ext_children_to ) ) {
- PhylogenyMethods.setBootstrapConfidence( node_to, PhylogenyMethods
- .getConfidenceValue( node_from ) );
+ PhylogenyMethods.setBootstrapConfidence( node_to,
+ PhylogenyMethods.getConfidenceValue( node_from ) );
continue to;
}
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
phylogenies = factory.create( surfacing_nexus_outfile, phylogeny_parser );
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( PRG_NAME, "problem with parsing phylogeny [" + surfacing_nexus_outfile + "]: "
- + e.getMessage() );
+ ForesterUtil.fatalError( PRG_NAME,
+ "problem with parsing phylogeny [" + surfacing_nexus_outfile + "]: "
+ + e.getMessage() );
e.printStackTrace();
}
if ( phylogenies.length != 1 ) {
matrix = paup_log_parser.parse();
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( PRG_NAME, "failed to parse matrix from [" + paup_log_file + "]: "
- + e.getMessage() );
+ ForesterUtil.fatalError( PRG_NAME,
+ "failed to parse matrix from [" + paup_log_file + "]: " + e.getMessage() );
}
- ForesterUtil.programMessage( PRG_NAME, "read in character state matrix of size "
- + matrix.getNumberOfIdentifiers() + "x" + matrix.getNumberOfCharacters() );
+ ForesterUtil.programMessage( PRG_NAME,
+ "read in character state matrix of size " + matrix.getNumberOfIdentifiers() + "x"
+ + matrix.getNumberOfCharacters() );
final DomainParsimonyCalculator domain_parsimony = DomainParsimonyCalculator.createInstance( phylogeny );
domain_parsimony.executeOnGivenBinaryStatesMatrix( matrix, labels );
final String sep = ForesterUtil.LINE_SEPARATOR + "###################" + ForesterUtil.LINE_SEPARATOR;
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import org.forester.surfacing.DomainLengthsTable;
import org.forester.surfacing.DomainParsimonyCalculator;
import org.forester.surfacing.DomainSimilarity;
+import org.forester.surfacing.DomainSimilarity.DomainSimilarityScoring;
+import org.forester.surfacing.DomainSimilarity.DomainSimilaritySortField;
import org.forester.surfacing.DomainSimilarityCalculator;
+import org.forester.surfacing.DomainSimilarityCalculator.Detailedness;
import org.forester.surfacing.GenomeWideCombinableDomains;
+import org.forester.surfacing.GenomeWideCombinableDomains.GenomeWideCombinableDomainsSortOrder;
import org.forester.surfacing.MappingResults;
import org.forester.surfacing.PairwiseDomainSimilarityCalculator;
import org.forester.surfacing.PairwiseGenomeComparator;
import org.forester.surfacing.PrintableDomainSimilarity;
+import org.forester.surfacing.PrintableDomainSimilarity.PRINT_OPTION;
import org.forester.surfacing.Protein;
import org.forester.surfacing.ProteinCountsBasedPairwiseDomainSimilarityCalculator;
import org.forester.surfacing.Species;
import org.forester.surfacing.SurfacingUtil;
-import org.forester.surfacing.DomainSimilarity.DomainSimilarityScoring;
-import org.forester.surfacing.DomainSimilarity.DomainSimilaritySortField;
-import org.forester.surfacing.DomainSimilarityCalculator.Detailedness;
-import org.forester.surfacing.GenomeWideCombinableDomains.GenomeWideCombinableDomainsSortOrder;
-import org.forester.surfacing.PrintableDomainSimilarity.PRINT_OPTION;
import org.forester.util.BasicTable;
import org.forester.util.BasicTableParser;
import org.forester.util.CommandLineArguments;
ForesterUtil.fatalError( surfacing.PRG_NAME, "input tree [" + intree_file + "] is not rooted" );
}
if ( intree.getNumberOfExternalNodes() < number_of_genomes ) {
- ForesterUtil.fatalError( surfacing.PRG_NAME, "number of external nodes ["
- + intree.getNumberOfExternalNodes() + "] of input tree [" + intree_file
- + "] is smaller than the number of genomes the be analyzed [" + number_of_genomes + "]" );
+ ForesterUtil.fatalError( surfacing.PRG_NAME,
+ "number of external nodes [" + intree.getNumberOfExternalNodes()
+ + "] of input tree [" + intree_file
+ + "] is smaller than the number of genomes the be analyzed ["
+ + number_of_genomes + "]" );
}
final StringBuilder parent_names = new StringBuilder();
final int nodes_lacking_name = SurfacingUtil.getNumberOfNodesLackingName( intree, parent_names );
.createDomainIdToSecondaryFeaturesMap( secondary_features_map_files[ i ] );
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( surfacing.PRG_NAME, "cannot read secondary features map file: "
- + e.getMessage() );
+ ForesterUtil.fatalError( surfacing.PRG_NAME,
+ "cannot read secondary features map file: " + e.getMessage() );
}
catch ( final Exception e ) {
ForesterUtil.fatalError( surfacing.PRG_NAME, "problem with contents of features map file ["
if ( max_allowed_overlap != surfacing.MAX_ALLOWED_OVERLAP_DEFAULT ) {
parser.setMaxAllowedOverlap( max_allowed_overlap );
}
- parser
- .setReturnType( HmmscanPerDomainTableParser.ReturnType.UNORDERED_PROTEIN_DOMAIN_COLLECTION_PER_PROTEIN );
+ parser.setReturnType( HmmscanPerDomainTableParser.ReturnType.UNORDERED_PROTEIN_DOMAIN_COLLECTION_PER_PROTEIN );
if ( individual_score_cutoffs != null ) {
parser.setIndividualScoreCutoffs( individual_score_cutoffs );
}
System.out.println( "Domains ignored due to individual score cutoffs: "
+ parser.getDomainsIgnoredDueToIndividualScoreCutoff() );
log( "Domains ignored due to individual score cutoffs: "
- + parser.getDomainsIgnoredDueToIndividualScoreCutoff(), log_writer );
+ + parser.getDomainsIgnoredDueToIndividualScoreCutoff(),
+ log_writer );
System.out.println( "Domains ignored due to E-value : "
+ parser.getDomainsIgnoredDueToEval() );
log( "Domains ignored due to E-value : " + parser.getDomainsIgnoredDueToEval(), log_writer );
System.out.println( "Domains ignored due negative domain filter : "
+ parser.getDomainsIgnoredDueToNegativeDomainFilter() );
log( "Domains ignored due negative domain filter : "
- + parser.getDomainsIgnoredDueToNegativeDomainFilter(), log_writer );
+ + parser.getDomainsIgnoredDueToNegativeDomainFilter(),
+ log_writer );
System.out.println( "Domains ignored due to overlap : "
+ parser.getDomainsIgnoredDueToOverlap() );
log( "Domains ignored due to overlap : " + parser.getDomainsIgnoredDueToOverlap(),
}
SurfacingUtil.writeMatrixToFile( new File( matrix_output_file
+ surfacing.MATRIX_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc.getDomainDistanceScoresMeans() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file
+ + surfacing.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedBinaryCombinationsBasedDistances() );
SurfacingUtil.writeMatrixToFile( new File( matrix_output_file
- + surfacing.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedBinaryCombinationsBasedDistances() );
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file
- + surfacing.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedDomainsBasedDistances() );
+ + surfacing.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedDomainsBasedDistances() );
final Phylogeny nj_gd = SurfacingUtil.createNjTreeBasedOnMatrixToFile( new File( matrix_output_file
+ surfacing.NJ_TREE_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc.getDomainDistanceScoresMeans()
.get( 0 ) );
jacknife_resamplings,
jacknife_ratio,
random_seed );
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file + "_"
- + ForesterUtil.round( jacknife_ratio, 2 ) + "_" + jacknife_resamplings
- + surfacing.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedBinaryCombinationsBasedDistances() );
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file + "_"
- + ForesterUtil.round( jacknife_ratio, 2 ) + "_" + jacknife_resamplings
- + surfacing.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedDomainsBasedDistances() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file
+ + "_"
+ + ForesterUtil.round( jacknife_ratio, 2 )
+ + "_"
+ + jacknife_resamplings
+ + surfacing.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedBinaryCombinationsBasedDistances() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file + "_" + ForesterUtil.round( jacknife_ratio, 2 )
+ + "_" + jacknife_resamplings
+ + surfacing.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedDomainsBasedDistances() );
// if ( infer_species_trees ) {
// inferSpeciesTrees( new File( output_file + "_" + jacknife_resamplings
// + INFERRED_SBC_BASED_NJ_SPECIES_TREE_SUFFIX ), pwgc
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import org.forester.surfacing.DomainLengthsTable;
import org.forester.surfacing.DomainParsimonyCalculator;
import org.forester.surfacing.DomainSimilarity;
+import org.forester.surfacing.DomainSimilarity.DomainSimilarityScoring;
+import org.forester.surfacing.DomainSimilarity.DomainSimilaritySortField;
import org.forester.surfacing.DomainSimilarityCalculator;
+import org.forester.surfacing.DomainSimilarityCalculator.Detailedness;
import org.forester.surfacing.GenomeWideCombinableDomains;
+import org.forester.surfacing.GenomeWideCombinableDomains.GenomeWideCombinableDomainsSortOrder;
import org.forester.surfacing.MappingResults;
import org.forester.surfacing.PairwiseDomainSimilarityCalculator;
import org.forester.surfacing.PairwiseGenomeComparator;
import org.forester.surfacing.PrintableDomainSimilarity;
+import org.forester.surfacing.PrintableDomainSimilarity.PRINT_OPTION;
import org.forester.surfacing.Protein;
import org.forester.surfacing.ProteinCountsBasedPairwiseDomainSimilarityCalculator;
import org.forester.surfacing.Species;
import org.forester.surfacing.SurfacingUtil;
-import org.forester.surfacing.DomainSimilarity.DomainSimilarityScoring;
-import org.forester.surfacing.DomainSimilarity.DomainSimilaritySortField;
-import org.forester.surfacing.DomainSimilarityCalculator.Detailedness;
-import org.forester.surfacing.GenomeWideCombinableDomains.GenomeWideCombinableDomainsSortOrder;
-import org.forester.surfacing.PrintableDomainSimilarity.PRINT_OPTION;
import org.forester.util.BasicTable;
import org.forester.util.BasicTableParser;
import org.forester.util.CommandLineArguments;
ForesterUtil.fatalError( surfacing_hmmpfam.PRG_NAME, "input tree [" + intree_file + "] is not rooted" );
}
if ( intree.getNumberOfExternalNodes() < number_of_genomes ) {
- ForesterUtil.fatalError( surfacing_hmmpfam.PRG_NAME, "number of external nodes ["
- + intree.getNumberOfExternalNodes() + "] of input tree [" + intree_file
- + "] is smaller than the number of genomes the be analyzed [" + number_of_genomes + "]" );
+ ForesterUtil.fatalError( surfacing_hmmpfam.PRG_NAME,
+ "number of external nodes [" + intree.getNumberOfExternalNodes()
+ + "] of input tree [" + intree_file
+ + "] is smaller than the number of genomes the be analyzed ["
+ + number_of_genomes + "]" );
}
final StringBuilder parent_names = new StringBuilder();
final int nodes_lacking_name = SurfacingUtil.getNumberOfNodesLackingName( intree, parent_names );
ForesterUtil.fatalError( surfacing_hmmpfam.PRG_NAME, "no value for negative domains filter: -"
+ surfacing_hmmpfam.FILTER_NEGATIVE_DOMAINS_OPTION + "=<file>" );
}
- negative_domains_filter_file = new File( cla
- .getOptionValue( surfacing_hmmpfam.FILTER_NEGATIVE_DOMAINS_OPTION ) );
+ negative_domains_filter_file = new File( cla.getOptionValue( surfacing_hmmpfam.FILTER_NEGATIVE_DOMAINS_OPTION ) );
final String msg = ForesterUtil.isReadableFile( negative_domains_filter_file );
if ( !ForesterUtil.isEmpty( msg ) ) {
ForesterUtil.fatalError( surfacing_hmmpfam.PRG_NAME, "can not read from \""
}
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( surfacing_hmmpfam.PRG_NAME, "cannot read from GO OBO file: "
- + e.getLocalizedMessage() );
+ ForesterUtil.fatalError( surfacing_hmmpfam.PRG_NAME,
+ "cannot read from GO OBO file: " + e.getLocalizedMessage() );
}
}
Map<GoId, GoTerm> go_id_to_term_map = null;
matrix_output_file = out_dir + ForesterUtil.FILE_SEPARATOR + matrix_output_file;
output_file = new File( out_dir + ForesterUtil.FILE_SEPARATOR + output_file );
}
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file
- + surfacing_hmmpfam.MATRIX_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getDomainDistanceScoresMeans() );
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file
- + surfacing_hmmpfam.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedBinaryCombinationsBasedDistances() );
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file
- + surfacing_hmmpfam.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedDomainsBasedDistances() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file
+ + surfacing_hmmpfam.MATRIX_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getDomainDistanceScoresMeans() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file
+ + surfacing_hmmpfam.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedBinaryCombinationsBasedDistances() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file
+ + surfacing_hmmpfam.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedDomainsBasedDistances() );
final Phylogeny nj_gd = SurfacingUtil.createNjTreeBasedOnMatrixToFile( new File( matrix_output_file
+ surfacing_hmmpfam.NJ_TREE_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
.getDomainDistanceScoresMeans().get( 0 ) );
jacknife_resamplings,
jacknife_ratio,
random_seed );
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file + "_"
- + ForesterUtil.round( jacknife_ratio, 2 ) + "_" + jacknife_resamplings
- + surfacing_hmmpfam.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedBinaryCombinationsBasedDistances() );
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file + "_"
- + ForesterUtil.round( jacknife_ratio, 2 ) + "_" + jacknife_resamplings
- + surfacing_hmmpfam.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedDomainsBasedDistances() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file
+ + "_"
+ + ForesterUtil.round( jacknife_ratio, 2 )
+ + "_"
+ + jacknife_resamplings
+ + surfacing_hmmpfam.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedBinaryCombinationsBasedDistances() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file
+ + "_"
+ + ForesterUtil.round( jacknife_ratio, 2 )
+ + "_"
+ + jacknife_resamplings
+ + surfacing_hmmpfam.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedDomainsBasedDistances() );
// if ( infer_species_trees ) {
// inferSpeciesTrees( new File( output_file + "_" + jacknife_resamplings
// + INFERRED_SBC_BASED_NJ_SPECIES_TREE_SUFFIX ), pwgc
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import org.forester.surfacing.DomainLengthsTable;
import org.forester.surfacing.DomainParsimonyCalculator;
import org.forester.surfacing.DomainSimilarity;
+import org.forester.surfacing.DomainSimilarity.DomainSimilarityScoring;
+import org.forester.surfacing.DomainSimilarity.DomainSimilaritySortField;
import org.forester.surfacing.DomainSimilarityCalculator;
+import org.forester.surfacing.DomainSimilarityCalculator.Detailedness;
import org.forester.surfacing.GenomeWideCombinableDomains;
+import org.forester.surfacing.GenomeWideCombinableDomains.GenomeWideCombinableDomainsSortOrder;
import org.forester.surfacing.MappingResults;
import org.forester.surfacing.PairwiseDomainSimilarityCalculator;
import org.forester.surfacing.PairwiseGenomeComparator;
import org.forester.surfacing.PrintableDomainSimilarity;
+import org.forester.surfacing.PrintableDomainSimilarity.PRINT_OPTION;
import org.forester.surfacing.Protein;
import org.forester.surfacing.ProteinCountsBasedPairwiseDomainSimilarityCalculator;
import org.forester.surfacing.Species;
import org.forester.surfacing.SurfacingUtil;
-import org.forester.surfacing.DomainSimilarity.DomainSimilarityScoring;
-import org.forester.surfacing.DomainSimilarity.DomainSimilaritySortField;
-import org.forester.surfacing.DomainSimilarityCalculator.Detailedness;
-import org.forester.surfacing.GenomeWideCombinableDomains.GenomeWideCombinableDomainsSortOrder;
-import org.forester.surfacing.PrintableDomainSimilarity.PRINT_OPTION;
import org.forester.util.BasicTable;
import org.forester.util.BasicTableParser;
import org.forester.util.CommandLineArguments;
ForesterUtil.fatalError( surfacing_old.PRG_NAME, "input tree [" + intree_file + "] is not rooted" );
}
if ( intree.getNumberOfExternalNodes() < number_of_genomes ) {
- ForesterUtil.fatalError( surfacing_old.PRG_NAME, "number of external nodes ["
- + intree.getNumberOfExternalNodes() + "] of input tree [" + intree_file
- + "] is smaller than the number of genomes the be analyzed [" + number_of_genomes + "]" );
+ ForesterUtil.fatalError( surfacing_old.PRG_NAME,
+ "number of external nodes [" + intree.getNumberOfExternalNodes()
+ + "] of input tree [" + intree_file
+ + "] is smaller than the number of genomes the be analyzed ["
+ + number_of_genomes + "]" );
}
final StringBuilder parent_names = new StringBuilder();
final int nodes_lacking_name = SurfacingUtil.getNumberOfNodesLackingName( intree, parent_names );
}
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( surfacing_old.PRG_NAME, "cannot read from GO OBO file: "
- + e.getLocalizedMessage() );
+ ForesterUtil.fatalError( surfacing_old.PRG_NAME,
+ "cannot read from GO OBO file: " + e.getLocalizedMessage() );
}
}
Map<GoId, GoTerm> go_id_to_term_map = null;
.createDomainIdToSecondaryFeaturesMap( secondary_features_map_files[ i ] );
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( surfacing_old.PRG_NAME, "cannot read secondary features map file: "
- + e.getMessage() );
+ ForesterUtil.fatalError( surfacing_old.PRG_NAME,
+ "cannot read secondary features map file: " + e.getMessage() );
}
catch ( final Exception e ) {
ForesterUtil.fatalError( surfacing_old.PRG_NAME, "problem with contents of features map file ["
output_file = new File( out_dir + ForesterUtil.FILE_SEPARATOR + output_file );
}
SurfacingUtil.writeMatrixToFile( new File( matrix_output_file
- + surfacing_old.MATRIX_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getDomainDistanceScoresMeans() );
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file
- + surfacing_old.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedBinaryCombinationsBasedDistances() );
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file
- + surfacing_old.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedDomainsBasedDistances() );
+ + surfacing_old.MATRIX_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getDomainDistanceScoresMeans() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file
+ + surfacing_old.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedBinaryCombinationsBasedDistances() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file
+ + surfacing_old.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedDomainsBasedDistances() );
final Phylogeny nj_gd = SurfacingUtil.createNjTreeBasedOnMatrixToFile( new File( matrix_output_file
+ surfacing_old.NJ_TREE_MEAN_SCORE_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
.getDomainDistanceScoresMeans().get( 0 ) );
jacknife_resamplings,
jacknife_ratio,
random_seed );
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file + "_"
- + ForesterUtil.round( jacknife_ratio, 2 ) + "_" + jacknife_resamplings
- + surfacing_old.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedBinaryCombinationsBasedDistances() );
- SurfacingUtil.writeMatrixToFile( new File( matrix_output_file + "_"
- + ForesterUtil.round( jacknife_ratio, 2 ) + "_" + jacknife_resamplings
- + surfacing_old.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ), pwgc
- .getSharedDomainsBasedDistances() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file
+ + "_"
+ + ForesterUtil.round( jacknife_ratio, 2 )
+ + "_"
+ + jacknife_resamplings
+ + surfacing_old.MATRIX_SHARED_BIN_COMBINATIONS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedBinaryCombinationsBasedDistances() );
+ SurfacingUtil
+ .writeMatrixToFile( new File( matrix_output_file + "_" + ForesterUtil.round( jacknife_ratio, 2 )
+ + "_" + jacknife_resamplings
+ + surfacing_old.MATRIX_SHARED_DOMAINS_BASED_GENOME_DISTANCE_SUFFIX ),
+ pwgc.getSharedDomainsBasedDistances() );
// if ( infer_species_trees ) {
// inferSpeciesTrees( new File( output_file + "_" + jacknife_resamplings
// + INFERRED_SBC_BASED_NJ_SPECIES_TREE_SUFFIX ), pwgc
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
species_tree = factory.create( species_tree_file, pp )[ 0 ];
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( PRG_NAME, "Failed to read species tree from \"" + gene_tree_file + "\" ["
- + e.getMessage() + "]" );
+ ForesterUtil.fatalError( PRG_NAME,
+ "Failed to read species tree from \"" + gene_tree_file + "\" [" + e.getMessage()
+ + "]" );
}
try {
final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
gene_tree = factory.create( gene_tree_file, pp )[ 0 ];
}
catch ( final IOException e ) {
- ForesterUtil.fatalError( PRG_NAME, "Failed to read gene tree from \"" + gene_tree_file + "\" ["
- + e.getMessage() + "]" );
+ ForesterUtil.fatalError( PRG_NAME,
+ "Failed to read gene tree from \"" + gene_tree_file + "\" [" + e.getMessage()
+ + "]" );
}
gene_tree.setRooted( true );
species_tree.setRooted( true );
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
import org.forester.util.ForesterUtil;
-//
+//
// java -javaagent:shiftone-jrat.jar -cp
// $HOME/SOFTWARE_DEV/ECLIPSE_WORKSPACE/forester-atv/java/forester.jar:.
// org.forester.archaeopteryx.Archaeopteryx
}
else {
MainFrameApplication.createInstance( ParserBasedPhylogenyFactory.getInstance()
- .create( s, new PhyloXmlParser() ), conf, title );
+ .create( s, new PhyloXmlParser() ),
+ conf,
+ title );
}
}
// catch ( final IOException ex ) {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
private JMenuItem _overview_placment_mi;
private ButtonGroup _radio_group_1;
+ @Override
public void actionPerformed( final ActionEvent e ) {
final Object o = e.getSource();
if ( o == _midpoint_root_item ) {
_options_jmenu = MainFrame.createMenu( MainFrame.OPTIONS_HEADER, getConfiguration() );
_options_jmenu.addChangeListener( new ChangeListener() {
+ @Override
public void stateChanged( final ChangeEvent e ) {
MainFrame.setOvPlacementColorChooseMenuItem( _overview_placment_mi, getCurrentTreePanel() );
MainFrame.setTextColorChooseMenuItem( _switch_colors_mi, getCurrentTreePanel() );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_selector.setMaximumRowCount( list.size() );
_selector.getModel().addListDataListener( new ListDataListener() {
+ @Override
public void contentsChanged( final ListDataEvent e ) {
final int selection = _selector.getSelectedIndex();
changeDialogColors( selection );
}
+ @Override
public void intervalAdded( final ListDataEvent e ) {
// Not needed.
}
+ @Override
public void intervalRemoved( final ListDataEvent e ) {
// Not needed.
}
_ok_btn = new JButton( "OK" );
_ok_btn.addActionListener( new ActionListener() {
+ @Override
public void actionPerformed( final ActionEvent e ) {
ok();
}
_cancel_btn = new JButton( "Cancel" );
_cancel_btn.addActionListener( new ActionListener() {
+ @Override
public void actionPerformed( final ActionEvent e ) {
cancel();
}
setCurrentColor( colorset.getCurrentColorScheme() );
}
+ @Override
public void actionPerformed( final ActionEvent e ) {
// Not needed.
}
// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
}
else if ( key.equals( WEB_LINK_KEY ) ) {
if ( st.countTokens() == 3 ) {
- createWebLink( ( String ) st.nextElement(), ( String ) st.nextElement(), ( String ) st
- .nextElement() );
+ createWebLink( ( String ) st.nextElement(),
+ ( String ) st.nextElement(),
+ ( String ) st.nextElement() );
}
else {
ForesterUtil.printWarningMessage( Constants.PRG_NAME,
// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
/**
* Handle an action.
*/
+ @Override
public void actionPerformed( final ActionEvent e ) {
try {
final TreePanel tp = getMainPanel().getCurrentTreePanel();
add( horizGrid );
add( getSequenceRelationBox() );
if ( _configuration.doDisplayOption( Configuration.show_relation_confidence ) ) {
- addCheckbox( Configuration.show_relation_confidence, _configuration
- .getDisplayTitle( Configuration.show_relation_confidence ) );
- setCheckbox( Configuration.show_relation_confidence, _configuration
- .doCheckOption( Configuration.show_relation_confidence ) );
+ addCheckbox( Configuration.show_relation_confidence,
+ _configuration.getDisplayTitle( Configuration.show_relation_confidence ) );
+ setCheckbox( Configuration.show_relation_confidence,
+ _configuration.doCheckOption( Configuration.show_relation_confidence ) );
}
}// addSequenceRelationBlock
int cb_index = 0;
if ( _configuration.doDisplayClickToOption( Configuration.display_node_data ) ) {
_show_data_item = cb_index;
- addClickToOption( Configuration.display_node_data, _configuration
- .getClickToTitle( Configuration.display_node_data ) );
+ addClickToOption( Configuration.display_node_data,
+ _configuration.getClickToTitle( Configuration.display_node_data ) );
if ( default_option == Configuration.display_node_data ) {
selected_index = cb_index;
}
}
if ( _configuration.doDisplayClickToOption( Configuration.collapse_uncollapse ) ) {
_collapse_cb_item = cb_index;
- addClickToOption( Configuration.collapse_uncollapse, _configuration
- .getClickToTitle( Configuration.collapse_uncollapse ) );
+ addClickToOption( Configuration.collapse_uncollapse,
+ _configuration.getClickToTitle( Configuration.collapse_uncollapse ) );
if ( default_option == Configuration.collapse_uncollapse ) {
selected_index = cb_index;
}
}
if ( _configuration.doDisplayClickToOption( Configuration.copy_subtree ) ) {
_copy_subtree_item = cb_index;
- addClickToOption( Configuration.copy_subtree, _configuration
- .getClickToTitle( Configuration.copy_subtree ) );
+ addClickToOption( Configuration.copy_subtree,
+ _configuration.getClickToTitle( Configuration.copy_subtree ) );
if ( default_option == Configuration.copy_subtree ) {
selected_index = cb_index;
}
}
if ( _configuration.doDisplayClickToOption( Configuration.paste_subtree ) ) {
_paste_subtree_item = cb_index;
- addClickToOption( Configuration.paste_subtree, _configuration
- .getClickToTitle( Configuration.paste_subtree ) );
+ addClickToOption( Configuration.paste_subtree,
+ _configuration.getClickToTitle( Configuration.paste_subtree ) );
if ( default_option == Configuration.paste_subtree ) {
selected_index = cb_index;
}
}
if ( _configuration.doDisplayClickToOption( Configuration.delete_subtree_or_node ) ) {
_delete_node_or_subtree_item = cb_index;
- addClickToOption( Configuration.delete_subtree_or_node, _configuration
- .getClickToTitle( Configuration.delete_subtree_or_node ) );
+ addClickToOption( Configuration.delete_subtree_or_node,
+ _configuration.getClickToTitle( Configuration.delete_subtree_or_node ) );
if ( default_option == Configuration.delete_subtree_or_node ) {
selected_index = cb_index;
}
}
if ( _configuration.doDisplayClickToOption( Configuration.add_new_node ) ) {
_add_new_node_item = cb_index;
- addClickToOption( Configuration.add_new_node, _configuration
- .getClickToTitle( Configuration.add_new_node ) );
+ addClickToOption( Configuration.add_new_node,
+ _configuration.getClickToTitle( Configuration.add_new_node ) );
if ( default_option == Configuration.add_new_node ) {
selected_index = cb_index;
}
}
if ( _configuration.doDisplayClickToOption( Configuration.edit_node_data ) ) {
_edit_node_data_item = cb_index;
- addClickToOption( Configuration.edit_node_data, _configuration
- .getClickToTitle( Configuration.edit_node_data ) );
+ addClickToOption( Configuration.edit_node_data,
+ _configuration.getClickToTitle( Configuration.edit_node_data ) );
if ( default_option == Configuration.edit_node_data ) {
selected_index = cb_index;
}
private void setupDisplayCheckboxes() {
if ( _configuration.doDisplayOption( Configuration.display_as_phylogram ) ) {
- addCheckbox( Configuration.display_as_phylogram, _configuration
- .getDisplayTitle( Configuration.display_as_phylogram ) );
- setCheckbox( Configuration.display_as_phylogram, _configuration
- .doCheckOption( Configuration.display_as_phylogram ) );
+ addCheckbox( Configuration.display_as_phylogram,
+ _configuration.getDisplayTitle( Configuration.display_as_phylogram ) );
+ setCheckbox( Configuration.display_as_phylogram,
+ _configuration.doCheckOption( Configuration.display_as_phylogram ) );
}
if ( _configuration.doDisplayOption( Configuration.dynamically_hide_data ) ) {
- addCheckbox( Configuration.dynamically_hide_data, _configuration
- .getDisplayTitle( Configuration.dynamically_hide_data ) );
- setCheckbox( Configuration.dynamically_hide_data, _configuration
- .doCheckOption( Configuration.dynamically_hide_data ) );
+ addCheckbox( Configuration.dynamically_hide_data,
+ _configuration.getDisplayTitle( Configuration.dynamically_hide_data ) );
+ setCheckbox( Configuration.dynamically_hide_data,
+ _configuration.doCheckOption( Configuration.dynamically_hide_data ) );
}
if ( _configuration.doDisplayOption( Configuration.node_data_popup ) ) {
addCheckbox( Configuration.node_data_popup, _configuration.getDisplayTitle( Configuration.node_data_popup ) );
setCheckbox( Configuration.node_data_popup, _configuration.doCheckOption( Configuration.node_data_popup ) );
}
if ( _configuration.doDisplayOption( Configuration.display_internal_data ) ) {
- addCheckbox( Configuration.display_internal_data, _configuration
- .getDisplayTitle( Configuration.display_internal_data ) );
- setCheckbox( Configuration.display_internal_data, _configuration
- .doCheckOption( Configuration.display_internal_data ) );
+ addCheckbox( Configuration.display_internal_data,
+ _configuration.getDisplayTitle( Configuration.display_internal_data ) );
+ setCheckbox( Configuration.display_internal_data,
+ _configuration.doCheckOption( Configuration.display_internal_data ) );
}
if ( _configuration.doDisplayOption( Configuration.color_according_to_species ) ) {
- addCheckbox( Configuration.color_according_to_species, _configuration
- .getDisplayTitle( Configuration.color_according_to_species ) );
- setCheckbox( Configuration.color_according_to_species, _configuration
- .doCheckOption( Configuration.color_according_to_species ) );
+ addCheckbox( Configuration.color_according_to_species,
+ _configuration.getDisplayTitle( Configuration.color_according_to_species ) );
+ setCheckbox( Configuration.color_according_to_species,
+ _configuration.doCheckOption( Configuration.color_according_to_species ) );
}
if ( _configuration.doDisplayOption( Configuration.color_according_to_annotation ) ) {
- addCheckbox( Configuration.color_according_to_annotation, _configuration
- .getDisplayTitle( Configuration.color_according_to_annotation ) );
- setCheckbox( Configuration.color_according_to_annotation, _configuration
- .doCheckOption( Configuration.color_according_to_annotation ) );
+ addCheckbox( Configuration.color_according_to_annotation,
+ _configuration.getDisplayTitle( Configuration.color_according_to_annotation ) );
+ setCheckbox( Configuration.color_according_to_annotation,
+ _configuration.doCheckOption( Configuration.color_according_to_annotation ) );
}
if ( _configuration.doDisplayOption( Configuration.color_branches ) ) {
addCheckbox( Configuration.color_branches, _configuration.getDisplayTitle( Configuration.color_branches ) );
setCheckbox( Configuration.show_tax_code, _configuration.doCheckOption( Configuration.show_tax_code ) );
}
if ( _configuration.doDisplayOption( Configuration.show_taxonomy_scientific_names ) ) {
- addCheckbox( Configuration.show_taxonomy_scientific_names, _configuration
- .getDisplayTitle( Configuration.show_taxonomy_scientific_names ) );
- setCheckbox( Configuration.show_taxonomy_scientific_names, _configuration
- .doCheckOption( Configuration.show_taxonomy_scientific_names ) );
+ addCheckbox( Configuration.show_taxonomy_scientific_names,
+ _configuration.getDisplayTitle( Configuration.show_taxonomy_scientific_names ) );
+ setCheckbox( Configuration.show_taxonomy_scientific_names,
+ _configuration.doCheckOption( Configuration.show_taxonomy_scientific_names ) );
}
if ( _configuration.doDisplayOption( Configuration.show_taxonomy_common_names ) ) {
- addCheckbox( Configuration.show_taxonomy_common_names, _configuration
- .getDisplayTitle( Configuration.show_taxonomy_common_names ) );
- setCheckbox( Configuration.show_taxonomy_common_names, _configuration
- .doCheckOption( Configuration.show_taxonomy_common_names ) );
+ addCheckbox( Configuration.show_taxonomy_common_names,
+ _configuration.getDisplayTitle( Configuration.show_taxonomy_common_names ) );
+ setCheckbox( Configuration.show_taxonomy_common_names,
+ _configuration.doCheckOption( Configuration.show_taxonomy_common_names ) );
}
if ( _configuration.doDisplayOption( Configuration.show_taxonomy_images ) ) {
- addCheckbox( Configuration.show_taxonomy_images, _configuration
- .getDisplayTitle( Configuration.show_taxonomy_images ) );
- setCheckbox( Configuration.show_taxonomy_images, _configuration
- .doCheckOption( Configuration.show_taxonomy_images ) );
+ addCheckbox( Configuration.show_taxonomy_images,
+ _configuration.getDisplayTitle( Configuration.show_taxonomy_images ) );
+ setCheckbox( Configuration.show_taxonomy_images,
+ _configuration.doCheckOption( Configuration.show_taxonomy_images ) );
}
if ( _configuration.doDisplayOption( Configuration.show_gene_symbols ) ) {
- addCheckbox( Configuration.show_gene_symbols, _configuration
- .getDisplayTitle( Configuration.show_gene_symbols ) );
- setCheckbox( Configuration.show_gene_symbols, _configuration
- .doCheckOption( Configuration.show_gene_symbols ) );
+ addCheckbox( Configuration.show_gene_symbols,
+ _configuration.getDisplayTitle( Configuration.show_gene_symbols ) );
+ setCheckbox( Configuration.show_gene_symbols,
+ _configuration.doCheckOption( Configuration.show_gene_symbols ) );
}
if ( _configuration.doDisplayOption( Configuration.show_gene_names ) ) {
addCheckbox( Configuration.show_gene_names, _configuration.getDisplayTitle( Configuration.show_gene_names ) );
setCheckbox( Configuration.show_gene_names, _configuration.doCheckOption( Configuration.show_gene_names ) );
}
if ( _configuration.doDisplayOption( Configuration.show_sequence_acc ) ) {
- addCheckbox( Configuration.show_sequence_acc, _configuration
- .getDisplayTitle( Configuration.show_sequence_acc ) );
- setCheckbox( Configuration.show_sequence_acc, _configuration
- .doCheckOption( Configuration.show_sequence_acc ) );
+ addCheckbox( Configuration.show_sequence_acc,
+ _configuration.getDisplayTitle( Configuration.show_sequence_acc ) );
+ setCheckbox( Configuration.show_sequence_acc,
+ _configuration.doCheckOption( Configuration.show_sequence_acc ) );
}
if ( _configuration.doDisplayOption( Configuration.show_annotation ) ) {
addCheckbox( Configuration.show_annotation, _configuration.getDisplayTitle( Configuration.show_annotation ) );
setCheckbox( Configuration.show_annotation, _configuration.doCheckOption( Configuration.show_annotation ) );
}
if ( _configuration.doDisplayOption( Configuration.show_binary_characters ) ) {
- addCheckbox( Configuration.show_binary_characters, _configuration
- .getDisplayTitle( Configuration.show_binary_characters ) );
- setCheckbox( Configuration.show_binary_characters, _configuration
- .doCheckOption( Configuration.show_binary_characters ) );
+ addCheckbox( Configuration.show_binary_characters,
+ _configuration.getDisplayTitle( Configuration.show_binary_characters ) );
+ setCheckbox( Configuration.show_binary_characters,
+ _configuration.doCheckOption( Configuration.show_binary_characters ) );
}
if ( _configuration.doDisplayOption( Configuration.show_binary_character_counts ) ) {
- addCheckbox( Configuration.show_binary_character_counts, _configuration
- .getDisplayTitle( Configuration.show_binary_character_counts ) );
- setCheckbox( Configuration.show_binary_character_counts, _configuration
- .doCheckOption( Configuration.show_binary_character_counts ) );
+ addCheckbox( Configuration.show_binary_character_counts,
+ _configuration.getDisplayTitle( Configuration.show_binary_character_counts ) );
+ setCheckbox( Configuration.show_binary_character_counts,
+ _configuration.doCheckOption( Configuration.show_binary_character_counts ) );
}
if ( _configuration.doDisplayOption( Configuration.show_domain_architectures ) ) {
- addCheckbox( Configuration.show_domain_architectures, _configuration
- .getDisplayTitle( Configuration.show_domain_architectures ) );
- setCheckbox( Configuration.show_domain_architectures, _configuration
- .doCheckOption( Configuration.show_domain_architectures ) );
+ addCheckbox( Configuration.show_domain_architectures,
+ _configuration.getDisplayTitle( Configuration.show_domain_architectures ) );
+ setCheckbox( Configuration.show_domain_architectures,
+ _configuration.doCheckOption( Configuration.show_domain_architectures ) );
}
if ( _configuration.doDisplayOption( Configuration.write_confidence_values ) ) {
- addCheckbox( Configuration.write_confidence_values, _configuration
- .getDisplayTitle( Configuration.write_confidence_values ) );
- setCheckbox( Configuration.write_confidence_values, _configuration
- .doCheckOption( Configuration.write_confidence_values ) );
+ addCheckbox( Configuration.write_confidence_values,
+ _configuration.getDisplayTitle( Configuration.write_confidence_values ) );
+ setCheckbox( Configuration.write_confidence_values,
+ _configuration.doCheckOption( Configuration.write_confidence_values ) );
}
if ( _configuration.doDisplayOption( Configuration.write_events ) ) {
addCheckbox( Configuration.write_events, _configuration.getDisplayTitle( Configuration.write_events ) );
setCheckbox( Configuration.write_events, _configuration.doCheckOption( Configuration.write_events ) );
}
if ( _configuration.doDisplayOption( Configuration.show_vector_data ) ) {
- addCheckbox( Configuration.show_vector_data, _configuration
- .getDisplayTitle( Configuration.show_vector_data ) );
+ addCheckbox( Configuration.show_vector_data,
+ _configuration.getDisplayTitle( Configuration.show_vector_data ) );
setCheckbox( Configuration.show_vector_data, _configuration.doCheckOption( Configuration.show_vector_data ) );
}
}
for( final TreePanel tree_panel : _mainpanel.getTreePanels() ) {
if ( tree_panel != null ) {
tree_panel.validate();
- tree_panel.setParametersForPainting( _mainpanel.getSizeOfViewport().width, _mainpanel
- .getSizeOfViewport().height, true );
+ tree_panel.setParametersForPainting( _mainpanel.getSizeOfViewport().width,
+ _mainpanel.getSizeOfViewport().height,
+ true );
tree_panel.resetPreferredSize();
tree_panel.repaint();
}
this( new Font( font_name, font_style, size ) );
}
+ @Override
public void actionPerformed( final ActionEvent e ) {
if ( e.getSource() == _fonts_tf ) {
boolean found = false;
return _option;
}
+ @Override
public void valueChanged( final ListSelectionEvent e ) {
if ( e.getSource() == _font_list ) {
if ( _font_list.getSelectedValue() != null ) {
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Copyright (C) 2008-2010 Christian M. Zmasek
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
options.setAntialiasPrint( ( _antialias_print_cbmi != null ) && _antialias_print_cbmi.isSelected() );
options.setPrintBlackAndWhite( ( _print_black_and_white_cbmi != null )
&& _print_black_and_white_cbmi.isSelected() );
- options
- .setInternalNumberAreConfidenceForNhParsing( ( _internal_number_are_confidence_for_nh_parsing_cbmi != null )
- && _internal_number_are_confidence_for_nh_parsing_cbmi.isSelected() );
+ options.setInternalNumberAreConfidenceForNhParsing( ( _internal_number_are_confidence_for_nh_parsing_cbmi != null )
+ && _internal_number_are_confidence_for_nh_parsing_cbmi.isSelected() );
options.setExtractPfamTaxonomyCodesInNhParsing( ( _extract_pfam_style_tax_codes_cbmi != null )
&& _extract_pfam_style_tax_codes_cbmi.isSelected() );
options.setReplaceUnderscoresInNhParsing( ( _replace_underscores_cbmi != null )
sb.append( "Mouse wheel+Ctrl changes the text size.\n" );
sb.append( "Mouse wheel+Shift controls zooming in vertical direction only.\n" );
sb.append( "Use the buttons on the control panel to zoom the tree in and out, horizontally or vertically.\n" );
- sb
- .append( "The entire tree can be fitted into the window by clicking the \"F\" button, or by pressing F, Delete, or Home.\n" );
+ sb.append( "The entire tree can be fitted into the window by clicking the \"F\" button, or by pressing F, Delete, or Home.\n" );
sb.append( "The up, down, left, and right keys can be used to move the visible part (if zoomed in).\n" );
sb.append( "Up, down, left, and right+Shift can be used to control zooming horizontally and vertically.\n" );
sb.append( "Plus and minus keys+Ctrl change the text size; F+Ctrl, Delete+Ctrl, or Home+Ctrl resets it.\n\n" );
sb.append( "Memory problems (Java heap space error)\n" );
sb.append( "---------------------------------------\n" );
sb.append( "Since the Java default memory allocation is quite small, it might by necessary (for trees\n" );
- sb
- .append( "with more than approximately 5000 external nodes) to increase the memory which Java can use, with\n" );
+ sb.append( "with more than approximately 5000 external nodes) to increase the memory which Java can use, with\n" );
sb.append( "the '-Xmx' Java command line option. For example:\n" );
sb.append( "java -Xms32m -Xmx256m -cp path\\to\\forester.jar org.forester.archaeopteryx.Archaeopteryx\n\n" );
if ( ( weblinks != null ) && ( weblinks.size() > 0 ) ) {
// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
catch ( final Exception e ) {
ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, e.toString() );
e.printStackTrace();
- JOptionPane
- .showMessageDialog( this,
- ArchaeopteryxA.NAME + ": Could not create URL from: \""
- + _applet.getUrlString() + "\"\nError: " + e,
- "Failed to create URL",
- JOptionPane.ERROR_MESSAGE );
+ JOptionPane.showMessageDialog( this,
+ ArchaeopteryxA.NAME + ": Could not create URL from: \""
+ + _applet.getUrlString() + "\"\nError: " + e,
+ "Failed to create URL",
+ JOptionPane.ERROR_MESSAGE );
close();
}
}
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import org.forester.util.BasicTableParser;
import org.forester.util.DescriptiveStatistics;
import org.forester.util.ForesterUtil;
-import org.forester.util.WindowsUtils;
import org.forester.util.ForesterUtil.PhylogenyNodeField;
import org.forester.util.ForesterUtil.TAXONOMY_EXTRACTION;
+import org.forester.util.WindowsUtils;
class DefaultFilter extends FileFilter {
if ( ( _mainpanel.getCurrentPhylogeny() == null ) || ( _mainpanel.getCurrentPhylogeny().isEmpty() ) ) {
return;
}
- final MainPanelEdit a = new MainPanelEdit( this, _mainpanel.getCurrentTreePanel(), _mainpanel
- .getCurrentPhylogeny() );
+ final MainPanelEdit a = new MainPanelEdit( this,
+ _mainpanel.getCurrentTreePanel(),
+ _mainpanel.getCurrentPhylogeny() );
new Thread( a ).start();
}
return;
}
final Phylogeny phy = _mainpanel.getCurrentPhylogeny().copy();
- final AncestralTaxonomyInferrer inferrer = new AncestralTaxonomyInferrer( this, _mainpanel
- .getCurrentTreePanel(), phy );
+ final AncestralTaxonomyInferrer inferrer = new AncestralTaxonomyInferrer( this,
+ _mainpanel.getCurrentTreePanel(),
+ phy );
new Thread( inferrer ).start();
}
if ( getMsa() != null ) {
final PhylogeneticInferrer inferrer = new PhylogeneticInferrer( getMsa(),
getPhylogeneticInferenceOptions()
- .copy(),
- this );
+ .copy(), this );
new Thread( inferrer ).start();
}
else {
if ( getSeqs() != null ) {
final PhylogeneticInferrer inferrer = new PhylogeneticInferrer( getSeqs(),
getPhylogeneticInferenceOptions()
- .copy(),
- this );
+ .copy(), this );
new Thread( inferrer ).start();
}
else {
if ( getCurrentTreePanel() != null ) {
final Phylogeny phy = getCurrentTreePanel().getPhylogeny();
if ( ( phy != null ) && !phy.isEmpty() ) {
- final TaxonomyDataObtainer t = new TaxonomyDataObtainer( this, _mainpanel.getCurrentTreePanel(), phy
- .copy() );
+ final TaxonomyDataObtainer t = new TaxonomyDataObtainer( this,
+ _mainpanel.getCurrentTreePanel(),
+ phy.copy() );
new Thread( t ).start();
}
}
ForesterUtil.transferInternalNodeNamesToConfidence( phy );
}
}
- Util.addPhylogeniesToTabs( phys, new File( url.getFile() ).getName(), new File( url.getFile() )
- .toString(), getConfiguration(), getMainPanel() );
+ Util.addPhylogeniesToTabs( phys,
+ new File( url.getFile() ).getName(),
+ new File( url.getFile() ).toString(),
+ getConfiguration(),
+ getMainPanel() );
_mainpanel.getControlPanel().showWhole();
}
}
public boolean accept( final File f ) {
final String file_name = f.getName().trim().toLowerCase();
return ( file_name.endsWith( ".tol" ) || file_name.endsWith( ".tolxml" ) || file_name.endsWith( ".zip" ) || f
- .isDirectory() )
- && ( !file_name.endsWith( ".xml.zip" ) );
+ .isDirectory() ) && ( !file_name.endsWith( ".xml.zip" ) );
}
@Override
// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_tabbed_pane.addChangeListener( new ChangeListener() {
// This method is called whenever the selected tab changes
+ @Override
public void stateChanged( final ChangeEvent evt ) {
final JTabbedPane pane = ( JTabbedPane ) evt.getSource();
getControlPanel().tabChanged();
// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
if ( ( node.getNodeData().getSequences() != null ) && !node.getNodeData().getSequences().isEmpty() ) {
for( final Sequence seq : node.getNodeData().getSequences() ) {
if ( ( ( seq.getAccession() != null ) && !ForesterUtil.isEmpty( seq.getAccession().getValue() ) && ( seq
- .getAnnotations() == null ) )
- || seq.getAnnotations().isEmpty() ) {
+ .getAnnotations() == null ) ) || seq.getAnnotations().isEmpty() ) {
final Accession acc = seq.getAccession();
try {
final URL url = new URL( "http://www.ebi.ac.uk/QuickGO/GAnnotation?protein="
+ acc.getValue() + "&format=tsv" );
final HttpURLConnection url_connection = ( HttpURLConnection ) url.openConnection();
- final BufferedReader br = new BufferedReader( new InputStreamReader( url_connection
- .getInputStream() ) );
+ final BufferedReader br = new BufferedReader( new InputStreamReader( url_connection.getInputStream() ) );
final List<String> columns = Arrays.asList( br.readLine().split( "\t" ) );
System.out.println( columns );
final int db_index = columns.indexOf( DB );
// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
category = new DefaultMutableTreeNode( name );
top.add( category );
addSubelementEditable( category, NodePanel.DATE_DESCRIPTION, date.getDesc(), PHYLOXML_TAG.DATE_DESCRIPTION );
- addSubelementEditable( category, NodePanel.DATE_VALUE, String.valueOf( date.getValue() != null ? date
- .getValue() : "" ), PHYLOXML_TAG.DATE_VALUE );
- addSubelementEditable( category, NodePanel.DATE_MIN, String
- .valueOf( date.getMin() != null ? date.getMin() : "" ), PHYLOXML_TAG.DATE_MIN );
- addSubelementEditable( category, NodePanel.DATE_MAX, String
- .valueOf( date.getMax() != null ? date.getMax() : "" ), PHYLOXML_TAG.DATE_MAX );
+ addSubelementEditable( category,
+ NodePanel.DATE_VALUE,
+ String.valueOf( date.getValue() != null ? date.getValue() : "" ),
+ PHYLOXML_TAG.DATE_VALUE );
+ addSubelementEditable( category,
+ NodePanel.DATE_MIN,
+ String.valueOf( date.getMin() != null ? date.getMin() : "" ),
+ PHYLOXML_TAG.DATE_MIN );
+ addSubelementEditable( category,
+ NodePanel.DATE_MAX,
+ String.valueOf( date.getMax() != null ? date.getMax() : "" ),
+ PHYLOXML_TAG.DATE_MAX );
addSubelementEditable( category, NodePanel.DATE_UNIT, date.getUnit(), PHYLOXML_TAG.DATE_UNIT );
}
NodePanel.DIST_GEODETIC_DATUM,
p0.getGeodeticDatum(),
PHYLOXML_TAG.DIST_GEODETIC );
- addSubelementEditable( category, NodePanel.DIST_LATITUDE, String.valueOf( p0.getLatitude() != null ? p0
- .getLatitude() : "" ), PHYLOXML_TAG.DIST_LAT );
- addSubelementEditable( category, NodePanel.DIST_LONGITUDE, String.valueOf( p0.getLongitude() != null ? p0
- .getLongitude() : "" ), PHYLOXML_TAG.DIST_LONG );
- addSubelementEditable( category, NodePanel.DIST_ALTITUDE, String.valueOf( p0.getAltitude() != null ? p0
- .getAltitude() : "" ), PHYLOXML_TAG.DIST_ALT );
- addSubelementEditable( category, NodePanel.DIST_ALT_UNIT, String.valueOf( p0.getAltiudeUnit() != null ? p0
- .getAltiudeUnit() : "" ), PHYLOXML_TAG.DIST_ALT_UNIT );
+ addSubelementEditable( category,
+ NodePanel.DIST_LATITUDE,
+ String.valueOf( p0.getLatitude() != null ? p0.getLatitude() : "" ),
+ PHYLOXML_TAG.DIST_LAT );
+ addSubelementEditable( category,
+ NodePanel.DIST_LONGITUDE,
+ String.valueOf( p0.getLongitude() != null ? p0.getLongitude() : "" ),
+ PHYLOXML_TAG.DIST_LONG );
+ addSubelementEditable( category,
+ NodePanel.DIST_ALTITUDE,
+ String.valueOf( p0.getAltitude() != null ? p0.getAltitude() : "" ),
+ PHYLOXML_TAG.DIST_ALT );
+ addSubelementEditable( category,
+ NodePanel.DIST_ALT_UNIT,
+ String.valueOf( p0.getAltiudeUnit() != null ? p0.getAltiudeUnit() : "" ),
+ PHYLOXML_TAG.DIST_ALT_UNIT );
}
private void addEvents( final DefaultMutableTreeNode top, Event events, final String name ) {
PHYLOXML_TAG.EVENTS_SPECIATIONS );
addSubelementEditable( category,
NodePanel.EVENTS_GENE_LOSSES,
- String
- .valueOf( events.getNumberOfGeneLosses() >= 0 ? events.getNumberOfGeneLosses()
- : 0 ),
+ String.valueOf( events.getNumberOfGeneLosses() >= 0 ? events.getNumberOfGeneLosses() : 0 ),
PHYLOXML_TAG.EVENTS_GENE_LOSSES );
}
p.getLatitude(),
p.getLongitude(),
new_value,
- ForesterUtil.isEmpty( p.getAltiudeUnit() ) ? "?" : p
- .getAltiudeUnit() );
+ ForesterUtil.isEmpty( p.getAltiudeUnit() ) ? "?"
+ : p.getAltiudeUnit() );
ps.set( 0, p_new );
}
break;
if ( !ForesterUtil.isEmpty( value ) ) {
final List<Point> ps = obtainPoints();
final Point p = ps.get( 0 );
- final Point p_new = new Point( value, p.getLatitude(), p.getLongitude(), p.getAltitude(), p
- .getAltiudeUnit() );
+ final Point p_new = new Point( value,
+ p.getLatitude(),
+ p.getLongitude(),
+ p.getAltitude(),
+ p.getAltiudeUnit() );
ps.set( 0, p_new );
}
break;
if ( !ForesterUtil.isEmpty( value ) ) {
final List<Point> ps = obtainPoints();
final Point p = ps.get( 0 );
- final Point p_new = new Point( p.getGeodeticDatum(), p.getLatitude(), p.getLongitude(), p
- .getAltitude(), value );
+ final Point p_new = new Point( p.getGeodeticDatum(),
+ p.getLatitude(),
+ p.getLongitude(),
+ p.getAltitude(),
+ value );
ps.set( 0, p_new );
}
break;
if ( new_value != null ) {
final List<Point> ps = obtainPoints();
final Point p = ps.get( 0 );
- final Point p_new = new Point( p.getGeodeticDatum(), p.getLatitude(), new_value, p.getAltitude(), p
- .getAltiudeUnit() );
+ final Point p_new = new Point( p.getGeodeticDatum(),
+ p.getLatitude(),
+ new_value,
+ p.getAltitude(),
+ p.getAltiudeUnit() );
ps.set( 0, p_new );
}
break;
// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
top.add( category );
addSubelement( category, NODE_NAME, phylogeny_node.getName() );
if ( phylogeny_node.getDistanceToParent() != PhylogenyNode.DISTANCE_DEFAULT ) {
- addSubelement( category, NODE_BRANCH_LENGTH, ForesterUtil.FORMATTER_6.format( phylogeny_node
- .getDistanceToParent() ) );
+ addSubelement( category,
+ NODE_BRANCH_LENGTH,
+ ForesterUtil.FORMATTER_6.format( phylogeny_node.getDistanceToParent() ) );
}
if ( phylogeny_node.getBranchData().isHasConfidences() ) {
for( final PhylogenyData conf : phylogeny_node.getBranchData().getConfidences() ) {
}
if ( !phylogeny_node.isExternal() ) {
addSubelement( category, "Children", String.valueOf( phylogeny_node.getNumberOfDescendants() ) );
- addSubelement( category, "External children", String.valueOf( phylogeny_node.getAllExternalDescendants()
- .size() ) );
+ addSubelement( category,
+ "External children",
+ String.valueOf( phylogeny_node.getAllExternalDescendants().size() ) );
final SortedMap<Taxonomy, Integer> distinct_tax = PhylogenyMethods
.obtainDistinctTaxonomyCounts( phylogeny_node );
if ( distinct_tax != null ) {
// Copyright (C) 2009 Christian M. Zmasek
// Copyright (C) 2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
setResizable( false );
}
+ @Override
public void actionPerformed( final ActionEvent e ) {
if ( e.getSource() == _select_input_msa_btn ) {
readInputFile();
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
msa = inferMsa();
}
catch ( final IOException e ) {
- JOptionPane.showMessageDialog( _mf, "Could not create multiple sequence alignment with "
- + _options.getMsaPrg() + "\nand the following parameters:\n\"" + _options.getMsaPrgParameters()
- + "\"\nError:" + e.getLocalizedMessage(), "Failed to Calculate MSA", JOptionPane.ERROR_MESSAGE );
+ JOptionPane.showMessageDialog( _mf,
+ "Could not create multiple sequence alignment with "
+ + _options.getMsaPrg() + "\nand the following parameters:\n\""
+ + _options.getMsaPrgParameters() + "\"\nError:"
+ + e.getLocalizedMessage(),
+ "Failed to Calculate MSA",
+ JOptionPane.ERROR_MESSAGE );
return;
}
if ( msa == null ) {
- JOptionPane.showMessageDialog( _mf, "Could not create multiple sequence alignment with "
- + _options.getMsaPrg() + "\nand the following parameters:\n\"" + _options.getMsaPrgParameters()
- + "\"", "Failed to Calculate MSA", JOptionPane.ERROR_MESSAGE );
+ JOptionPane.showMessageDialog( _mf,
+ "Could not create multiple sequence alignment with "
+ + _options.getMsaPrg() + "\nand the following parameters:\n\""
+ + _options.getMsaPrgParameters() + "\"",
+ "Failed to Calculate MSA",
+ JOptionPane.ERROR_MESSAGE );
return;
}
System.out.println( msa.toString() );
System.out.println( MsaTools.calcBasicGapinessStatistics( msa ).toString() );
final MsaTools msa_tools = MsaTools.createInstance();
if ( _options.isExecuteMsaProcessing() ) {
- msa = msa_tools.removeGapColumns( _options.getMsaProcessingMaxAllowedGapRatio(), _options
- .getMsaProcessingMinAllowedLength(), msa );
+ msa = msa_tools.removeGapColumns( _options.getMsaProcessingMaxAllowedGapRatio(),
+ _options.getMsaProcessingMinAllowedLength(),
+ msa );
if ( msa == null ) {
JOptionPane.showMessageDialog( _mf,
"Less than two sequences longer than "
private void writeToFiles( final BasicSymmetricalDistanceMatrix m ) {
if ( !ForesterUtil.isEmpty( _options.getIntermediateFilesBase() ) ) {
try {
- final BufferedWriter msa_writer = new BufferedWriter( new FileWriter( _options
- .getIntermediateFilesBase()
+ final BufferedWriter msa_writer = new BufferedWriter( new FileWriter( _options.getIntermediateFilesBase()
+ MSA_FILE_SUFFIX ) );
_msa.write( msa_writer );
msa_writer.close();
- final BufferedWriter pwd_writer = new BufferedWriter( new FileWriter( _options
- .getIntermediateFilesBase()
+ final BufferedWriter pwd_writer = new BufferedWriter( new FileWriter( _options.getIntermediateFilesBase()
+ PWD_FILE_SUFFIX ) );
m.write( pwd_writer );
pwd_writer.close();
// Copyright (C) 2009-2010 Christian M. Zmasek
// Copyright (C) 2009-2010 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
setVisible( true );
}
+ @Override
public void actionPerformed( final ActionEvent e ) {
final Object o = e.getSource();
if ( o == close_button ) {
sys_clipboard.setContents( contents, this );
}
+ @Override
public void lostOwnership( final Clipboard clipboard, final Transferable contents ) {
}
// Copyright (C) 2008-2010 Burnham Institute for Medical Research
// Copyright (C) 2003-2010 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// and Howard Hughes Medical Institute
// Copyright (C) 2003-2007 Ethalinda K.S. Cannon
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
private static final float HALF_PI = ( float ) ( Math.PI / 2.0 );
private static final float ANGLE_ROTATION_UNIT = ( float ) ( Math.PI / 32 );
private static final short OV_BORDER = 10;
- final static Cursor CUT_CURSOR = Cursor
- .getPredefinedCursor( Cursor.CROSSHAIR_CURSOR );
- final static Cursor MOVE_CURSOR = Cursor
- .getPredefinedCursor( Cursor.MOVE_CURSOR );
- final static Cursor ARROW_CURSOR = Cursor
- .getPredefinedCursor( Cursor.DEFAULT_CURSOR );
- final static Cursor HAND_CURSOR = Cursor
- .getPredefinedCursor( Cursor.HAND_CURSOR );
- final static Cursor WAIT_CURSOR = Cursor
- .getPredefinedCursor( Cursor.WAIT_CURSOR );
+ final static Cursor CUT_CURSOR = Cursor.getPredefinedCursor( Cursor.CROSSHAIR_CURSOR );
+ final static Cursor MOVE_CURSOR = Cursor.getPredefinedCursor( Cursor.MOVE_CURSOR );
+ final static Cursor ARROW_CURSOR = Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR );
+ final static Cursor HAND_CURSOR = Cursor.getPredefinedCursor( Cursor.HAND_CURSOR );
+ final static Cursor WAIT_CURSOR = Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR );
private final static long serialVersionUID = -978349745916505029L;
private final static int EURO_D = 10;
private final static String NODE_POPMENU_NODE_CLIENT_PROPERTY = "node";
private JTextArea _rollover_popup;
//private final short _skip_counter = 0;
private final StringBuffer _popup_buffer = new StringBuffer();
- final private static Font POPUP_FONT = new Font( Configuration
- .getDefaultFontFamilyName(),
+ final private static Font POPUP_FONT = new Font( Configuration.getDefaultFontFamilyName(),
Font.PLAIN,
12 );
private static final boolean DRAW_MEAN_COUNTS = true; //TODO remove me later
final double r2 = 2.0 * parent_radius;
drawArc( root_x - parent_radius, root_y - parent_radius, r2, r2, ( -angle - arc ), arc, g );
}
- drawLine( c.getXcoord(), c.getYcoord(), root_x + ( Math.cos( angle ) * parent_radius ), root_y
- + ( Math.sin( angle ) * parent_radius ), g );
+ drawLine( c.getXcoord(),
+ c.getYcoord(),
+ root_x + ( Math.cos( angle ) * parent_radius ),
+ root_y + ( Math.sin( angle ) * parent_radius ),
+ g );
paintNodeBox( c.getXcoord(), c.getYcoord(), c, g, to_pdf, to_graphics_file, isInFoundNodes( c ) );
if ( c.isExternal() ) {
final boolean is_in_found_nodes = isInFoundNodes( c );
final double r2 = 2.0 * parent_radius;
drawArc( root_x - parent_radius, root_y - parent_radius, r2, r2, ( -angle - arc ), arc, g );
}
- drawLine( c.getXSecondary(), c.getYSecondary(), root_x + ( Math.cos( angle ) * parent_radius ), root_y
- + ( Math.sin( angle ) * parent_radius ), g );
+ drawLine( c.getXSecondary(),
+ c.getYSecondary(),
+ root_x + ( Math.cos( angle ) * parent_radius ),
+ root_y + ( Math.sin( angle ) * parent_radius ),
+ g );
if ( isInFoundNodes( c ) ) {
g.setColor( getTreeColorSet().getFoundColor() );
drawRectFilled( c.getXSecondary() - 1, c.getYSecondary() - 1, 3, 3, g );
if ( !node.isRoot() ) {
if ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.EURO_STYLE ) {
TreePanel.drawString( FORMATTER_BRANCH_LENGTH.format( node.getDistanceToParent() ), node.getParent()
- .getXcoord()
- + EURO_D, node.getYcoord() - getTreeFontSet()._small_max_descent, g );
+ .getXcoord() + EURO_D, node.getYcoord() - getTreeFontSet()._small_max_descent, g );
}
else if ( getPhylogenyGraphicsType() == PHYLOGENY_GRAPHICS_TYPE.ROUNDED ) {
TreePanel.drawString( FORMATTER_BRANCH_LENGTH.format( node.getDistanceToParent() ), node.getParent()
- .getXcoord()
- + ROUNDED_D, node.getYcoord() - getTreeFontSet()._small_max_descent, g );
+ .getXcoord() + ROUNDED_D, node.getYcoord() - getTreeFontSet()._small_max_descent, g );
}
else {
TreePanel.drawString( FORMATTER_BRANCH_LENGTH.format( node.getDistanceToParent() ), node.getParent()
boolean draw_vertical = true;
final PhylogenyNode parent = node.getParent();
if ( ( ( getOptions().isShowNodeBoxes() && !to_pdf && !to_graphics_file ) || ( ( getControlPanel()
- .isEvents() )
- && ( parent != null ) && parent.isHasAssignedEvent() ) )
+ .isEvents() ) && ( parent != null ) && parent.isHasAssignedEvent() ) )
&& ( _phylogeny.isRooted() || !( ( parent != null ) && parent.isRoot() ) )
&& !( ( to_pdf || to_graphics_file ) && getOptions().isPrintBlackAndWhite() && !parent
.isDuplication() ) ) {
d = BOX_SIZE;
}
_polygon.reset();
- _polygon.addPoint( ForesterUtil.roundToInt( node.getXcoord() - TreePanel.BOX_SIZE ), ForesterUtil
- .roundToInt( node.getYcoord() ) );
- _polygon.addPoint( ForesterUtil.roundToInt( node.getXcoord() + TreePanel.BOX_SIZE ), ForesterUtil
- .roundToInt( node.getYcoord() - d ) );
- _polygon.addPoint( ForesterUtil.roundToInt( node.getXcoord() + TreePanel.BOX_SIZE ), ForesterUtil
- .roundToInt( node.getYcoord() + d ) );
+ _polygon.addPoint( ForesterUtil.roundToInt( node.getXcoord() - TreePanel.BOX_SIZE ),
+ ForesterUtil.roundToInt( node.getYcoord() ) );
+ _polygon.addPoint( ForesterUtil.roundToInt( node.getXcoord() + TreePanel.BOX_SIZE ),
+ ForesterUtil.roundToInt( node.getYcoord() - d ) );
+ _polygon.addPoint( ForesterUtil.roundToInt( node.getXcoord() + TreePanel.BOX_SIZE ),
+ ForesterUtil.roundToInt( node.getYcoord() + d ) );
g.fillPolygon( _polygon );
paintNodeData( g, node, to_graphics_file, to_pdf, is_in_found_nodes );
}
g.setColor( getTreeColorSet().getConfidenceColor() );
}
TreePanel
- .drawString( conf_str, parent_x
- + ( ( x - parent_x - getTreeFontSet()._fm_small.stringWidth( conf_str ) ) / 2 ), ( node
- .getYcoord() + getTreeFontSet()._small_max_ascent ) - 1, g );
+ .drawString( conf_str,
+ parent_x
+ + ( ( x - parent_x - getTreeFontSet()._fm_small.stringWidth( conf_str ) ) / 2 ),
+ ( node.getYcoord() + getTreeFontSet()._small_max_ascent ) - 1,
+ g );
}
}
g.setColor( Color.BLUE );
}
TreePanel
- .drawString( gained, parent_x
- + ( ( x - parent_x - getTreeFontSet()._fm_large.stringWidth( gained ) ) / 2 ), ( node
- .getYcoord() - getTreeFontSet()._fm_large.getMaxDescent() ), g );
+ .drawString( gained,
+ parent_x + ( ( x - parent_x - getTreeFontSet()._fm_large.stringWidth( gained ) ) / 2 ),
+ ( node.getYcoord() - getTreeFontSet()._fm_large.getMaxDescent() ),
+ g );
g.setColor( getTreeColorSet().getLostCharactersColor() );
TreePanel.drawString( lost,
parent_x + ( ( x - parent_x - getTreeFontSet()._fm_large.stringWidth( lost ) ) / 2 ),
x += drawTaxonomyImage( node.getXcoord() + 2 + TreePanel.HALF_BOX_SIZE, node.getYcoord(), node, g );
}
if ( ( getControlPanel().isShowTaxonomyCode() || getControlPanel().isShowTaxonomyScientificNames() || getControlPanel()
- .isShowTaxonomyCommonNames() )
- && node.getNodeData().isHasTaxonomy() ) {
+ .isShowTaxonomyCommonNames() ) && node.getNodeData().isHasTaxonomy() ) {
x += paintTaxonomy( g, node, is_in_found_nodes, to_pdf, to_graphics_file, x );
}
if ( ( to_pdf || to_graphics_file ) && getOptions().isPrintBlackAndWhite() ) {
+ ( getTreeFontSet()._fm_large.getAscent() / down_shift_factor ), g );
}
else {
- TreePanel.drawString( " " + node.getNodeData().getBinaryCharacters().getPresentCount(), node
- .getXcoord()
- + x + 4 + TreePanel.HALF_BOX_SIZE, node.getYcoord()
- + ( getTreeFontSet()._fm_large.getAscent() / down_shift_factor ), g );
+ TreePanel.drawString( " " + node.getNodeData().getBinaryCharacters().getPresentCount(),
+ node.getXcoord() + x + 4 + TreePanel.HALF_BOX_SIZE,
+ node.getYcoord()
+ + ( getTreeFontSet()._fm_large.getAscent() / down_shift_factor ),
+ g );
}
paintGainedAndLostCharacters( g, node, "+"
+ node.getNodeData().getBinaryCharacters().getGainedCount(), "-"
final int x_w = ( int ) ( x + ws + 0.5 );
final int y_h = ( int ) ( my_y + hs + 0.5 );
if ( ( x_w - x > 7 ) && ( y_h - my_y > 7 ) ) {
- g.drawImage( bi, ( int ) ( x + 0.5 + offset ), ( int ) ( my_y + 0.5 ), x_w, y_h, 0, 0, bi
- .getWidth(), bi.getHeight(), null );
+ g.drawImage( bi,
+ ( int ) ( x + 0.5 + offset ),
+ ( int ) ( my_y + 0.5 ),
+ x_w,
+ y_h,
+ 0,
+ 0,
+ bi.getWidth(),
+ bi.getHeight(),
+ null );
ws += 8;
}
else {
_popup_buffer.append( confidence.getType() );
_popup_buffer.append( "] " );
}
- _popup_buffer.append( FORMATTER_CONFIDENCE.format( ForesterUtil
- .round( confidence.getValue(), getOptions()
- .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
+ _popup_buffer
+ .append( FORMATTER_CONFIDENCE.format( ForesterUtil.round( confidence.getValue(),
+ getOptions()
+ .getNumberOfDigitsAfterCommaForConfidenceValues() ) ) );
}
}
if ( _popup_buffer.length() > 0 ) {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
JOptionPane.ERROR_MESSAGE );
}
catch ( final IOException e ) {
- JOptionPane.showMessageDialog( _main_frame, "Could not read from " + url + "\n"
- + e.getLocalizedMessage(), "Failed to read tree from " + client.getName() + " for "
- + identifier, JOptionPane.ERROR_MESSAGE );
+ JOptionPane.showMessageDialog( _main_frame,
+ "Could not read from " + url + "\n" + e.getLocalizedMessage(),
+ "Failed to read tree from " + client.getName() + " for " + identifier,
+ JOptionPane.ERROR_MESSAGE );
}
catch ( final NumberFormatException e ) {
- JOptionPane.showMessageDialog( _main_frame, "Could not read from " + url + "\n"
- + e.getLocalizedMessage(), "Failed to read tree from " + client.getName() + " for "
- + identifier, JOptionPane.ERROR_MESSAGE );
+ JOptionPane.showMessageDialog( _main_frame,
+ "Could not read from " + url + "\n" + e.getLocalizedMessage(),
+ "Failed to read tree from " + client.getName() + " for " + identifier,
+ JOptionPane.ERROR_MESSAGE );
}
catch ( final Exception e ) {
e.printStackTrace();
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
}
String suffix = "";
if ( my_name_for_file.indexOf( '.' ) > 0 ) {
- suffix = my_name_for_file.substring( my_name_for_file.lastIndexOf( '.' ), my_name_for_file
- .length() );
+ suffix = my_name_for_file.substring( my_name_for_file.lastIndexOf( '.' ),
+ my_name_for_file.length() );
my_name_for_file = my_name_for_file.substring( 0, my_name_for_file.lastIndexOf( '.' ) );
}
if ( !ForesterUtil.isEmpty( my_name_for_file ) ) {
n.getBranchData().setBranchColor( new BranchColor( tree_panel.calculateTaxonomyBasedColor( tax ) ) );
final List<PhylogenyNode> descs = PhylogenyMethods.getAllDescendants( n );
for( final PhylogenyNode desc : descs ) {
- desc.getBranchData().setBranchColor( new BranchColor( tree_panel
- .calculateTaxonomyBasedColor( tax ) ) );
+ desc.getBranchData()
+ .setBranchColor( new BranchColor( tree_panel.calculateTaxonomyBasedColor( tax ) ) );
}
}
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
return _domain_structure.getNumberOfDomains();
}
+ @Override
public Dimension getOriginalSize() {
return new Dimension( _domain_structure.getTotalLength(), ForesterUtil.roundToInt( _rendering_height ) );
}
+ @Override
public Object getParameter() {
return new Integer( _e_value_threshold_exp );
}
return _rendering_factor_width;
}
+ @Override
public Dimension getRenderingSize() {
return new Dimension( ForesterUtil.roundToInt( _domain_structure.getTotalLength() * _rendering_factor_width ),
ForesterUtil.roundToInt( _rendering_height ) );
return _domain_structure.isEqual( data );
}
+ @Override
public void render( final double x1,
final double y1,
final Graphics2D g,
}
}
+ @Override
public void setParameter( final double e_value_threshold_exp ) {
_e_value_threshold_exp = ( int ) e_value_threshold_exp;
}
_rendering_factor_width = rendering_factor_width;
}
+ @Override
public void setRenderingHeight( final double rendering_height ) {
_rendering_height = rendering_height;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
throw new NoSuchMethodError();
}
+ @Override
public void render( final double x1,
final double y1,
final Graphics2D g,
//
// Copyright (C) 2008-2010 Christian M. Zmasek
// Copyright (C) 2008-2010 Burnham Institute for Medical Research
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Copyright (C) 2008-2010 Christian M. Zmasek
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Copyright (C) 2008-2010 Christian M. Zmasek
// Copyright (C) 2008-2010 Burnham Institute for Medical Research
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
public static List<PhylogeniesWebserviceClient> createDefaultClients() {
final List<PhylogeniesWebserviceClient> clients = new ArrayList<PhylogeniesWebserviceClient>();
- clients
- .add( new BasicPhylogeniesWebserviceClient( TOL_NAME,
- "Read Tree from Tree of Life...",
- "Use ToL webservice to obtain a phylogeny",
- "Please enter a Tree of Life node identifier\n(Examples: "
- + "19386 for Cephalopoda, 2461 for Cnidaria, 2466 for Deuterostomia)",
- WsPhylogenyFormat.TOL_XML_RESPONSE,
- PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME,
- WebserviceUtil.TOL_WEBSERVER,
- true,
- "http://tolweb.org",
- null ) );
- clients
- .add( new BasicPhylogeniesWebserviceClient( TREE_BASE_NAME,
- "Read Tree from TreeBASE...",
- "Use TreeBASE to obtain a phylogeny",
- "Please enter a TreeBASE tree identifier\n(Examples: 2654, 825, 4931, 2518, 2406, 4934)",
- WsPhylogenyFormat.NEXUS,
- PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME,
- "http://purl.org/phylo/treebase/phylows/tree/TB2:Tr"
- + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
- + "?format=nexus",
- true,
- "http://treebase.nescent.org",
- null ) );
- clients
- .add( new BasicPhylogeniesWebserviceClient( PFAM_NAME,
- "Read Gene Tree from Pfam...",
- "Use Pfam to obtain a (full) gene tree",
- "Please enter a Pfam (PF) accession number\n(Examples: 01849 for NAC, 00452 for Bcl-2, 00046 for Homeobox)",
- WsPhylogenyFormat.PFAM,
- null,
- PFAM_SERVER + "/family/tree/download?alnType=full&acc=PF"
- + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER,
- false,
- PFAM_SERVER,
- PFAM_INST ) );
- clients
- .add( new BasicPhylogeniesWebserviceClient( TREE_FAM_NAME,
- "Read Full Gene Tree from TreeFam...",
- "Use TreeFam to obtain a (full) gene tree",
- "Please enter a TreeFam (TF) accession number\n(Examples: 101004 for Cyclin D, 315938 for Hox, 105310 for Wnt)",
- WsPhylogenyFormat.NHX,
- null,
- "http://www.treefam.org/cgi-bin/getdata.pl?ac=TF"
- + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
- + "&f=full.nhx",
- true,
- "http://www.treefam.org",
- TREE_FAM_INST ) );
- clients
- .add( new BasicPhylogeniesWebserviceClient( TREE_FAM_NAME,
- "Read Clean Gene Tree from TreeFam...",
- "Use TreeFam to obtain a (\"clean\") gene tree",
- "Please enter a TreeFam (TF) accession number\n(Examples: 101004 for Cyclin D, 315938 for Hox, 105310 for Wnt)",
- WsPhylogenyFormat.NHX,
- null,
- "http://www.treefam.org/cgi-bin/getdata.pl?ac=TF"
- + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
- + "&f=clean.nhx",
- true,
- "http://www.treefam.org",
- TREE_FAM_INST ) );
+ clients.add( new BasicPhylogeniesWebserviceClient( TOL_NAME,
+ "Read Tree from Tree of Life...",
+ "Use ToL webservice to obtain a phylogeny",
+ "Please enter a Tree of Life node identifier\n(Examples: "
+ + "19386 for Cephalopoda, 2461 for Cnidaria, 2466 for Deuterostomia)",
+ WsPhylogenyFormat.TOL_XML_RESPONSE,
+ PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME,
+ WebserviceUtil.TOL_WEBSERVER,
+ true,
+ "http://tolweb.org",
+ null ) );
+ clients.add( new BasicPhylogeniesWebserviceClient( TREE_BASE_NAME,
+ "Read Tree from TreeBASE...",
+ "Use TreeBASE to obtain a phylogeny",
+ "Please enter a TreeBASE tree identifier\n(Examples: 2654, 825, 4931, 2518, 2406, 4934)",
+ WsPhylogenyFormat.NEXUS,
+ PhylogenyNodeField.TAXONOMY_SCIENTIFIC_NAME,
+ "http://purl.org/phylo/treebase/phylows/tree/TB2:Tr"
+ + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
+ + "?format=nexus",
+ true,
+ "http://treebase.nescent.org",
+ null ) );
+ clients.add( new BasicPhylogeniesWebserviceClient( PFAM_NAME,
+ "Read Gene Tree from Pfam...",
+ "Use Pfam to obtain a (full) gene tree",
+ "Please enter a Pfam (PF) accession number\n(Examples: 01849 for NAC, 00452 for Bcl-2, 00046 for Homeobox)",
+ WsPhylogenyFormat.PFAM,
+ null,
+ PFAM_SERVER + "/family/tree/download?alnType=full&acc=PF"
+ + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER,
+ false,
+ PFAM_SERVER,
+ PFAM_INST ) );
+ clients.add( new BasicPhylogeniesWebserviceClient( TREE_FAM_NAME,
+ "Read Full Gene Tree from TreeFam...",
+ "Use TreeFam to obtain a (full) gene tree",
+ "Please enter a TreeFam (TF) accession number\n(Examples: 101004 for Cyclin D, 315938 for Hox, 105310 for Wnt)",
+ WsPhylogenyFormat.NHX,
+ null,
+ "http://www.treefam.org/cgi-bin/getdata.pl?ac=TF"
+ + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
+ + "&f=full.nhx",
+ true,
+ "http://www.treefam.org",
+ TREE_FAM_INST ) );
+ clients.add( new BasicPhylogeniesWebserviceClient( TREE_FAM_NAME,
+ "Read Clean Gene Tree from TreeFam...",
+ "Use TreeFam to obtain a (\"clean\") gene tree",
+ "Please enter a TreeFam (TF) accession number\n(Examples: 101004 for Cyclin D, 315938 for Hox, 105310 for Wnt)",
+ WsPhylogenyFormat.NHX,
+ null,
+ "http://www.treefam.org/cgi-bin/getdata.pl?ac=TF"
+ + PhylogeniesWebserviceClient.QUERY_PLACEHOLDER
+ + "&f=clean.nhx",
+ true,
+ "http://www.treefam.org",
+ TREE_FAM_INST ) );
return clients;
}
while ( it.hasNext() ) {
final PhylogenyNode n = it.next();
if ( n.getNodeData().isHasTaxonomy() && ( n.getNodeData().getTaxonomy().getIdentifier() != null ) ) {
- n.getNodeData().getTaxonomy().setIdentifier( new Identifier( n.getNodeData().getTaxonomy()
- .getIdentifier().getValue(), type ) );
+ n.getNodeData()
+ .getTaxonomy()
+ .setIdentifier( new Identifier( n.getNodeData().getTaxonomy().getIdentifier().getValue(), type ) );
}
}
}
//
// Copyright (C) 2008-2010 Christian M. Zmasek
// Copyright (C) 2008-2010 Burnham Institute for Medical Research
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
return _identifier_index_map.containsKey( identifier );
}
+ @Override
public CharacterStateMatrix<S> copy() {
final CharacterStateMatrix<S> new_matrix = new BasicCharacterStateMatrix<S>( getNumberOfIdentifiers(),
getNumberOfCharacters() );
return getNumberOfIdentifiers() <= 0;
}
+ @Override
public CharacterStateMatrix<S> pivot() {
final CharacterStateMatrix<S> new_matrix = new BasicCharacterStateMatrix<S>( getNumberOfCharacters(),
getNumberOfIdentifiers() );
//to format for microarray-style clustering
// states are ints in this case
//TODO
+ @Override
public void toWriter( final Writer writer ) throws IOException {
toForester( writer );
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_identifiers = new String[ size ];
}
+ @Override
public String getIdentifier( final int i ) {
return _identifiers[ i ];
}
+ @Override
public int getIndex( final String identifier ) {
for( int i = 0; i < _identifiers.length; i++ ) {
if ( getIdentifier( i ).equals( identifier ) ) {
throw new IllegalArgumentException( "identifier [" + identifier + "] not found in distance matrix" );
}
+ @Override
public int getSize() {
return _values.length;
}
+ @Override
public double getValue( final int col, final int row ) {
if ( col == row ) {
if ( col >= getSize() ) {
}
}
+ @Override
public void setIdentifier( final int i, final String identifier ) {
_identifiers[ i ] = identifier;
}
}
}
+ @Override
public void setValue( final int col, final int row, final double d ) {
if ( ( col == row ) && ( d != 0.0 ) ) {
throw new IllegalArgumentException( "attempt to set a non-zero value on the diagonal of a symmetrical distance matrix" );
return toPhylip().toString();
}
+ @Override
public StringBuffer toStringBuffer( final Format format ) {
switch ( format ) {
case PHYLIP:
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
private Map<PhylogenyNode, BinaryStates> getStatesForCharacter( final Phylogeny p,
final CharacterStateMatrix<BinaryStates> matrix,
final int character_index ) {
- final Map<PhylogenyNode, BinaryStates> states = new HashMap<PhylogenyNode, BinaryStates>( matrix
- .getNumberOfIdentifiers() );
+ final Map<PhylogenyNode, BinaryStates> states = new HashMap<PhylogenyNode, BinaryStates>( matrix.getNumberOfIdentifiers() );
for( int indentifier_index = 0; indentifier_index < matrix.getNumberOfIdentifiers(); ++indentifier_index ) {
final BinaryStates state = matrix.getState( indentifier_index, character_index );
if ( state == null ) {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
private Map<PhylogenyNode, STATE_TYPE> getStatesForCharacterForTraceback( final Phylogeny p,
final CharacterStateMatrix<STATE_TYPE> matrix,
final int character_index ) {
- final Map<PhylogenyNode, STATE_TYPE> states = new HashMap<PhylogenyNode, STATE_TYPE>( matrix
- .getNumberOfIdentifiers() );
+ final Map<PhylogenyNode, STATE_TYPE> states = new HashMap<PhylogenyNode, STATE_TYPE>( matrix.getNumberOfIdentifiers() );
for( int indentifier_index = 0; indentifier_index < matrix.getNumberOfIdentifiers(); ++indentifier_index ) {
final STATE_TYPE state = matrix.getState( indentifier_index, character_index );
if ( state == null ) {
.getName() );
getInternalStatesMatrixPriorToTraceback().setIdentifier( identifier_index,
ForesterUtil.isEmpty( node.getName() ) ? node
- .getId()
- + "" : node.getName() );
+ .getId() + "" : node.getName() );
++identifier_index;
}
for( int character_index = 0; character_index < external_node_states_matrix.getNumberOfCharacters(); ++character_index ) {
else if ( current_binary_state == ABSENT ) {//new
setGainLossState( character_state_column, current_node, UNCHANGED_ABSENT );//new
}//new
- // setGainLossState( character_state_column, current_node, UNKNOWN_GAIN_LOSS );
+ // setGainLossState( character_state_column, current_node, UNKNOWN_GAIN_LOSS );
}
}
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
private Map<PhylogenyNode, STATE_TYPE> getStatesForCharacterForTraceback( final Phylogeny p,
final CharacterStateMatrix<STATE_TYPE> matrix,
final int character_index ) {
- final Map<PhylogenyNode, STATE_TYPE> states = new HashMap<PhylogenyNode, STATE_TYPE>( matrix
- .getNumberOfIdentifiers() );
+ final Map<PhylogenyNode, STATE_TYPE> states = new HashMap<PhylogenyNode, STATE_TYPE>( matrix.getNumberOfIdentifiers() );
for( int indentifier_index = 0; indentifier_index < matrix.getNumberOfIdentifiers(); ++indentifier_index ) {
final STATE_TYPE state = matrix.getState( indentifier_index, character_index );
if ( state == null ) {
.getName() );
getInternalStatesMatrixPriorToTraceback().setIdentifier( identifier_index,
ForesterUtil.isEmpty( node.getName() ) ? node
- .getId()
- + "" : node.getName() );
+ .getId() + "" : node.getName() );
++identifier_index;
}
for( int character_index = 0; character_index < external_node_states_matrix.getNumberOfCharacters(); ++character_index ) {
else if ( current_binary_state == ABSENT ) {//new
setGainLossState( character_state_column, current_node, UNCHANGED_ABSENT );//new
}//new
- // setGainLossState( character_state_column, current_node, UNKNOWN_GAIN_LOSS );
+ // setGainLossState( character_state_column, current_node, UNKNOWN_GAIN_LOSS );
}
}
}
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_go_id = go_id;
}
+ @Override
public int compareTo( final GoRelationship rel ) {
return getGoId().compareTo( rel.getGoId() );
}
}
}
+ @Override
public GoId getGoId() {
return _go_id;
}
+ @Override
public Type getType() {
return _type;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_type = type;
}
+ @Override
public int compareTo( final GoSubset sub ) {
return getType().compareTo( sub.getType() );
}
}
}
+ @Override
public Type getType() {
return _type;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
init();
}
+ @Override
public StringBuffer asSimpleText() {
return new StringBuffer( getGoId().toString() );
}
+ @Override
public StringBuffer asText() {
return new StringBuffer( toString() );
}
* Compares based on GO id.
*
*/
+ @Override
public int compareTo( final GoTerm go_term ) {
return getGoId().compareTo( go_term.getGoId() );
}
*
*
*/
+ @Override
public PhylogenyData copy() {
final BasicGoTerm gt = new BasicGoTerm( getGoId(), getName(), getGoNameSpace(), isObsolete() );
gt.setGoXrefs( getGoXRefs() );
}
}
+ @Override
public List<GoId> getAltIds() {
return _alt_ids;
}
return _definition;
}
+ @Override
public GoId getGoId() {
return _id;
}
+ @Override
public GoNameSpace getGoNameSpace() {
return _namespace;
}
return _go_subsets;
}
+ @Override
public List<GoXRef> getGoXRefs() {
return _go_xrefs;
}
+ @Override
public String getName() {
return _name;
}
+ @Override
public List<GoId> getSuperGoIds() {
return _super_go_ids;
}
setComment( "" );
}
+ @Override
public boolean isEqual( final PhylogenyData go_term ) {
return equals( go_term );
}
+ @Override
public boolean isObsolete() {
return _is_obsolete;
}
_super_go_ids = super_terms;
}
+ @Override
public StringBuffer toNHX() {
throw new UnsupportedOperationException();
}
+ @Override
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException {
throw new UnsupportedOperationException();
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_xref = xref;
}
+ @Override
public int compareTo( final GoXRef xref ) {
return getXRef().compareTo( xref.getXRef() );
}
}
}
+ @Override
public Type getType() {
return _type;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_id = id.substring( 3 );
}
+ @Override
public int compareTo( final GoId id ) {
return getId().compareTo( id.getId() );
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
if ( !g0.getComment().equals( "" ) ) {
return false;
}
- if ( !g0
- .getDefinition()
+ if ( !g0.getDefinition()
.equals( "\"The distribution of mitochondria, including the mitochondrial genome, into daughter cells after mitosis or meiosis, mediated by interactions between mitochondria and the cytoskeleton.\" [GOC:mcc, PMID:10873824, PMID:11389764]" ) ) {
return false;
}
if ( !g1.getComment().equals( "comment" ) ) {
return false;
}
- if ( !g1
- .getDefinition()
+ if ( !g1.getDefinition()
.equals( "\"The maintenance of the structure and integrity of the mitochondrial genome.\" [GOC:ai]" ) ) {
return false;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
w.write( ForesterUtil.LINE_SEPARATOR );
w.write( "a.new_type:link { font-size: 7pt; color : #505050; text-decoration : none; }" );
w.write( ForesterUtil.LINE_SEPARATOR );
- w
- .write( "a.new_type:hover { font-size: 7pt; color : #000000; background-color : #FFFF00; text-decoration : none; }" );
+ w.write( "a.new_type:hover { font-size: 7pt; color : #000000; background-color : #FFFF00; text-decoration : none; }" );
w.write( ForesterUtil.LINE_SEPARATOR );
- w
- .write( "a.new_type:hover { font-size: 7pt; color : #000000; background-color : #FFFF00; text-decoration : none; }" );
+ w.write( "a.new_type:hover { font-size: 7pt; color : #000000; background-color : #FFFF00; text-decoration : none; }" );
w.write( ForesterUtil.LINE_SEPARATOR );
w.write( "td { text-align: left; vertical-align: top; font-family: Verdana, Arial, Helvetica; font-size: 8pt}" );
w.write( ForesterUtil.LINE_SEPARATOR );
- w
- .write( "th { text-align: left; vertical-align: top; font-family: Verdana, Arial, Helvetica; font-size: 10pt; font-weight: bold }" );
+ w.write( "th { text-align: left; vertical-align: top; font-family: Verdana, Arial, Helvetica; font-size: 10pt; font-weight: bold }" );
w.write( ForesterUtil.LINE_SEPARATOR );
w.write( "h1 { color : #000000; font-family: Verdana, Arial, Helvetica; font-size: 18pt; font-weight: bold }" );
w.write( ForesterUtil.LINE_SEPARATOR );
w.write( "h2 { color : #000000; font-family: Verdana, Arial, Helvetica; font-size: 16pt; font-weight: bold }" );
- w
- .write( "h3 { margin-top: 12px; margin-bottom: 0px; color : #000000; font-family: Verdana, Arial, Helvetica; font-size: 12pt; font-weight: bold }" );
+ w.write( "h3 { margin-top: 12px; margin-bottom: 0px; color : #000000; font-family: Verdana, Arial, Helvetica; font-size: 12pt; font-weight: bold }" );
w.write( ForesterUtil.LINE_SEPARATOR );
w.write( "</style>" );
w.write( ForesterUtil.LINE_SEPARATOR );
writer.write( String.valueOf( ontologizer_result.getStudyTerm() ) );
writer.write( "</td><td>" );
if ( domains_per_species != null ) {
- final StringBuilder sb = obtainDomainsForGoId( pfam_to_go, domains_per_species, go_id_to_terms, go_term
- .getGoId(), domain_ids_with_go_annot );
+ final StringBuilder sb = obtainDomainsForGoId( pfam_to_go,
+ domains_per_species,
+ go_id_to_terms,
+ go_term.getGoId(),
+ domain_ids_with_go_annot );
writer.write( sb.toString() );
}
else {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
reader.close();
final List<Sequence> seqs = new ArrayList<Sequence>();
for( int i = 0; i < temp_msa.size(); ++i ) {
- seqs.add( BasicSequence.createAaSequence( temp_msa.get( i )[ 0 ].toString(), temp_msa.get( i )[ 1 ]
- .toString() ) );
+ seqs.add( BasicSequence.createAaSequence( temp_msa.get( i )[ 0 ].toString(),
+ temp_msa.get( i )[ 1 ].toString() ) );
}
return seqs;
}
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
return _replace_underscores;
}
+ @Override
public Phylogeny[] parse() throws IOException, NHXFormatException {
reset();
final BufferedReader reader = ParserUtils.createReader( getNexusSource() );
_replace_underscores = replace_underscores;
}
+ @Override
public void setSource( final Object nexus_source ) throws PhylogenyParserException, IOException {
if ( nexus_source == null ) {
throw new PhylogenyParserException( getClass() + ": attempt to parse null object." );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* @throws NHXFormatException
* @throws PhylogenyParserException
*/
+ @Override
public Phylogeny[] parse() throws IOException, NHXFormatException {
setHasNext( false );
boolean in_comment = false;
* @throws IOException
* @throws PhylogenyParserException
*/
+ @Override
public void setSource( final Object nhx_source ) throws PhylogenyParserException, IOException {
if ( nhx_source == null ) {
throw new PhylogenyParserException( getClass() + ": attempt to parse null object." );
if ( !node_to_annotate.getNodeData().isHasSequence() ) {
node_to_annotate.getNodeData().setSequence( new Sequence() );
}
- node_to_annotate.getNodeData().getSequence().setDomainArchitecture( new DomainArchitecture( s
- .substring( 3 ) ) );
+ node_to_annotate.getNodeData().getSequence()
+ .setDomainArchitecture( new DomainArchitecture( s.substring( 3 ) ) );
}
else if ( s.startsWith( NHXtags.NODE_IDENTIFIER ) ) {
node_to_annotate.getNodeData().setNodeIdentifier( new Identifier( s.substring( 3 ) ) );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import org.forester.phylogeny.data.Reference;
import org.forester.phylogeny.data.Sequence;
import org.forester.phylogeny.data.SequenceRelation;
-import org.forester.phylogeny.data.Taxonomy;
import org.forester.phylogeny.data.SequenceRelation.SEQUENCE_RELATION_TYPE;
+import org.forester.phylogeny.data.Taxonomy;
import org.forester.util.FailedConditionCheckException;
import org.forester.util.ForesterConstants;
import org.forester.util.ForesterUtil;
if ( !node.getNodeData().isHasProperties() ) {
node.getNodeData().setProperties( new PropertiesMap() );
}
- node.getNodeData().getProperties().addProperty( ( Property ) PropertyParser.getInstance()
- .parse( element ) );
+ node.getNodeData().getProperties()
+ .addProperty( ( Property ) PropertyParser.getInstance().parse( element ) );
}
}
}
.getAttribute( PhyloXmlMapping.PHYLOGENY_IS_REROOTABLE_ATTR ) ) );
}
if ( element.isHasAttribute( PhyloXmlMapping.PHYLOGENY_BRANCHLENGTH_UNIT_ATTR ) ) {
- getCurrentPhylogeny().setDistanceUnit( element
- .getAttribute( PhyloXmlMapping.PHYLOGENY_BRANCHLENGTH_UNIT_ATTR ) );
+ getCurrentPhylogeny()
+ .setDistanceUnit( element.getAttribute( PhyloXmlMapping.PHYLOGENY_BRANCHLENGTH_UNIT_ATTR ) );
}
if ( element.isHasAttribute( PhyloXmlMapping.PHYLOGENY_IS_ROOTED_ATTR ) ) {
getCurrentPhylogeny().setRooted( Boolean.parseBoolean( element
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
return _zipped_inputstream;
}
+ @Override
public Phylogeny[] parse() throws IOException, PhylogenyParserException {
reset();
final PhyloXmlHandler handler = new PhyloXmlHandler();
_warning_messages = new StringBuffer();
}
+ @Override
public void setSource( final Object source ) {
_source = source;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
public static final int ROUNDING_DIGITS_FOR_PHYLOXML_DOUBLE_OUTPUT = 9;
public static final String VECTOR_PROPERTY_REF = "vector:index=";
public static final String VECTOR_PROPERTY_TYPE = "xsd:decimal";
+ public static final String UNIPROT_TAX_PROVIDER = "uniprot";
static {
SEQUENCE_TYPES.add( "rna" );
SEQUENCE_TYPES.add( "protein" );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@Override
public PhylogenyData parse( final XmlElement element ) throws PhylogenyParserException {
if ( element.isHasAttribute( PhyloXmlMapping.ACCESSION_SOURCE_ATTR ) ) {
- return new Accession( element.getValueAsString(), element
- .getAttribute( PhyloXmlMapping.ACCESSION_SOURCE_ATTR ) );
+ return new Accession( element.getValueAsString(),
+ element.getAttribute( PhyloXmlMapping.ACCESSION_SOURCE_ATTR ) );
}
else {
return new Accession( element.getValueAsString(), "?" );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@Override
public PhylogenyData parse( final XmlElement element ) throws PhylogenyParserException {
if ( element.isHasAttribute( PhyloXmlMapping.IDENTIFIER_PROVIDER_ATTR ) ) {
- return new Identifier( element.getValueAsString(), element
- .getAttribute( PhyloXmlMapping.IDENTIFIER_PROVIDER_ATTR ) );
+ return new Identifier( element.getValueAsString(),
+ element.getAttribute( PhyloXmlMapping.IDENTIFIER_PROVIDER_ATTR ) );
}
else if ( element.isHasAttribute( TYPE ) ) {
return new Identifier( element.getValueAsString(), element.getAttribute( TYPE ) );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
seqRelation.setType( SequenceRelation.SEQUENCE_RELATION_TYPE.valueOf( sType ) );
}
if ( element.isHasAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF0 ) && ( _phylogeny != null ) ) {
- final Sequence ref = PhyloXmlHandler.getSequenceMapByIdForPhylogeny( _phylogeny ).get( element
- .getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF0 ) );
+ final Sequence ref = PhyloXmlHandler.getSequenceMapByIdForPhylogeny( _phylogeny )
+ .get( element.getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF0 ) );
if ( ref != null ) {
seqRelation.setRef0( ref );
}
}
if ( element.isHasAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF1 ) && ( _phylogeny != null ) ) {
- final Sequence ref = PhyloXmlHandler.getSequenceMapByIdForPhylogeny( _phylogeny ).get( element
- .getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF1 ) );
+ final Sequence ref = PhyloXmlHandler.getSequenceMapByIdForPhylogeny( _phylogeny )
+ .get( element.getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_ID_REF1 ) );
if ( ref != null ) {
seqRelation.setRef1( ref );
}
}
if ( element.isHasAttribute( PhyloXmlMapping.SEQUENCE_RELATION_DISTANCE ) ) {
- seqRelation.setDistance( Double
- .valueOf( element.getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_DISTANCE ) ) );
+ seqRelation
+ .setDistance( Double.valueOf( element.getAttribute( PhyloXmlMapping.SEQUENCE_RELATION_DISTANCE ) ) );
}
for( int i = 0; i < element.getNumberOfChildElements(); ++i ) {
final XmlElement child_element = element.getChildElement( i );
private TaxonomyParser() {
}
+ @Override
public Taxonomy parse( final XmlElement element ) throws PhylogenyParserException {
final Taxonomy taxonomy = new Taxonomy();
for( int i = 0; i < element.getNumberOfChildElements(); ++i ) {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
return _zipped_inputstream;
}
+ @Override
public Phylogeny[] parse() throws IOException, PhylogenyParserException {
reset();
final TolXmlHandler handler = new TolXmlHandler();
_warning_messages = new StringBuffer();
}
+ @Override
public void setSource( final Object source ) {
_source = source;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2009 Christian M. Zmasek
// Copyright (C) 2007-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
return _type;
}
+ @Override
public void setIdentifier( final int row, final Object id ) {
_identifiers[ row ] = id;
}
+ @Override
public void setResidueAt( final int row, final int col, final char residue ) {
_data[ row ][ col ] = residue;
}
return sb.toString();
}
+ @Override
public void write( final Writer w ) throws IOException {
final int max = determineMaxIdLength() + 1;
for( int row = 0; row < _data.length; ++row ) {
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
throw new NoSuchMethodError();
}
+ @Override
public String getErrorDescription() {
return _error;
}
+ @Override
public int getExitCode() {
return _exit_code;
}
+ @Override
public Msa infer( final File path_to_input_seqs, final List<String> opts ) throws IOException, InterruptedException {
init();
final List<String> my_opts = new ArrayList<String>();
throw new NoSuchMethodError();
}
+ @Override
public String getErrorDescription() {
return _error;
}
+ @Override
public int getExitCode() {
return _exit_code;
}
+ @Override
public Msa infer( final File path_to_input_seqs, final List<String> opts ) throws IOException, InterruptedException {
init();
final String[] my_opts = new String[ opts.size() + 1 ];
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* org.forester.tools.modeling.CoverageCalculationOptions,
* java.io.PrintStream)
*/
+ @Override
public List<String> find( final List<Phylogeny> phylogenies,
final List<String> already_covered,
int number_names_to_find,
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
return score_contribution;
}
+ @Override
public void calculateScoreForExternalNode( final SortedMap<PhylogenyNode, Double> external_node_scores,
final Phylogeny phylogeny,
final PhylogenyNode external_node,
}
}
+ @Override
public String getDesciption() {
return "sum of 1/branch-segment-sum";
}
+ @Override
public double getNormalizationFactor( final Phylogeny phylogeny ) {
return ( 1.0 / phylogeny.getNumberOfExternalNodes() );
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_min = stats.getMin();
}
+ @Override
public String asString() {
final StringBuffer sb = new StringBuffer();
if ( getN() == 1 ) {
return _n;
}
+ @Override
public double getScore() {
return getAvarageNormalizedScore();
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
private static final Color MAXIMAL_COV_COLOR = new Color( 0, 255, 0 );
private static final Color MINIMAL_COV_COLOR = new Color( 255, 0, 0 );
+ @Override
public Coverage calculateCoverage( final List<Phylogeny> phylogenies,
final List<String> names,
final CoverageCalculationOptions options,
final SortedMap<PhylogenyNode, Double> external_node_scores = ModelingUtils
.setUpExternalCoverageHashMap( phylogeny );
for( final Object element : names ) {
- scoring_method.calculateScoreForExternalNode( external_node_scores, phylogeny, phylogeny
- .getNode( ( String ) element ), options );
+ scoring_method.calculateScoreForExternalNode( external_node_scores,
+ phylogeny,
+ phylogeny.getNode( ( String ) element ),
+ options );
}
if ( annotate_phylogeny ) {
colorizePhylogenyAccordingToCoverage( external_node_scores, phylogeny, normalization_factor );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_scoring_method = scoring_method;
}
+ @Override
public String asString() {
final StringBuffer sb = new StringBuffer();
sb.append( "scoring method: " );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
already_covered.add( "X" );
already_covered.add( "H" );
already_covered.add( "C" );
- l = ce
- .find( phylogenies,
- already_covered,
- 0,
- new ExternalNodeBasedCoverageMethodOptions( "org.forester.pccx.BranchCountingBasedScoringMethod" ),
- null );
+ l = ce.find( phylogenies,
+ already_covered,
+ 0,
+ new ExternalNodeBasedCoverageMethodOptions( "org.forester.pccx.BranchCountingBasedScoringMethod" ),
+ null );
if ( !l.get( 0 ).equals( "E" ) ) {
return false;
}
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
}
}
+ @Override
public PhylogenyData getData() {
return _data;
}
+ @Override
public PhylogenyNode getFirstNode() {
return _node_1;
}
+ @Override
public PhylogenyNode getSecondNode() {
return _node_2;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
blue += child_color.getBlue();
}
}
- setBranchColorValue( node, new Color( ForesterUtil.roundToInt( red / n ), ForesterUtil
- .roundToInt( green / n ), ForesterUtil.roundToInt( blue / n ) ) );
+ setBranchColorValue( node,
+ new Color( ForesterUtil.roundToInt( red / n ),
+ ForesterUtil.roundToInt( green / n ),
+ ForesterUtil.roundToInt( blue / n ) ) );
}
}
}
parent.removeChildNode( remove_me );
for( final PhylogenyNode desc : descs ) {
parent.addAsChild( desc );
- desc.setDistanceToParent( addPhylogenyDistances( remove_me.getDistanceToParent(), desc
- .getDistanceToParent() ) );
+ desc.setDistanceToParent( addPhylogenyDistances( remove_me.getDistanceToParent(),
+ desc.getDistanceToParent() ) );
}
remove_me.setParent( null );
phylogeny.setIdHash( null );
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* @param n
* the PhylogenyNode to add
*/
+ @Override
final public void addAsChild( final PhylogenyNodeI node ) {
final PhylogenyNode n = ( PhylogenyNode ) node;
addChildNode( n );
getDescendants().add( child );
}
+ @Override
final public int compareTo( final PhylogenyNode o ) {
final PhylogenyNode n = o;
if ( ( getName() == null ) || ( n.getName() == null ) ) {
* @throws IllegalArgumentException
* if n is out of bounds
*/
+ @Override
final public PhylogenyNode getChildNode( final int i ) {
if ( isExternal() ) {
throw new UnsupportedOperationException( "attempt to get the child node of an external node." );
* Returns the length of the branch leading to the _parent of this
* PhylogenyNode (double).
*/
+ @Override
final public double getDistanceToParent() {
return _distance_parent;
}
/**
* Returns the ID (int) of this PhylogenyNode.
*/
+ @Override
final public int getId() {
return _id;
}
/**
* Returns the name of this node.
*/
+ @Override
final public String getName() {
return getNodeData().getNodeName();
}
* Sets the length of the branch leading to the _parent of this
* PhylogenyNode to double d.
*/
+ @Override
final public void setDistanceToParent( final double d ) {
_distance_parent = d;
}
/**
* Sets the name of this node.
*/
+ @Override
final public void setName( final String node_name ) {
getNodeData().setNodeName( node_name );
}
/**
* Sets the _parent PhylogenyNode of this PhylogenyNode to n.
*/
+ @Override
final public void setParent( final PhylogenyNode n ) {
_parent = n;
}
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_source = source;
}
+ @Override
public StringBuffer asSimpleText() {
return new StringBuffer( getValue() );
}
+ @Override
public StringBuffer asText() {
final StringBuffer sb = new StringBuffer();
if ( !ForesterUtil.isEmpty( getSource() ) ) {
return sb;
}
+ @Override
public PhylogenyData copy() {
return new Accession( new String( getValue() ), new String( getSource() ) );
}
return getValue().hashCode();
}
+ @Override
public boolean isEqual( final PhylogenyData data ) {
if ( this == data ) {
return true;
return ( a.getValue().equals( getValue() ) );
}
+ @Override
public StringBuffer toNHX() {
final StringBuffer sb = new StringBuffer();
sb.append( ":" );
return sb;
}
+ @Override
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException {
if ( ForesterUtil.isEmpty( getSource() ) ) {
PhylogenyDataUtil.appendElement( writer,
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
setType( type );
}
+ @Override
public StringBuffer asSimpleText() {
return new StringBuffer().append( ForesterUtil.FORMATTER_6.format( getValue() ) );
}
+ @Override
public StringBuffer asText() {
final StringBuffer sb = new StringBuffer();
if ( !ForesterUtil.isEmpty( getType() ) ) {
return getType().compareToIgnoreCase( confidence.getType() );
}
+ @Override
public PhylogenyData copy() {
return new Confidence( getValue(), getType() );
}
setType( "" );
}
+ @Override
public boolean isEqual( final PhylogenyData confidence ) {
if ( confidence == null ) {
return false;
_value = value;
}
+ @Override
public StringBuffer toNHX() {
final StringBuffer sb = new StringBuffer();
sb.append( NHXtags.SUPPORT );
return sb;
}
+ @Override
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException {
if ( getValue() == CONFIDENCE_DEFAULT_VALUE ) {
return;
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_domains.put( key, pd );
}
+ @Override
public StringBuffer asSimpleText() {
final StringBuffer sb = new StringBuffer();
for( int i = 0; i < getDomains().size(); ++i ) {
return sb;
}
+ @Override
public StringBuffer asText() {
final StringBuffer sb = new StringBuffer();
for( int i = 0; i < getDomains().size(); ++i ) {
return sb;
}
+ @Override
public PhylogenyData copy() {
final List<PhylogenyData> domains = new ArrayList<PhylogenyData>( getDomains().size() );
for( int i = 0; i < getDomains().size(); ++i ) {
*
*
*/
+ @Override
public boolean isEqual( final PhylogenyData domain_architecture ) {
if ( domain_architecture == null ) {
return false;
_total_length = total_length;
}
+ @Override
public StringBuffer toNHX() {
final StringBuffer sb = new StringBuffer();
sb.append( ":" );
return sb;
}
+ @Override
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException {
writer.write( ForesterUtil.LINE_SEPARATOR );
writer.write( indentation );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
}
}
+ @Override
public StringBuffer asSimpleText() {
final StringBuffer sb = new StringBuffer();
if ( isUnassigned() ) {
return sb;
}
+ @Override
public StringBuffer asText() {
final StringBuffer sb = new StringBuffer();
if ( isUnassigned() || isSpeciationOrDuplication() || isOther() || isRoot() || isTransfer() || isFusion() ) {
return sb;
}
+ @Override
public PhylogenyData copy() {
if ( isUnassigned() ) {
return new Event();
return ( _duplications > 0 ) && ( _gene_losses < 1 ) && ( _speciations < 1 );
}
+ @Override
public boolean isEqual( final PhylogenyData event ) {
if ( ( event == null ) || !( event instanceof Event ) ) {
return false;
_event_type = EventType.mixed;
}
+ @Override
public StringBuffer toNHX() {
final StringBuffer sb = new StringBuffer();
if ( !isUnassigned() && ( isSpeciationOrDuplication() || isDuplication() || isSpeciation() ) ) {
return sb;
}
+ @Override
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException {
writer.write( ForesterUtil.LINE_SEPARATOR );
writer.write( indentation );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_provider = provider;
}
+ @Override
public StringBuffer asSimpleText() {
return new StringBuffer( getValue() );
}
+ @Override
public StringBuffer asText() {
final StringBuffer sb = new StringBuffer();
if ( !ForesterUtil.isEmpty( getProvider() ) ) {
return sb;
}
+ @Override
public PhylogenyData copy() {
return new Identifier( getValue(), getProvider() );
}
return getValue().hashCode();
}
+ @Override
public boolean isEqual( final PhylogenyData data ) {
if ( this == data ) {
return true;
return ( a.getValue().equals( getValue() ) );
}
+ @Override
public StringBuffer toNHX() {
final StringBuffer sb = new StringBuffer();
sb.append( ":" );
return sb;
}
+ @Override
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException {
if ( !org.forester.util.ForesterUtil.isEmpty( getProvider() ) ) {
PhylogenyDataUtil.appendElement( writer,
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_taxonomies.add( taxonomy );
}
+ @Override
public StringBuffer asSimpleText() {
throw new UnsupportedOperationException();
}
+ @Override
public StringBuffer asText() {
throw new UnsupportedOperationException();
}
+ @Override
public PhylogenyData copy() {
final NodeData new_data = new NodeData();
new_data.setNodeName( getNodeName() );
return _taxonomies.get( index );
}
+ @Override
public boolean isEqual( final PhylogenyData data ) {
throw new UnsupportedOperationException();
}
}
}
+ @Override
public StringBuffer toNHX() {
final StringBuffer sb = new StringBuffer();
if ( isHasNodeIdentifier() ) {
return sb;
}
+ @Override
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException {
if ( isHasNodeIdentifier() ) {
writer.write( ForesterUtil.LINE_SEPARATOR );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
}
public static void drawString( final String str, final double x, final double y, final Graphics g ) {
- g.drawString( str, org.forester.util.ForesterUtil.roundToInt( x ), org.forester.util.ForesterUtil
- .roundToInt( y ) );
+ g.drawString( str,
+ org.forester.util.ForesterUtil.roundToInt( x ),
+ org.forester.util.ForesterUtil.roundToInt( y ) );
}
public static String replaceIllegalXmlCharacters( final String value ) {
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_confidence = confidence;
}
+ @Override
public StringBuffer asSimpleText() {
return new StringBuffer( getName() );
}
+ @Override
public StringBuffer asText() {
final StringBuffer sb = new StringBuffer( getName() );
sb.append( " [" );
return sb;
}
+ @Override
public PhylogenyData copy() {
if ( getId() == null ) {
return new ProteinDomain( getName(), getFrom(), getTo(), getConfidence() );
return _to;
}
+ @Override
public boolean isEqual( final PhylogenyData protein_domain ) {
if ( protein_domain == null ) {
return false;
return true;
}
+ @Override
public StringBuffer toNHX() {
throw new UnsupportedOperationException();
}
+ @Override
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException {
writer.write( ForesterUtil.LINE_SEPARATOR );
writer.write( indentation );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_doi = doi;
}
+ @Override
public StringBuffer asSimpleText() {
return new StringBuffer( getDescription() );
}
+ @Override
public StringBuffer asText() {
final StringBuffer sb = new StringBuffer();
if ( !ForesterUtil.isEmpty( getDoi() ) ) {
return sb;
}
+ @Override
public PhylogenyData copy() {
return new Reference( getDescription(), getDoi() );
}
return _desc;
}
+ @Override
public boolean isEqual( final PhylogenyData data ) {
if ( ( data == null ) || ( getDescription() == null ) ) {
return false;
_desc = value;
}
+ @Override
public StringBuffer toNHX() {
throw new UnsupportedOperationException();
}
+ @Override
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException {
writer.write( ForesterUtil.LINE_SEPARATOR );
writer.write( indentation );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
getAnnotations().add( annotation );
}
+ @Override
public void addUri( final Uri uri ) {
if ( getUris() == null ) {
setUris( new ArrayList<Uri>() );
_seq_relations.add( sr );
}
+ @Override
public StringBuffer asSimpleText() {
final StringBuffer sb = new StringBuffer();
if ( getAccession() != null ) {
return sb;
}
+ @Override
public StringBuffer asText() {
return asSimpleText();
}
* Not a deep copy.
*
*/
+ @Override
public PhylogenyData copy() {
final Sequence seq = new Sequence();
seq.setAnnotations( getAnnotations() );
return _type;
}
+ @Override
public List<Uri> getUris() {
return _uris;
}
+ @Override
public Uri getUri( final int index ) {
return getUris().get( index );
}
setSourceId( null );
}
+ @Override
public boolean isEqual( final PhylogenyData data ) {
if ( this == data ) {
return true;
_type = type;
}
+ @Override
public void setUris( final List<Uri> uris ) {
_uris = uris;
}
+ @Override
public StringBuffer toNHX() {
final StringBuffer sb = new StringBuffer();
if ( getName().length() > 0 ) {
return sb;
}
+ @Override
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException {
if ( isEmpty() ) {
return;
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
init();
}
+ @Override
public StringBuffer asSimpleText() {
return asText();
}
+ @Override
public Uri getUri( final int index ) {
return getUris().get( index );
}
+ @Override
public void addUri( final Uri uri ) {
if ( getUris() == null ) {
setUris( new ArrayList<Uri>() );
getUris().add( uri );
}
+ @Override
public StringBuffer asText() {
final StringBuffer sb = new StringBuffer();
if ( getIdentifier() != null ) {
return sb;
}
+ @Override
public PhylogenyData copy() {
final Taxonomy t = new Taxonomy();
t.setTaxonomyCode( getTaxonomyCode() );
return _taxonomy_code;
}
+ @Override
public List<Uri> getUris() {
return _uris;
}
* (Note. This is important and should not be change without a very good reason.)
*
*/
+ @Override
public boolean isEqual( final PhylogenyData data ) {
if ( this == data ) {
return true;
_taxonomy_code = taxonomy_code;
}
+ @Override
public void setUris( final List<Uri> uris ) {
_uris = uris;
}
+ @Override
public StringBuffer toNHX() {
final StringBuffer sb = new StringBuffer();
if ( getIdentifier() != null ) {
return sb;
}
+ @Override
public void toPhyloXML( final Writer writer, final int level, final String indentation ) throws IOException {
if ( isEmpty() ) {
return;
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
public abstract class BasicPhylogenyFactory implements PhylogenyFactory {
+ @Override
public Phylogeny create() {
return new Phylogeny();
}
+ @Override
public Phylogeny[] create( final Object source, final Object creator ) throws IOException {
return create( source, creator, null );
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
throw new CloneNotSupportedException();
}
+ @Override
public synchronized Phylogeny[] create( final Object source, final Object parser, final List<Object> parameters )
throws IOException {
if ( !( parser instanceof PhylogenyParser ) ) {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* @return true is this iterator has at least one more element, false
* otherwise
*/
+ @Override
public boolean hasNext() {
return ( getI() < getNode().getNumberOfDescendants() );
}
* @throws NoSuchElementException
* if iteration is complete
*/
+ @Override
public PhylogenyNode next() throws NoSuchElementException {
if ( !hasNext() ) {
throw new NoSuchElementException( "Attempt to call \"next()\" on iterator which has no more next elements." );
* Not supported.
*
*/
+ @Override
public void remove() {
throw new UnsupportedOperationException();
}
/**
* Resets the iterator.
*/
+ @Override
public void reset() {
setI( 0 );
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* @see java.util.Iterator#hasNext()
*/
+ @Override
public boolean hasNext() {
return getCurrentNode() != null;
}
*
* @see java.util.Iterator#next()
*/
+ @Override
public PhylogenyNode next() throws NoSuchElementException {
if ( !hasNext() ) {
throw new NoSuchElementException( "Attempt to call \"next()\" on iterator which has no more next elements." );
* Not supported.
*
*/
+ @Override
public void remove() {
throw new UnsupportedOperationException();
}
/**
* DOCUMENT ME!
*/
+ @Override
public void reset() {
setCurrentNode( getFirstExtNode() );
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* @return true is this iterator has at least one more element, false
* otherwise
*/
+ @Override
public boolean hasNext() {
return !getQueue().isEmpty();
}
* @throws NoSuchElementException
* if iteration is complete
*/
+ @Override
public PhylogenyNode next() throws NoSuchElementException {
if ( !hasNext() ) {
throw new NoSuchElementException( "Attempt to call \"next()\" on iterator which has no more next elements." );
* Not supported.
*
*/
+ @Override
public void remove() {
throw new UnsupportedOperationException();
}
/**
* Resets the iterator.
*/
+ @Override
public void reset() {
getQueue().clear();
getQueue().enqueue( getRoot() );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
public interface PhylogenyNodeIterator extends Iterator<PhylogenyNode> {
+ @Override
public boolean hasNext();
+ @Override
public PhylogenyNode next() throws NoSuchElementException;
public void reset();
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* @return DOCUMENT ME!
*/
+ @Override
public boolean hasNext() {
return _has_next;
}
/**
* Advances the Iterator by one.
*/
+ @Override
public PhylogenyNode next() throws NoSuchElementException {
if ( !hasNext() ) {
throw new NoSuchElementException( "Attempt to call \"next()\" on iterator which has no more next elements." );
* Not supported.
*
*/
+ @Override
public void remove() {
throw new UnsupportedOperationException();
}
/**
* DOCUMENT ME!
*/
+ @Override
public void reset() {
setHasNext( true );
getStack().clear();
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* @see java.util.Iterator#hasNext()
*/
+ @Override
public boolean hasNext() {
return !getStack().isEmpty();
}
/**
* Advances the Iterator by one.
*/
+ @Override
public PhylogenyNode next() throws NoSuchElementException {
if ( !hasNext() ) {
throw new NoSuchElementException( "Attempt to call \"next()\" on iterator which has no more next elements." );
* Not supported.
*
*/
+ @Override
public void remove() {
throw new UnsupportedOperationException();
}
+ @Override
public void reset() {
getStack().clear();
getStack().push( getTree().getRoot() );
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2001 Washington University School of Medicine
// and Howard Hughes Medical Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
}
}
+ @Override
public int compareTo( final Tuplet n ) {
if ( ( getValue1() != Tuplet.DEFAULT ) && ( n.getValue1() != Tuplet.DEFAULT ) ) {
if ( getValue1() < n.getValue1() ) {
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_type = type;
}
+ @Override
public Object getIdentifier() {
return _identifier;
}
+ @Override
public int getLength() {
return _mol_sequence.length;
}
+ @Override
public char[] getMolecularSequence() {
return _mol_sequence;
}
+ @Override
public char getResidueAt( final int position ) {
return _mol_sequence[ position ];
}
+ @Override
public TYPE getType() {
return _type;
}
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
}
}
+ @Override
public DomainId getId0() {
return _id_0;
}
+ @Override
public DomainId getId1() {
return _id_1;
}
return getId0().hashCode() + ( 19 * getId1().hashCode() );
}
+ @Override
public StringBuffer toGraphDescribingLanguage( final OutputFormat format,
final String node_attribute,
final String edge_attribute ) {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
init();
}
+ @Override
public void addCombinableDomain( final DomainId protein_domain ) {
if ( getCombiningDomains().containsKey( protein_domain ) ) {
getCombiningDomains().put( protein_domain, getCombiningDomains().get( protein_domain ) + 1 );
}
}
+ @Override
public List<DomainId> getAllDomains() {
final List<DomainId> domains = getCombinableDomains();
if ( !domains.contains( getKeyDomain() ) ) {
return domains;
}
+ @Override
public List<DomainId> getCombinableDomains() {
final List<DomainId> domains = new ArrayList<DomainId>( getNumberOfCombinableDomains() );
for( final DomainId domain : getCombiningDomains().keySet() ) {
return domains;
}
+ @Override
public SortedMap<DomainId, Integer> getCombinableDomainsIds() {
final SortedMap<DomainId, Integer> ids = new TreeMap<DomainId, Integer>();
for( final DomainId domain : getCombiningDomains().keySet() ) {
return ids;
}
+ @Override
public StringBuilder getCombiningDomainIdsAsStringBuilder() {
final StringBuilder sb = new StringBuilder();
for( final Iterator<DomainId> iter = getCombiningDomains().keySet().iterator(); iter.hasNext(); ) {
return _combining_domains;
}
+ @Override
public DomainId getKeyDomain() {
return _key_domain;
}
+ @Override
public DescriptiveStatistics getKeyDomainConfidenceDescriptiveStatistics() {
return _key_domain_confidence_statistics;
}
+ @Override
public int getKeyDomainCount() {
return _key_domain_count;
}
+ @Override
public int getKeyDomainProteinsCount() {
return _key_domain_proteins_count;
}
+ @Override
public int getNumberOfCombinableDomains() {
return _combining_domains.size();
}
+ @Override
public int getNumberOfProteinsExhibitingCombination( final DomainId protein_domain ) {
if ( getCombiningDomains().containsKey( protein_domain ) ) {
return getCombiningDomains().get( protein_domain );
}
}
+ @Override
public Species getSpecies() {
return _species;
}
_key_domain_confidence_statistics = null;
}
+ @Override
public boolean isCombinable( final DomainId protein_domain ) {
return getCombiningDomains().containsKey( protein_domain );
}
+ @Override
public void setKeyDomainConfidenceDescriptiveStatistics( final DescriptiveStatistics key_domain_confidence_statistics ) {
_key_domain_confidence_statistics = key_domain_confidence_statistics;
}
+ @Override
public void setKeyDomainCount( final int key_domain_count ) {
_key_domain_count = key_domain_count;
}
+ @Override
public void setKeyDomainProteinsCount( final int key_domain_proteins_count ) {
_key_domain_proteins_count = key_domain_proteins_count;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_per_domain_score = per_domain_score;
}
+ @Override
public void addGoId( final GoId go_id ) {
getDomainId().getGoIds().add( go_id );
}
* insensitive) and their numbers.
*
*/
+ @Override
public int compareTo( final Domain domain ) {
if ( domain.getClass() != this.getClass() ) {
throw new IllegalArgumentException( "attempt to compare [" + domain.getClass() + "] to " + "["
}
}
+ @Override
public DomainId getDomainId() {
return _id;
}
+ @Override
public int getFrom() {
return _from;
}
+ @Override
public GoId getGoId( final int i ) {
return getDomainId().getGoIds().get( i );
}
+ @Override
public short getNumber() {
return _number;
}
+ @Override
public int getNumberOfGoIds() {
return getDomainId().getGoIds().size();
}
return _per_domain_score;
}
+ @Override
public double getPerSequenceEvalue() {
return _per_sequence_evalue;
}
+ @Override
public double getPerSequenceScore() {
return _per_sequence_score;
}
+ @Override
public int getTo() {
return _to;
}
+ @Override
public short getTotalCount() {
return _total_count;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_treat_as_binary_comparison = treat_as_binary_comparison;
}
+ @Override
public SortedSet<DomainSimilarity> calculateSimilarities( final PairwiseDomainSimilarityCalculator pairwise_calculator,
final List<GenomeWideCombinableDomains> cdc_list,
final boolean ignore_domains_without_combinations_in_any_genome,
}
final DescriptiveStatistics stat = new BasicDescriptiveStatistics();
final SortedMap<Species, SpeciesSpecificDomainSimilariyData> species_data = new TreeMap<Species, SpeciesSpecificDomainSimilariyData>();
- species_data.put( domains_list.get( 0 ).getSpecies(), createSpeciesSpecificDomainSimilariyData( domains_list
- .get( 0 ) ) );
+ species_data.put( domains_list.get( 0 ).getSpecies(),
+ createSpeciesSpecificDomainSimilariyData( domains_list.get( 0 ) ) );
int max_difference_in_counts = 0;
int max_difference = 0;
final boolean is_domain_combination_based = pairwise_calculator instanceof CombinationsBasedPairwiseDomainSimilarityCalculator;
}
private static SpeciesSpecificDomainSimilariyData createSpeciesSpecificDomainSimilariyData( final CombinableDomains cd ) {
- final SpeciesSpecificDomainSimilariyData sd = new PrintableSpeciesSpecificDomainSimilariyData( cd
- .getKeyDomainProteinsCount(), cd.getKeyDomainCount(), cd.getNumberOfCombinableDomains(), cd
- .getKeyDomainConfidenceDescriptiveStatistics() );
+ final SpeciesSpecificDomainSimilariyData sd = new PrintableSpeciesSpecificDomainSimilariyData( cd.getKeyDomainProteinsCount(),
+ cd.getKeyDomainCount(),
+ cd.getNumberOfCombinableDomains(),
+ cd.getKeyDomainConfidenceDescriptiveStatistics() );
for( final DomainId domain : cd.getCombinableDomains() ) {
sd.addProteinsExhibitingCombinationCount( domain, cd.getNumberOfProteinsExhibitingCombination( domain ) );
}
private final static NumberFormat FORMATTER = new DecimalFormat( "0.0E0" );
private static final Comparator<CombinableDomains> DESCENDING_KEY_DOMAIN_COUNT_ORDER = new Comparator<CombinableDomains>() {
+ @Override
public int compare( final CombinableDomains d1,
final CombinableDomains d2 ) {
- if ( d1
- .getKeyDomainCount() < d2
+ if ( d1.getKeyDomainCount() < d2
.getKeyDomainCount() ) {
return 1;
}
};
private static final Comparator<CombinableDomains> DESCENDING_KEY_DOMAIN_PROTEINS_COUNT_ORDER = new Comparator<CombinableDomains>() {
+ @Override
public int compare( final CombinableDomains d1,
final CombinableDomains d2 ) {
- if ( d1
- .getKeyDomainProteinsCount() < d2
+ if ( d1.getKeyDomainProteinsCount() < d2
.getKeyDomainProteinsCount() ) {
return 1;
}
};
private static final Comparator<CombinableDomains> DESCENDING_COMBINATIONS_COUNT_ORDER = new Comparator<CombinableDomains>() {
+ @Override
public int compare( final CombinableDomains d1,
final CombinableDomains d2 ) {
- if ( d1
- .getNumberOfCombinableDomains() < d2
+ if ( d1.getNumberOfCombinableDomains() < d2
.getNumberOfCombinableDomains() ) {
return 1;
}
_combinable_domains_map.put( key, cdc );
}
+ @Override
public boolean contains( final DomainId key_id ) {
return _combinable_domains_map.containsKey( key_id );
}
+ @Override
public CombinableDomains get( final DomainId key_id ) {
return _combinable_domains_map.get( key_id );
}
+ @Override
public SortedMap<DomainId, CombinableDomains> getAllCombinableDomainsIds() {
return _combinable_domains_map;
}
return stats;
}
+ @Override
public int getSize() {
return _combinable_domains_map.size();
}
+ @Override
public Species getSpecies() {
return _species;
}
// Produces something like:
// 2-oxoacid_dh 5 5 2 4.8E-67 Biotin_lipoyl [4], E3_binding [3]
+ @Override
public StringBuilder toStringBuilder( final GenomeWideCombinableDomainsSortOrder sort_order ) {
final StringBuilder sb = new StringBuilder();
final List<CombinableDomains> combinable_domains = new ArrayList<CombinableDomains>();
sb.append( ForesterUtil.pad( new StringBuffer( "" + cb.getKeyDomainCount() ), 8, ' ', false ) );
sb.append( ForesterUtil.pad( new StringBuffer( "" + cb.getKeyDomainProteinsCount() ), 8, ' ', false ) );
sb.append( ForesterUtil.pad( new StringBuffer( "" + cb.getNumberOfCombinableDomains() ), 8, ' ', false ) );
- sb
- .append( ForesterUtil
- .pad( new StringBuffer( ""
- + FORMATTER
- .format( cb.getKeyDomainConfidenceDescriptiveStatistics().median() ) ),
- 10,
- ' ',
- false ) );
+ sb.append( ForesterUtil.pad( new StringBuffer( ""
+ + FORMATTER.format( cb.getKeyDomainConfidenceDescriptiveStatistics()
+ .median() ) ),
+ 10,
+ ' ',
+ false ) );
sb.append( cb.getCombiningDomainIdsAsStringBuilder() );
sb.append( ForesterUtil.getLineSeparator() );
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
init();
}
+ @Override
public void addProteinDomain( final Domain protein_domain ) {
getProteinDomains().add( protein_domain );
}
return _name;
}
+ @Override
public int getNumberOfProteinDomains() {
return getProteinDomains().size();
}
+ @Override
public Domain getProteinDomain( final int index ) {
return _protein_domains.get( index );
}
+ @Override
public int getProteinDomainCount( final DomainId domain_id ) {
return getProteinDomains( domain_id ).size();
}
return ids;
}
+ @Override
public List<Domain> getProteinDomains() {
return _protein_domains;
}
+ @Override
public List<Domain> getProteinDomains( final DomainId domain_id ) {
final List<Domain> domains = new ArrayList<Domain>();
for( final Domain domain : getProteinDomains() ) {
return domains;
}
+ @Override
public ProteinId getProteinId() {
return _id;
}
+ @Override
public Species getSpecies() {
return _species;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
/* (non-Javadoc)
* @see org.forester.surfacing.Species#getSpeciesId()
*/
+ @Override
public String getSpeciesId() {
return _species_id;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* @return a String representation in the form id0 - id1
*/
+ @Override
public String toString();
public static enum DomainCombinationType {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
return _same_domains;
}
+ @Override
public double getSimilarityScore() {
return _score;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
public class CombinationsBasedPairwiseDomainSimilarityCalculator implements PairwiseDomainSimilarityCalculator {
+ @Override
public PairwiseDomainSimilarity calculateSimilarity( final CombinableDomains domains_1,
final CombinableDomains domains_2 ) {
if ( !domains_1.getKeyDomain().equals( domains_2.getKeyDomain() ) ) {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* Returns (counts for domain 1) minus (counts for domain 2).
*
*/
+ @Override
public int getDifferenceInCounts() {
return _copy_number_difference;
}
+ @Override
public double getSimilarityScore() {
return _score;
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
public class DomainCountsBasedPairwiseSimilarityCalculator implements PairwiseDomainSimilarityCalculator {
+ @Override
public PairwiseDomainSimilarity calculateSimilarity( final CombinableDomains domains_1,
final CombinableDomains domains_2 ) {
if ( !domains_1.getKeyDomain().equals( domains_2.getKeyDomain() ) ) {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
}
if ( bdc.contains( dc )
&& ( ( ( BasicCombinableDomains ) genome.get( dc.getId0() ) ).getCombiningDomains().get( dc.getId1() ) != null ) ) {
- final int count = ( ( BasicCombinableDomains ) genome.get( dc.getId0() ) ).getCombiningDomains().get( dc
- .getId1() );
+ final int count = ( ( BasicCombinableDomains ) genome.get( dc.getId0() ) ).getCombiningDomains()
+ .get( dc.getId1() );
copy_counts.get( dc ).add( count );
}
else {
for( final GenomeWideCombinableDomains genome : genomes ) {
final String species = genome.getSpecies().getSpeciesId();
if ( high_copy_base_species.contains( species ) ) {
- DomainCountsDifferenceUtil.addCounts( high_copy_base_copy_counts_dc, dc, genome, bdcs_per_genome
- .get( species ) );
+ DomainCountsDifferenceUtil.addCounts( high_copy_base_copy_counts_dc,
+ dc,
+ genome,
+ bdcs_per_genome.get( species ) );
}
if ( high_copy_target_species.contains( species ) ) {
- DomainCountsDifferenceUtil.addCounts( high_copy_target_copy_counts_dc, dc, genome, bdcs_per_genome
- .get( species ) );
+ DomainCountsDifferenceUtil.addCounts( high_copy_target_copy_counts_dc,
+ dc,
+ genome,
+ bdcs_per_genome.get( species ) );
}
if ( low_copy_species.contains( species ) ) {
- DomainCountsDifferenceUtil.addCounts( low_copy_copy_counts_dc, dc, genome, bdcs_per_genome
- .get( species ) );
+ DomainCountsDifferenceUtil.addCounts( low_copy_copy_counts_dc,
+ dc,
+ genome,
+ bdcs_per_genome.get( species ) );
}
}
}
}
html_writer.write( "</td><td>" );
if ( bdcs_per_genome.get( species ).contains( bdc ) && ( copy_means.get( bdc ) > 0 ) ) {
- final int count = ( ( BasicCombinableDomains ) genome.get( bdc.getId0() ) ).getCombiningDomains().get( bdc
- .getId1() );
+ final int count = ( ( BasicCombinableDomains ) genome.get( bdc.getId0() ) ).getCombiningDomains()
+ .get( bdc.getId1() );
html_writer.write( count + "" );
}
else {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2010 Christian M. Zmasek
// Copyright (C) 2008-2010 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2010 Christian M. Zmasek
// Copyright (C) 2008-2010 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// - 1 ) );
if ( pw_stats != null ) {
if ( pw_stats.getMin() >= pw_stats.getMax() ) {
- ForesterUtil.printWarningMessage( command_line_prg_name, "for [" + species_i + "-" + species_j
- + "] score minimum is [" + pw_stats.getMin() + "] while score maximum is ["
- + pw_stats.getMax() + "], possibly indicating that a genome is compared to itself" );
+ ForesterUtil
+ .printWarningMessage( command_line_prg_name, "for [" + species_i + "-" + species_j
+ + "] score minimum is [" + pw_stats.getMin() + "] while score maximum is ["
+ + pw_stats.getMax()
+ + "], possibly indicating that a genome is compared to itself" );
}
if ( display_histograms && ( pw_stats.getMin() < pw_stats.getMax() ) ) {
//final double[] values = pw_stats.getDataAsDoubleArray();
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
}
}
+ @Override
public int compareTo( final DomainSimilarity domain_similarity ) {
if ( this == domain_similarity ) {
return PrintableDomainSimilarity.EQUAL;
throw new AssertionError( "Unknown sort method: " + getSortField() );
}
+ @Override
public SortedSet<DomainId> getCombinableDomainIds( final Species species_of_combinable_domain ) {
final SortedSet<DomainId> sorted_ids = new TreeSet<DomainId>();
if ( getSpeciesData().containsKey( species_of_combinable_domain ) ) {
return _detailedness;
}
+ @Override
public DomainId getDomainId() {
return getCombinableDomains().getKeyDomain();
}
return _go_namespace_limit;
}
+ @Override
public int getMaximalDifference() {
return _max_difference;
}
return _max_difference_in_counts;
}
+ @Override
public double getMaximalSimilarityScore() {
return _max;
}
+ @Override
public double getMeanSimilarityScore() {
return _mean;
}
+ @Override
public double getMinimalSimilarityScore() {
return _min;
}
+ @Override
public int getN() {
return _n;
}
return _sort_field;
}
+ @Override
public SortedSet<Species> getSpecies() {
final SortedSet<Species> species = new TreeSet<Species>();
for( final Species s : getSpeciesData().keySet() ) {
return _species_order;
}
+ @Override
public SortedMap<Species, SpeciesSpecificDomainSimilariyData> getSpeciesData() {
return _species_data;
}
return sb;
}
+ @Override
public double getStandardDeviationOfSimilarityScore() {
return _sd;
}
return toStringBuffer( null ).toString();
}
+ @Override
public StringBuffer toStringBuffer( final PrintableDomainSimilarity.PRINT_OPTION print_option ) {
switch ( print_option ) {
case SIMPLE_TAB_DELIMITED:
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
_combinable_domain_id_to_count_map = new TreeMap<DomainId, Integer>();
}
+ @Override
public void addProteinsExhibitingCombinationCount( final DomainId domain_id, final int count ) {
if ( getCombinableDomainIdToCountsMap().containsKey( domain_id ) ) {
throw new IllegalArgumentException( "Domain with id " + domain_id + " already exists" );
getCombinableDomainIdToCountsMap().put( domain_id, count );
}
+ @Override
public SortedMap<DomainId, Integer> getCombinableDomainIdToCountsMap() {
return _combinable_domain_id_to_count_map;
}
return _key_domain_proteins_count;
}
+ @Override
public int getNumberOfProteinsExhibitingCombinationWith( final DomainId domain_id ) {
if ( !getCombinableDomainIdToCountsMap().containsKey( domain_id ) ) {
throw new IllegalArgumentException( "Domain with id " + domain_id + " not found" );
.toString();
}
+ @Override
public StringBuffer toStringBuffer( final DomainSimilarityCalculator.Detailedness detailedness, final boolean html ) {
final StringBuffer sb = new StringBuffer();
if ( detailedness == DomainSimilarityCalculator.Detailedness.PUNCTILIOUS ) {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
public class ProteinCountsBasedPairwiseDomainSimilarityCalculator implements PairwiseDomainSimilarityCalculator {
+ @Override
public PairwiseDomainSimilarity calculateSimilarity( final CombinableDomains domains_1,
final CombinableDomains domains_2 ) {
if ( !domains_1.getKeyDomain().equals( domains_2.getKeyDomain() ) ) {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
throw new RuntimeException( "method not implemented" );
}
+ @Override
public int compareTo( final Domain domain ) {
if ( this == domain ) {
return 0;
return getDomainId().compareTo( domain.getDomainId() );
}
+ @Override
public DomainId getDomainId() {
return _id;
}
+ @Override
public int getFrom() {
throw new RuntimeException( "method not implemented" );
}
throw new RuntimeException( "method not implemented" );
}
+ @Override
public short getNumber() {
throw new RuntimeException( "method not implemented" );
}
throw new RuntimeException( "method not implemented" );
}
+ @Override
public double getPerSequenceEvalue() {
throw new RuntimeException( "method not implemented" );
}
+ @Override
public double getPerSequenceScore() {
throw new RuntimeException( "method not implemented" );
}
throw new RuntimeException( "method not implemented" );
}
+ @Override
public int getTo() {
throw new RuntimeException( "method not implemented" );
}
+ @Override
public short getTotalCount() {
throw new RuntimeException( "method not implemented" );
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
private final static NumberFormat FORMATTER_3 = new DecimalFormat( "0.000" );
private static final Comparator<Domain> ASCENDING_CONFIDENCE_VALUE_ORDER = new Comparator<Domain>() {
+ @Override
public int compare( final Domain d1,
final Domain d2 ) {
if ( d1.getPerSequenceEvalue() < d2
SurfacingUtil.writeBinaryStatesMatrixAsListToFile( domain_parsimony.getGainLossMatrix(), null, outfile_name
+ surfacing_old.PARSIMONY_OUTPUT_FITCH_PRESENT_BC, sep, ForesterUtil.LINE_SEPARATOR, null );
if ( all_binary_domains_combination_gained_fitch != null ) {
- collectChangedDomainCombinationsFromBinaryStatesMatrixAsListToFile( domain_parsimony
- .getGainLossMatrix(), dc_type, all_binary_domains_combination_gained_fitch, true );
+ collectChangedDomainCombinationsFromBinaryStatesMatrixAsListToFile( domain_parsimony.getGainLossMatrix(),
+ dc_type,
+ all_binary_domains_combination_gained_fitch,
+ true );
}
if ( all_binary_domains_combination_lost_fitch != null ) {
- collectChangedDomainCombinationsFromBinaryStatesMatrixAsListToFile( domain_parsimony
- .getGainLossMatrix(), dc_type, all_binary_domains_combination_lost_fitch, false );
+ collectChangedDomainCombinationsFromBinaryStatesMatrixAsListToFile( domain_parsimony.getGainLossMatrix(),
+ dc_type,
+ all_binary_domains_combination_lost_fitch,
+ false );
}
if ( output_binary_domain_combinations_for_graphs ) {
SurfacingUtil
final String sep = ForesterUtil.LINE_SEPARATOR + "###################" + ForesterUtil.LINE_SEPARATOR;
final String date_time = ForesterUtil.getCurrentDateTime();
System.out.println();
- writeToNexus( outfile_name + surfacing_old.NEXUS_SECONDARY_FEATURES, secondary_features_parsimony
- .createMatrixOfSecondaryFeaturePresenceOrAbsence( null ), phylogeny );
+ writeToNexus( outfile_name + surfacing_old.NEXUS_SECONDARY_FEATURES,
+ secondary_features_parsimony.createMatrixOfSecondaryFeaturePresenceOrAbsence( null ),
+ phylogeny );
final Phylogeny local_phylogeny_copy = phylogeny.copy();
secondary_features_parsimony.executeDolloParsimonyOnSecondaryFeatures( mapping_results_map );
SurfacingUtil.writeMatrixToFile( secondary_features_parsimony.getGainLossMatrix(), outfile_name
ForesterUtil.programMessage( surfacing_old.PRG_NAME, "Pfams without mapping to proc. or func. : "
+ pfams_without_mappings_to_bp_or_mf_counter + " ["
+ ( 100 * pfams_without_mappings_to_bp_or_mf_counter / all_pfams_encountered.size() ) + "%]" );
- ForesterUtil.programMessage( surfacing_old.PRG_NAME, "Pfams with a mapping : "
- + pfams_with_mappings_counter + " ["
- + ( 100 * pfams_with_mappings_counter / all_pfams_encountered.size() ) + "%]" );
+ ForesterUtil.programMessage( surfacing_old.PRG_NAME,
+ "Pfams with a mapping : " + pfams_with_mappings_counter
+ + " ["
+ + ( 100 * pfams_with_mappings_counter / all_pfams_encountered.size() )
+ + "%]" );
ForesterUtil.programMessage( surfacing_old.PRG_NAME, "Pfams with a mapping to proc. or func. : "
+ pfams_with_mappings_to_bp_or_mf_counter + " ["
+ ( 100 * pfams_with_mappings_to_bp_or_mf_counter / all_pfams_encountered.size() ) + "%]" );
- ForesterUtil.programMessage( surfacing_old.PRG_NAME, "Pfams with mapping to biological process: "
- + biological_process_counter + " ["
- + ( 100 * biological_process_counter / all_pfams_encountered.size() ) + "%]" );
- ForesterUtil.programMessage( surfacing_old.PRG_NAME, "Pfams with mapping to molecular function: "
- + molecular_function_counter + " ["
- + ( 100 * molecular_function_counter / all_pfams_encountered.size() ) + "%]" );
- ForesterUtil.programMessage( surfacing_old.PRG_NAME, "Pfams with mapping to cellular component: "
- + cellular_component_counter + " ["
- + ( 100 * cellular_component_counter / all_pfams_encountered.size() ) + "%]" );
+ ForesterUtil.programMessage( surfacing_old.PRG_NAME,
+ "Pfams with mapping to biological process: " + biological_process_counter
+ + " ["
+ + ( 100 * biological_process_counter / all_pfams_encountered.size() )
+ + "%]" );
+ ForesterUtil.programMessage( surfacing_old.PRG_NAME,
+ "Pfams with mapping to molecular function: " + molecular_function_counter
+ + " ["
+ + ( 100 * molecular_function_counter / all_pfams_encountered.size() )
+ + "%]" );
+ ForesterUtil.programMessage( surfacing_old.PRG_NAME,
+ "Pfams with mapping to cellular component: " + cellular_component_counter
+ + " ["
+ + ( 100 * cellular_component_counter / all_pfams_encountered.size() )
+ + "%]" );
summary_writer.write( ForesterUtil.LINE_SEPARATOR );
summary_writer.write( "# Sum of Pfams encountered : " + all_pfams_encountered.size() );
summary_writer.write( ForesterUtil.LINE_SEPARATOR );
}
else {
per_genome_domain_promiscuity_statistics_writer.write( FORMATTER_3.format( stats
- .sampleStandardDeviation() )
- + "\t" );
+ .sampleStandardDeviation() ) + "\t" );
}
per_genome_domain_promiscuity_statistics_writer.write( FORMATTER_3.format( stats.median() ) + "\t" );
per_genome_domain_promiscuity_statistics_writer.write( ( int ) stats.getMin() + "\t" );
}
private static void writeToNexus( final String outfile_name, final DomainParsimonyCalculator domain_parsimony ) {
- writeToNexus( outfile_name + surfacing_old.NEXUS_EXTERNAL_DOMAINS, domain_parsimony
- .createMatrixOfDomainPresenceOrAbsence() );
- writeToNexus( outfile_name + surfacing_old.NEXUS_EXTERNAL_DOMAIN_COMBINATIONS, domain_parsimony
- .createMatrixOfBinaryDomainCombinationPresenceOrAbsence() );
+ writeToNexus( outfile_name + surfacing_old.NEXUS_EXTERNAL_DOMAINS,
+ domain_parsimony.createMatrixOfDomainPresenceOrAbsence() );
+ writeToNexus( outfile_name + surfacing_old.NEXUS_EXTERNAL_DOMAIN_COMBINATIONS,
+ domain_parsimony.createMatrixOfBinaryDomainCombinationPresenceOrAbsence() );
}
private static void writeToNexus( final String outfile_name,
final DomainParsimonyCalculator domain_parsimony,
final Phylogeny phylogeny ) {
- writeToNexus( outfile_name + surfacing_old.NEXUS_EXTERNAL_DOMAINS, domain_parsimony
- .createMatrixOfDomainPresenceOrAbsence(), phylogeny );
- writeToNexus( outfile_name + surfacing_old.NEXUS_EXTERNAL_DOMAIN_COMBINATIONS, domain_parsimony
- .createMatrixOfBinaryDomainCombinationPresenceOrAbsence(), phylogeny );
+ writeToNexus( outfile_name + surfacing_old.NEXUS_EXTERNAL_DOMAINS,
+ domain_parsimony.createMatrixOfDomainPresenceOrAbsence(),
+ phylogeny );
+ writeToNexus( outfile_name + surfacing_old.NEXUS_EXTERNAL_DOMAIN_COMBINATIONS,
+ domain_parsimony.createMatrixOfBinaryDomainCombinationPresenceOrAbsence(),
+ phylogeny );
}
}
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import org.forester.phylogeny.data.Polygon;
import org.forester.phylogeny.data.PropertiesMap;
import org.forester.phylogeny.data.Property;
+import org.forester.phylogeny.data.Property.AppliesTo;
import org.forester.phylogeny.data.ProteinDomain;
import org.forester.phylogeny.data.Taxonomy;
-import org.forester.phylogeny.data.Property.AppliesTo;
import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
import org.forester.phylogeny.factories.PhylogenyFactory;
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
if ( new_values.containsKey( TP_TAXONOMY_ID )
&& new_values.containsKey( TP_TAXONOMY_ID_PROVIDER ) ) {
ForesterUtil.ensurePresenceOfTaxonomy( node );
- node.getNodeData().getTaxonomy().setIdentifier( new Identifier( new_values
- .get( TP_TAXONOMY_ID ), new_values.get( TP_TAXONOMY_ID_PROVIDER ) ) );
+ node.getNodeData()
+ .getTaxonomy()
+ .setIdentifier( new Identifier( new_values.get( TP_TAXONOMY_ID ),
+ new_values.get( TP_TAXONOMY_ID_PROVIDER ) ) );
}
else if ( new_values.containsKey( TP_TAXONOMY_ID ) ) {
ForesterUtil.ensurePresenceOfTaxonomy( node );
- node.getNodeData().getTaxonomy().setIdentifier( new Identifier( new_values
- .get( TP_TAXONOMY_ID ) ) );
+ node.getNodeData().getTaxonomy()
+ .setIdentifier( new Identifier( new_values.get( TP_TAXONOMY_ID ) ) );
}
if ( new_values.containsKey( TP_TAXONOMY_SN ) ) {
ForesterUtil.ensurePresenceOfTaxonomy( node );
if ( new_values.containsKey( TP_SEQ_ACCESSION )
&& new_values.containsKey( TP_SEQ_ACCESSION_SOURCE ) ) {
ForesterUtil.ensurePresenceOfSequence( node );
- node.getNodeData().getSequence().setAccession( new Accession( new_values
- .get( TP_SEQ_ACCESSION ), new_values.get( TP_SEQ_ACCESSION_SOURCE ) ) );
+ node.getNodeData()
+ .getSequence()
+ .setAccession( new Accession( new_values.get( TP_SEQ_ACCESSION ),
+ new_values.get( TP_SEQ_ACCESSION_SOURCE ) ) );
}
if ( new_values.containsKey( TP_SEQ_ANNOTATION_DESC ) ) {
ForesterUtil.ensurePresenceOfSequence( node );
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#addValue(double)
*/
+ @Override
public void addValue( final double d ) {
_recalc_sigma = true;
_sum += d;
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#arithmeticMean()
*/
+ @Override
public double arithmeticMean() {
validate();
return getSum() / getN();
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#asSummary()
*/
+ @Override
public String asSummary() {
if ( getN() > 1 ) {
return arithmeticMean() + DescriptiveStatistics.PLUS_MINUS + sampleStandardDeviation() + " [" + getMin()
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#coefficientOfVariation()
*/
+ @Override
public double coefficientOfVariation() {
validate();
return ( sampleStandardDeviation() / arithmeticMean() );
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#getDataAsDoubleArray()
*/
+ @Override
public double[] getDataAsDoubleArray() {
validate();
final double[] data_array = new double[ getN() ];
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#getMax()
*/
+ @Override
public double getMax() {
validate();
return _max;
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#getMin()
*/
+ @Override
public double getMin() {
validate();
return _min;
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#getN()
*/
+ @Override
public int getN() {
return _data.size();
}
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#getSum()
*/
+ @Override
public double getSum() {
validate();
return _sum;
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#getSummaryAsString()
*/
+ @Override
public String getSummaryAsString() {
validate();
final double mean = arithmeticMean();
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#getValue(int)
*/
+ @Override
public double getValue( final int index ) {
validate();
return ( ( ( _data.get( index ) ) ).doubleValue() );
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#median()
*/
+ @Override
public double median() {
validate();
double median = 0.0;
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#midrange()
*/
+ @Override
public double midrange() {
validate();
return ( _min + _max ) / 2.0;
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#pearsonianSkewness()
*/
+ @Override
public double pearsonianSkewness() {
validate();
final double mean = arithmeticMean();
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#sampleStandardDeviation()
*/
+ @Override
public double sampleStandardDeviation() {
return Math.sqrt( sampleVariance() );
}
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#sampleStandardUnit(double)
*/
+ @Override
public double sampleStandardUnit( final double value ) {
validate();
return BasicDescriptiveStatistics.sampleStandardUnit( value, arithmeticMean(), sampleStandardDeviation() );
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#sampleVariance()
*/
+ @Override
public double sampleVariance() {
validate();
if ( getN() < 2 ) {
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#standardErrorOfMean()
*/
+ @Override
public double standardErrorOfMean() {
validate();
return ( sampleStandardDeviation() / Math.sqrt( getN() ) );
/* (non-Javadoc)
* @see org.forester.util.DescriptiveStatisticsI#sumDeviations()
*/
+ @Override
public double sumDeviations() {
validate();
if ( _recalc_sigma ) {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
public abstract double sumDeviations();
+ @Override
public abstract String toString();
}
\ No newline at end of file
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2000-2009 Christian M. Zmasek
// Copyright (C) 2007-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
import org.forester.io.parsers.nexus.NexusPhylogeniesParser;
import org.forester.io.parsers.nhx.NHXParser;
import org.forester.io.parsers.phyloxml.PhyloXmlParser;
+import org.forester.io.parsers.phyloxml.PhyloXmlUtil;
import org.forester.io.parsers.tol.TolParser;
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.PhylogenyMethods;
import org.forester.phylogeny.PhylogenyNode;
import org.forester.phylogeny.data.Confidence;
import org.forester.phylogeny.data.Distribution;
+import org.forester.phylogeny.data.Identifier;
import org.forester.phylogeny.data.Sequence;
import org.forester.phylogeny.data.Taxonomy;
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
}
n.getNodeData().getSequence().setName( name );
break;
+ case TAXONOMY_ID_UNIPROT_1: {
+ if ( !n.getNodeData().isHasTaxonomy() ) {
+ n.getNodeData().setTaxonomy( new Taxonomy() );
+ }
+ String id = name;
+ final int i = name.indexOf( '_' );
+ if ( i > 0 ) {
+ id = name.substring( i, name.length() );
+ }
+ else {
+ n.setName( "" );
+ }
+ n.getNodeData().getTaxonomy()
+ .setIdentifier( new Identifier( id, PhyloXmlUtil.UNIPROT_TAX_PROVIDER ) );
+ break;
+ }
+ case TAXONOMY_ID_UNIPROT_2: {
+ if ( !n.getNodeData().isHasTaxonomy() ) {
+ n.getNodeData().setTaxonomy( new Taxonomy() );
+ }
+ String id = name;
+ final int i = name.indexOf( '_' );
+ if ( i > 0 ) {
+ id = name.substring( 0, i );
+ }
+ else {
+ n.setName( "" );
+ }
+ n.getNodeData().getTaxonomy()
+ .setIdentifier( new Identifier( id, PhyloXmlUtil.UNIPROT_TAX_PROVIDER ) );
+ break;
+ }
}
}
}
}
public static enum PhylogenyNodeField {
- CLADE_NAME, TAXONOMY_CODE, TAXONOMY_SCIENTIFIC_NAME, TAXONOMY_COMMON_NAME, SEQUENCE_SYMBOL, SEQUENCE_NAME;
+ CLADE_NAME,
+ TAXONOMY_CODE,
+ TAXONOMY_SCIENTIFIC_NAME,
+ TAXONOMY_COMMON_NAME,
+ SEQUENCE_SYMBOL,
+ SEQUENCE_NAME,
+ TAXONOMY_ID_UNIPROT_1,
+ TAXONOMY_ID_UNIPROT_2;
}
public static enum TAXONOMY_EXTRACTION {
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
// Copyright (C) 2010 Christian M Zmasek
// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA