ajtree.c


Function ajTreeNew

Creates a new general tree.

Prototype

AjPTree ajTreeNew (
      void
);

TypeNameRead/WriteDescription
AjPTree RETURNnew tree;

From EMBOSS 2.9.0


Function ajTreeNewNewick

Creates a new general tree using a Newick's format phylogenetic tree as input

Prototype

AjPTree ajTreeNewNewick (
      const AjPStr newick
);

TypeNameRead/WriteDescription
const AjPStrnewickInputNewick's format tree
AjPTree RETURNnew tree;

From EMBOSS 6.0.0


Function ajTreestrNew

Creates a new string tree.

Prototype

AjPTree ajTreestrNew (
      void
);

TypeNameRead/WriteDescription
AjPTree RETURNnew tree;

From EMBOSS 2.9.0


Function ajTreestrCopy

Copy a string tree.

Prototype

AjPTree ajTreestrCopy (
      const AjPTree thys
);

TypeNameRead/WriteDescription
const AjPTreethysInputTree to be copied
AjPTree RETURNNew, copied, tree.

From EMBOSS 2.9.0


Function ajTreeCopy

Copy a tree.

Prototype

AjPTree ajTreeCopy (
      const AjPTree thys
);

TypeNameRead/WriteDescription
const AjPTreethysInputtree to be copied
AjPTree RETURNnew copied tree.

From EMBOSS 2.9.0


Function ajTreeLength

get the number of nodes in the linked tree.

Prototype

ajuint ajTreeLength (
      const AjPTree thys
);

TypeNameRead/WriteDescription
const AjPTreethysInputTree
ajuint RETURNNumber of nodes in tree.

From EMBOSS 2.9.0


Function ajTreestrLength

get the number of nodes in the linked tree.

Prototype

ajuint ajTreestrLength (
      const AjPTree thys
);

TypeNameRead/WriteDescription
const AjPTreethysInputTree
ajuint RETURNNumber of nodes in tree.

From EMBOSS 2.9.0


Function ajTreeFree

Free all nodes in the tree. NOTE: The data is only freed with a specified tree type. For undefined data types we recommend you to use ajTreeMap with a routine to free the memory.

Prototype

void ajTreeFree (
      AjPTree* pthis
);

TypeNameRead/WriteDescription
AjPTree*pthisDeleteTree
void RETURN

From EMBOSS 2.9.0


Function ajTreestrFree

Free all nodes in a string tree. Also deletes all the strings. If these are to be preserved, use ajTreestrDel instead.

Prototype

void ajTreestrFree (
      AjPTree* pthis
);

TypeNameRead/WriteDescription
AjPTree*pthisDeleteTree
void RETURN

From EMBOSS 2.9.0


Function ajTreeDel

Free the tree. Do not attempt to free the nodes. For use where the node data has been saved elsewhere, for example by ajTreeToArray or where the tree is a temporary structure referring to permanent data.

Prototype

void ajTreeDel (
      AjPTree* pthis
);

TypeNameRead/WriteDescription
AjPTree*pthisDeleteTree
void RETURN

From EMBOSS 2.9.0


Function ajTreestrDel

Free the tree. Do not attempt to free the nodes. For use where the node data has been saved elsewhere, for example by ajTreeToArray or where the tree is a temporary structure referring to permanent data.

Prototype

void ajTreestrDel (
      AjPTree* pthis
);

TypeNameRead/WriteDescription
AjPTree*pthisDeleteTree
void RETURN

From EMBOSS 2.9.0


Function ajTreeMap

For each data node in the tree call function apply.

Prototype

void ajTreeMap (
      AjPTree thys,
      void function apply,
      void* cl
);

TypeNameRead/WriteDescription
AjPTreethysModifyTree.
void functionapplyFunctionFunction to call for each tree item.
void*clModifyStandard, usually NULL.
void RETURN

From EMBOSS 2.9.0


Function ajTreestrMap

For each node in the tree call function apply, with the address of the string and a client pointer.

Prototype

void ajTreestrMap (
      AjPTree thys,
      void function apply,
      void* cl
);

TypeNameRead/WriteDescription
AjPTreethysModifyTree.
void functionapplyFunctionFunction to call for each tree item.
void*clModifyStandard, usually NULL.
void RETURN

From EMBOSS 2.9.0


Function ajTreeToArray

Create an array of the pointers to the data.

Prototype

ajuint ajTreeToArray (
      const AjPTree thys,
      void*** array
);

TypeNameRead/WriteDescription
const AjPTreethysInputTree
void***arrayOutputArray of pointers to tree items.
ajuint RETURNSize of array of pointers.

From EMBOSS 2.9.0


Function ajTreestrToArray

Create an array of the pointers to the data.

Prototype

ajuint ajTreestrToArray (
      const AjPTree thys,
      AjPStr** array
);

TypeNameRead/WriteDescription
const AjPTreethysInputTree
AjPStr**arrayOutputArray of Strings.
ajuint RETURNSize of array of pointers.

