import org.forester.phylogeny.PhylogenyMethods;
import org.forester.phylogeny.PhylogenyNode;
import org.forester.phylogeny.data.Accession;
-import org.forester.phylogeny.data.Annotation;
import org.forester.phylogeny.data.Confidence;
import org.forester.phylogeny.data.DomainArchitecture;
import org.forester.phylogeny.data.Event;
import org.forester.phylogeny.data.Identifier;
import org.forester.phylogeny.data.PhylogenyDataUtil;
-import org.forester.phylogeny.data.PropertiesMap;
-import org.forester.phylogeny.data.Property;
import org.forester.phylogeny.data.Sequence;
import org.forester.phylogeny.data.Taxonomy;
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
}
node_to_annotate.getNodeData().getTaxonomy().setScientificName( s.substring( 2 ) );
}
- else if ( s.startsWith( org.forester.io.parsers.nhx.NHXtags.ANNOTATION ) ) {
- if ( !node_to_annotate.getNodeData().isHasSequence() ) {
- node_to_annotate.getNodeData().setSequence( new Sequence() );
- }
- final Annotation annotation = new Annotation( "_:_" );
- annotation.setDesc( s.substring( 3 ) );
- node_to_annotate.getNodeData().getSequence().addAnnotation( annotation );
- }
else if ( s.startsWith( org.forester.io.parsers.nhx.NHXtags.IS_DUPLICATION ) ) {
if ( ( s.charAt( 2 ) == 'Y' ) || ( s.charAt( 2 ) == 'T' ) ) {
node_to_annotate.getNodeData().setEvent( Event.createSingleDuplicationEvent() );
PhylogenyMethods.setBranchColorValue( node_to_annotate, c );
}
}
- else if ( s.startsWith( NHXtags.CUSTOM_DATA_ON_NODE ) ) {
- if ( !node_to_annotate.getNodeData().isHasProperties() ) {
- node_to_annotate.getNodeData().setProperties( new PropertiesMap() );
- }
- node_to_annotate.getNodeData().getProperties().addProperty( Property.createFromNhxString( s ) );
- }
else if ( s.startsWith( NHXtags.DOMAIN_STRUCTURE ) ) {
if ( !node_to_annotate.getNodeData().isHasSequence() ) {
node_to_annotate.getNodeData().setSequence( new Sequence() );
import org.forester.phylogeny.PhylogenyMethods;
import org.forester.phylogeny.PhylogenyNode;
import org.forester.phylogeny.data.Accession;
-import org.forester.phylogeny.data.Annotation;
import org.forester.phylogeny.data.Confidence;
import org.forester.phylogeny.data.DomainArchitecture;
import org.forester.phylogeny.data.Event;
import org.forester.phylogeny.data.Identifier;
import org.forester.phylogeny.data.PhylogenyDataUtil;
-import org.forester.phylogeny.data.PropertiesMap;
-import org.forester.phylogeny.data.Property;
import org.forester.phylogeny.data.Sequence;
import org.forester.phylogeny.data.Taxonomy;
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
} // while ( true )
System.out.println( "done with loop" );
if ( getCladeLevel() != 0 ) {
- // setPhylogenies( null );
- // throw new PhylogenyParserException( "error in NH (Newick)/NHX formatted data: most likely cause: number of open parens does not equal number of close parens" );
+ throw new PhylogenyParserException( "error in NH (Newick)/NHX formatted data: most likely cause: number of open parens does not equal number of close parens" );
}
if ( getCurrentPhylogeny() != null ) {
return finishPhylogeny2();
}
node_to_annotate.getNodeData().getTaxonomy().setScientificName( s.substring( 2 ) );
}
- else if ( s.startsWith( org.forester.io.parsers.nhx.NHXtags.ANNOTATION ) ) {
- if ( !node_to_annotate.getNodeData().isHasSequence() ) {
- node_to_annotate.getNodeData().setSequence( new Sequence() );
- }
- final Annotation annotation = new Annotation( "_:_" );
- annotation.setDesc( s.substring( 3 ) );
- node_to_annotate.getNodeData().getSequence().addAnnotation( annotation );
- }
else if ( s.startsWith( org.forester.io.parsers.nhx.NHXtags.IS_DUPLICATION ) ) {
if ( ( s.charAt( 2 ) == 'Y' ) || ( s.charAt( 2 ) == 'T' ) ) {
node_to_annotate.getNodeData().setEvent( Event.createSingleDuplicationEvent() );
PhylogenyMethods.setBranchColorValue( node_to_annotate, c );
}
}
- else if ( s.startsWith( NHXtags.CUSTOM_DATA_ON_NODE ) ) {
- if ( !node_to_annotate.getNodeData().isHasProperties() ) {
- node_to_annotate.getNodeData().setProperties( new PropertiesMap() );
- }
- node_to_annotate.getNodeData().getProperties().addProperty( Property.createFromNhxString( s ) );
- }
else if ( s.startsWith( NHXtags.DOMAIN_STRUCTURE ) ) {
if ( !node_to_annotate.getNodeData().isHasSequence() ) {
node_to_annotate.getNodeData().setSequence( new Sequence() );
public final class NHXtags {
- public static final String CUSTOM_DATA_ON_NODE = "XN=";
public static final String COLOR = "C=";
public static final String PARENT_BRANCH_WIDTH = "W=";
- public static final String SUBTREE_NEIGHBORS = "SNn=";
- public static final String SUPER_ORTHOLOGOUS = "SOn=";
- public static final String ORTHOLOGOUS = "On=";
public static final String TAXONOMY_ID = "T=";
public static final String SUPPORT = "B=";
public static final String IS_DUPLICATION = "D=";
- public static final String ANNOTATION = "AN=";
public static final String SPECIES_NAME = "S=";
public static final String DOMAIN_STRUCTURE = "DS=";
public static final String GENE_NAME = "GN=";
if ( PhylogenyMethods.getBranchWidthValue( n5 ) != 2 ) {
return false;
}
- if ( n5.getNodeData().getProperties().getPropertyRefs().length != 2 ) {
- return false;
- }
final PhylogenyNode n8 = PhylogenyNode
.createInstanceFromNhxString( "n8_ECOLI/12:0.01", NHXParser.TAXONOMY_EXTRACTION.PFAM_STYLE_ONLY );
if ( !n8.getName().equals( "n8_ECOLI/12" ) ) {
if ( !PhylogenyMethods.getSpecies( o ).equals( "MOUSE" ) ) {
return false;
}
- final Property tvu1 = n5.getNodeData().getProperties().getProperty( "tag1" );
- final Property tvu3 = n5.getNodeData().getProperties().getProperty( "tag3" );
- if ( !tvu1.getRef().equals( "tag1" ) ) {
- return false;
- }
- if ( !tvu1.getDataType().equals( "xsd:string" ) ) {
- return false;
- }
- if ( !tvu1.getUnit().equals( "unit1" ) ) {
- return false;
- }
- if ( !tvu1.getValue().equals( "value1" ) ) {
- return false;
- }
- if ( !tvu3.getRef().equals( "tag3" ) ) {
- return false;
- }
- if ( !tvu3.getDataType().equals( "xsd:string" ) ) {
- return false;
- }
- if ( !tvu3.getUnit().equals( "unit3" ) ) {
- return false;
- }
- if ( !tvu3.getValue().equals( "value3" ) ) {
- return false;
- }
if ( n1.getName().compareTo( "" ) != 0 ) {
return false;
}
if ( !n00.getNodeData().getSequence().getAccession().getValue().equals( "accession123" ) ) {
return false;
}
- if ( !n00.getNodeData().getProperties().getProperty( "url_tag" ).getRef().equals( "url_tag" ) ) {
- return false;
- }
- if ( n00.getNodeData().getProperties().getProperty( "url_tag" ).getAppliesTo() != Property.AppliesTo.NODE ) {
- return false;
- }
- if ( !n00.getNodeData().getProperties().getProperty( "url_tag" ).getDataType().equals( "xsd:anyURI" ) ) {
- return false;
- }
- if ( !n00.getNodeData().getProperties().getProperty( "url_tag" ).getValue().equals( "www.yahoo.com" ) ) {
- return false;
- }
- if ( !n00.getNodeData().getProperties().getProperty( "url_tag" ).getUnit().equals( "" ) ) {
- return false;
- }
final PhylogenyNode nx = PhylogenyNode.createInstanceFromNhxString( "n5:0.1[&&NHX:S=Ecoli:GN=gene_1]" );
if ( !nx.getNodeData().getSequence().getName().equals( "gene_1" ) ) {
return false;