From EMBOSS 2.9.0


Function ajTreeDummyFunction

Dummy function to catch all unused functions defined in ajtree

Prototype

void ajTreeDummyFunction (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 2.9.0


Function ajTreeAddData

Sets the data value in a terminal tree node.

Prototype

AjBool ajTreeAddData (
      AjPTree thys,
      const AjPStr name,
      void* data
);

TypeNameRead/WriteDescription
AjPTreethysModifyTerminal tree node. Must have no descendants
const AjPStrnameInputLeaf name
void*dataUnknownData value
AjBool RETURNajTrue on success

From EMBOSS 2.9.0


Function ajTreestrAddData

Sets the data value in a terminal string tree node.

Prototype

AjBool ajTreestrAddData (
      AjPTree thys,
      const AjPStr name,
      AjPStr data
);

TypeNameRead/WriteDescription
AjPTreethysModifyTerminal tree node. Must have no descendants
const AjPStrnameInputLeaf name
AjPStrdataUnknownData value
AjBool RETURNajTrue on success

From EMBOSS 4.1.0


Function ajTreeAddNode

Creates a new child node of the parent

Prototype

AjPTree ajTreeAddNode (
      AjPTree thys
);

TypeNameRead/WriteDescription
AjPTreethysModifyParent tree node
AjPTree RETURNNew tree node created. It has no data value so far, so ajTreeAddNode or ajTreeAddData should be called to define data or further nodes.

From EMBOSS 2.9.0


Function ajTreeAddSubNode

Creates a new sibling node of the parent

Prototype

AjPTree ajTreeAddSubNode (
      AjPTree thys
);

TypeNameRead/WriteDescription
AjPTreethysModifyLeft tree node
AjPTree RETURNNew tree node created. It has no data value so far, so ajTreeAddNode or ajTreeAddData should be called to define data or further nodes.

From EMBOSS 2.9.0


Function ajTreeToNewick

Prints a trace of a tree to debug output

Prototype

void ajTreeToNewick (
      const AjPTree thys,
      AjPStr* Pnewick
);

TypeNameRead/WriteDescription
const AjPTreethysInputTree object
AjPStr*PnewickOutputNewick format string
void RETURN

From EMBOSS 6.0.0


Function ajTreeTrace

Prints a trace of a tree to debug output

Prototype

void ajTreeTrace (
      const AjPTree thys
);

TypeNameRead/WriteDescription
const AjPTreethysInputTree object
void RETURN

From EMBOSS 2.9.0


Function ajTreestrTrace

Prints a trace of a string tree to debug output

Prototype

void ajTreestrTrace (
      const AjPTree thys
);

TypeNameRead/WriteDescription
const AjPTreethysInputTree object
void RETURN

From EMBOSS 4.1.0


Function ajTreeFollow

Returns the next node through the tree.

Prototype

AjPTree ajTreeFollow (
      const AjPTree thys,
      const AjPTree parent
);

TypeNameRead/WriteDescription
const AjPTreethysInputCurrent tree node
const AjPTreeparentInputParent tree node
AjPTree RETURNNew tree node created. It has no data value so far, so ajTreeAddNode or ajTreeAddData should be called to define data or further nodes.

From EMBOSS 4.1.0


Function ajTreeNext

Returns the next node at the same level

Prototype

AjPTree ajTreeNext (
      const AjPTree thys
);

TypeNameRead/WriteDescription
const AjPTreethysInputParent tree node
AjPTree RETURNNew tree node created. It has no data value so far, so ajTreeAddNode or ajTreeAddData should be called to define data or further nodes.

From EMBOSS 4.1.0


Function ajTreePrev

Returns the previous node at the same level

Prototype

AjPTree ajTreePrev (
      const AjPTree thys
);

TypeNameRead/WriteDescription
const AjPTreethysInputParent tree node
AjPTree RETURNNew tree node created. It has no data value so far, so ajTreeAddNode or ajTreeAddData should be called to define data or further nodes.

From EMBOSS 4.1.0


Function ajTreeDown

Returns the next node down 1 level

Prototype

AjPTree ajTreeDown (
      const AjPTree thys
);

TypeNameRead/WriteDescription
const AjPTreethysInputParent tree node
AjPTree RETURNNew tree node created. It has no data value so far, so ajTreeAddNode or ajTreeAddData should be called to define data or further nodes.

From EMBOSS 4.1.0


Function ajTreeUp

Returns the parent of the present node

Prototype

AjPTree ajTreeUp (
      const AjPTree thys
);

TypeNameRead/WriteDescription
const AjPTreethysInputChild tree node
AjPTree RETURNNew tree node created. It has no data value so far, so ajTreeAddNode or ajTreeAddData should be called to define data or further nodes.

From EMBOSS 4.1.0


Function ajTreeExit

Prints a summary of tree usage with debug calls

Prototype

void ajTreeExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 2.9.0