ajoboread.c

Datatypes: AjPOboin AjPOboall none AjPStr AjPQuery AjPOboData AjPStr none AjPTable


Datatype: AjPOboin

Obo Input

Sections: Obo Input Constructors Obo Input Destructors obo input modifiers casts obo term inputs


Section: Obo Input Constructors

All constructors return a new obo input object by pointer. It is the responsibility of the user to first destroy any previous obo term input object. The target pointer does not need to be initialised to NULL, but it is good programming practice to do so anyway.

Functions: ajOboinNew


Function ajOboinNew

Creates a new obo input object.

Synopsis

Prototype
AjPOboin ajOboinNew (
      void
);

TypeNameRead/WriteDescription
AjPOboin RETURNNew obo input object.

Returns
AjPOboin:New obo input object.

Description

Creates a new obo input object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Obo Input Destructors

Destruction destroys all internal data structures and frees the memory allocated for the obo input object.

Functions: ajOboinDel


Function ajOboinDel

Deletes an obo input object.

Synopsis

Prototype
void ajOboinDel (
      AjPOboin* pthis
);

TypeNameRead/WriteDescription
AjPOboin*pthisDeleteObo input
void RETURN

Output
pthis:(Delete)Obo input
Returns
void:No return value

Description

Deletes an obo input object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: obo input modifiers

These functions use the contents of an obo term input object and update them.

Functions: ajOboinClear ajOboinQryC ajOboinQryS


Function ajOboinClear

Clears an obo term input object back to "as new" condition, except for the query list which must be preserved.

Synopsis

Prototype
void ajOboinClear (
      AjPOboin thys
);

TypeNameRead/WriteDescription
AjPObointhysOutputobo term input
void RETURN

Output
thys:(Output)obo term input
Returns
void:No return value

Description

Clears an obo term input object back to "as new" condition, except for the query list which must be preserved.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboinQryC

Resets an obo term input object using a new Universal obo term Address

Synopsis

Prototype
void ajOboinQryC (
      AjPOboin thys,
      const char* txt
);

TypeNameRead/WriteDescription
AjPObointhysModifyobo term input object.
const char*txtInputQuery
void RETURN

Input
txt:(Input)Query
Input & Output
thys:(Modify)obo term input object.
Returns
void:No return value

Description

Resets an obo term input object using a new Universal obo term Address

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboinQryS

Resets an obo term input object using a new Universal obo term Address

Synopsis

Prototype
void ajOboinQryS (
      AjPOboin thys,
      const AjPStr str
);

TypeNameRead/WriteDescription
AjPObointhysModifyobo term input object.
const AjPStrstrInputQuery
void RETURN

Input
str:(Input)Query
Input & Output
thys:(Modify)obo term input object.
Returns
void:No return value

Description

Resets an obo term input object using a new Universal obo term Address

See Also

See other functions in this section

Availability

In release 6.4.0

Section: casts

Return values

Functions: ajOboinGetQryS ajOboinTrace


Function ajOboinGetQryS

Returns the query of an obo term input object

Synopsis

Prototype
const AjPStr ajOboinGetQryS (
      const AjPOboin thys
);

TypeNameRead/WriteDescription
const AjPObointhysInputobo term input object.
const AjPStr RETURNQuery string

Input
thys:(Input)obo term input object.
Returns
const AjPStr:Query string

Description

Returns the query of an obo term input object

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboinTrace

Debug calls to trace the data in an obo term input object.

Synopsis

Prototype
void ajOboinTrace (
      const AjPOboin thys
);

TypeNameRead/WriteDescription
const AjPObointhysInputobo term input object.
void RETURN

Input
thys:(Input)obo term input object.
Returns
void:No return value

Description

Debug calls to trace the data in an obo term input object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: obo term inputs

These functions read the obo term provided by the first argument

Functions: ajOboinRead


Function ajOboinRead

If the file is not yet open, calls oboinQryProcess to convert the query into an open file stream.

Uses oboinRead for the actual file reading.

Returns the results in the AjPObo object.

Synopsis

Prototype
AjBool ajOboinRead (
      AjPOboin oboin,
      AjPObo obo
);

TypeNameRead/WriteDescription
AjPOboinoboinModifyobo term input definitions
AjPObooboOutputobo term returned.
AjBool RETURNajTrue on success.

Output
obo:(Output)obo term returned.
Input & Output
oboin:(Modify)obo term input definitions
Returns
AjBool:ajTrue on success.

Description

If the file is not yet open, calls oboinQryProcess to convert the query into an open file stream.

Uses oboinRead for the actual file reading.

Returns the results in the AjPObo object.

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPOboall

Obo Input Stream

Sections: Obo Input Constructors OBO Input Stream Destructors obo input stream modifiers obo input stream casts obo input


Section: Obo Input Constructors

All constructors return a new obo input stream object by pointer. It is the responsibility of the user to first destroy any previous obo term input object. The target pointer does not need to be initialised to NULL, but it is good programming practice to do so anyway.

Functions: ajOboallNew


Function ajOboallNew

Creates a new obo input stream object.

Synopsis

Prototype
AjPOboall ajOboallNew (
      void
);

TypeNameRead/WriteDescription
AjPOboall RETURNNew obo input stream object.

Returns
AjPOboall:New obo input stream object.

Description

Creates a new obo input stream object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: OBO Input Stream Destructors

Destruction destroys all internal data structures and frees the memory allocated for the obo input stream object.

Functions: ajOboallDel


Function ajOboallDel

Deletes an obo input stream object.

Synopsis

Prototype
void ajOboallDel (
      AjPOboall* pthis
);

TypeNameRead/WriteDescription
AjPOboall*pthisDeleteObo input stream
void RETURN

Output
pthis:(Delete)Obo input stream
Returns
void:No return value

Description

Deletes an obo input stream object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: obo input stream modifiers

These functions use the contents of an obo term input stream object and update them.

Functions: ajOboallClear


Function ajOboallClear

Clears an obo term input stream object back to "as new" condition, except for the query list which must be preserved.

Synopsis

Prototype
void ajOboallClear (
      AjPOboall thys
);

TypeNameRead/WriteDescription
AjPOboallthysOutputobo term input stream
void RETURN

Output
thys:(Output)obo term input stream
Returns
void:No return value

Description

Clears an obo term input stream object back to "as new" condition, except for the query list which must be preserved.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: obo input stream casts

These functions return the contents of an obo term input stream object

Functions: ajOboallGetQryS ajOboallGetoboId


Function ajOboallGetQryS

Returns the query of an input stream

Synopsis

Prototype
const AjPStr ajOboallGetQryS (
      const AjPOboall thys
);

TypeNameRead/WriteDescription
const AjPOboallthysInputobo term input stream
const AjPStr RETURNIdentifier

Input
thys:(Input)obo term input stream
Returns
const AjPStr:Identifier

Description

Returns the query of an input stream

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboallGetoboId

Returns the identifier of the current obo term in an input stream

Synopsis

Prototype
const AjPStr ajOboallGetoboId (
      const AjPOboall thys
);

TypeNameRead/WriteDescription
const AjPOboallthysInputobo term input stream
const AjPStr RETURNIdentifier

Input
thys:(Input)obo term input stream
Returns
const AjPStr:Identifier

Description

Returns the identifier of the current obo term in an input stream

See Also

See other functions in this section

Availability

In release 6.4.0

Section: obo input

These functions use an obo term input stream object to read data

Functions: ajOboallNext


Function ajOboallNext

Parse an OBO query into format, access, file and entry

Split at delimiters. Check for the first part as a valid format Check for the remaining first part as a database name or as a file that can be opened. Anything left is an entryname spec.

Return the results in the AjPObo object but leave the file open for future calls.

Synopsis

Prototype
AjBool ajOboallNext (
      AjPOboall thys,
      AjPObo* Pobo
);

TypeNameRead/WriteDescription
AjPOboallthysOutputObo term input stream
AjPObo*PoboModifyObo term returned
AjBool RETURNajTrue on success.

Output
thys:(Output)Obo term input stream
Input & Output
Pobo:(Modify)Obo term returned
Returns
AjBool:ajTrue on success.

Description

Parse an OBO query into format, access, file and entry

Split at delimiters. Check for the first part as a valid format Check for the remaining first part as a database name or as a file that can be opened. Anything left is an entryname spec.

Return the results in the AjPObo object but leave the file open for future calls.

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: none

Input formats

Sections: cast


Section: cast

Values for input formats

Functions: ajOboinformatTerm ajOboinformatTest


Function ajOboinformatTerm

tests whether an OBO input format term is known

Synopsis

Prototype
AjBool ajOboinformatTerm (
      const AjPStr term
);

TypeNameRead/WriteDescription
const AjPStrtermInputFormat term EDAM ID
AjBool RETURNajTrue if term was accepted

Input
term:(Input)Format term EDAM ID
Returns
AjBool:ajTrue if term was accepted

Description

tests whether an OBO input format term is known

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboinformatTest

tests whether a named OBO input format is known

Synopsis

Prototype
AjBool ajOboinformatTest (
      const AjPStr format
);

TypeNameRead/WriteDescription
const AjPStrformatInputFormat
AjBool RETURNajTrue if format was accepted

Input
format:(Input)Format
Returns
AjBool:ajTrue if format was accepted

Description

tests whether a named OBO input format is known

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPStr

Query string

Sections: Casts


Section: Casts

returns attributes of a query string

Functions: ajOboqryGetObo


Function ajOboqryGetObo

Returns an obo term given a query

Synopsis

Prototype
AjBool ajOboqryGetObo (
      const AjPStr qry,
      AjPObo obo
);

TypeNameRead/WriteDescription
const AjPStrqryInputQuery
AjPObooboModifyobo term
AjBool RETURNajTrue on success

Input
qry:(Input)Query
Input & Output
obo:(Modify)obo term
Returns
AjBool:ajTrue on success

Description

Returns an obo term given a query

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPQuery

Obo query objects

Sections: Query Casts


Section: Query Casts

These functions examine the contents of query object and return some derived information. Some of them provide access to the internal components of a query object. They are provided for programming convenience but should be used with caution.

Functions: ajOboqueryGetallObofields


Function ajOboqueryGetallObofields

Returns the standard obo query string from a query

Synopsis

Prototype
ajuint ajOboqueryGetallObofields (
      const AjPQuery query,
      const AjPStr* id,
      const AjPStr* acc,
      const AjPStr* nam,
      const AjPStr* des,
      const AjPStr* up,
      const AjPStr* space
);

TypeNameRead/WriteDescription
const AjPQueryqueryInputQuery
const AjPStr*idOutputId query
const AjPStr*accOutputAccession query
const AjPStr*namOutputName query
const AjPStr*desOutputDescription query
const AjPStr*upOutputParent query
const AjPStr*spaceOutputNamespace query
ajuint RETURNNumber of fields found

Input
query:(Input)Query
Output
id:(Output)Id query
acc:(Output)Accession query
nam:(Output)Name query
des:(Output)Description query
up:(Output)Parent query
space:(Output)Namespace query
Returns
ajuint:Number of fields found

Description

Returns the standard obo query string from a query

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPOboData

Obo Data

Sections: constructors casts


Section: constructors

Constructors

Functions: ajObodataNew ajObodataParseObofile


Function ajObodataNew

Obo data internals constructor

Synopsis

Prototype
AjPOboData ajObodataNew (
      void
);

TypeNameRead/WriteDescription
AjPOboData RETURNNew object

Returns
AjPOboData:New object

Description

Obo data internals constructor

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajObodataParseObofile

Parse an OBO format file

Synopsis

Prototype
AjPOboData ajObodataParseObofile (
      AjPFile obofile,
      const char* validations
);

TypeNameRead/WriteDescription
AjPFileobofileModifyOBO format input file
const char*validationsInputValidations to turn on or off
AjPOboData RETURNOntology data object

Input
validations:(Input)Validations to turn on or off
Input & Output
obofile:(Modify)OBO format input file
Returns
AjPOboData:Ontology data object

Description

Parse an OBO format file

See Also

See other functions in this section

Availability

In release 6.4.0

Section: casts

Retrieve data from an obo data opbject

Functions: ajObodataFetchId ajObodataFetchName


Function ajObodataFetchId

Retrieves an OBO term by ID

Synopsis

Prototype
AjPObo ajObodataFetchId (
      const AjPOboData thys,
      const AjPStr query
);

TypeNameRead/WriteDescription
const AjPOboDatathysInputParsed ontology
const AjPStrqueryInputOBO identifier
AjPObo RETURNOBO term

Input
thys:(Input)Parsed ontology
query:(Input)OBO identifier
Returns
AjPObo:OBO term

Description

Retrieves an OBO term by ID

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajObodataFetchName

Retrieves an OBO term by name

The name must be an exact match to a name or synonym for the term

Synopsis

Prototype
AjPObo ajObodataFetchName (
      const AjPOboData thys,
      const AjPStr query
);

TypeNameRead/WriteDescription
const AjPOboDatathysInputParsed ontology
const AjPStrqueryInputOBO name
AjPObo RETURNOBO term

Input
thys:(Input)Parsed ontology
query:(Input)OBO name
Returns
AjPObo:OBO term

Description

Retrieves an OBO term by name

The name must be an exact match to a name or synonym for the term

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPStr

Obo file line

Sections: Modifiers


Section: Modifiers

Clean up[ the input line

Functions: ajObolineCutComment ajObolineCutDbxref ajObolineCutModifier ajObolineEscape


Function ajObolineCutComment

Remove comments starting with an unescaped '!'

Synopsis

Prototype
AjBool ajObolineCutComment (
      AjPStr* Pline,
      AjPStr* Pcomment
);

TypeNameRead/WriteDescription
AjPStr*PlineModifyLine with possible comment text
AjPStr*PcommentModifyComment text
AjBool RETURNTrue if a comment was found

Input & Output
Pline:(Modify)Line with possible comment text
Pcomment:(Modify)Comment text
Returns
AjBool:True if a comment was found

Description

Remove comments starting with an unescaped '!'

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajObolineCutDbxref

Remove trailing dbxrefs in square braces

Synopsis

Prototype
AjBool ajObolineCutDbxref (
      AjPStr* Pline,
      AjPStr* Pdbxref
);

TypeNameRead/WriteDescription
AjPStr*PlineModifyLine with possible trailing dbxref text
AjPStr*PdbxrefModifyDbxref text
AjBool RETURNTrue if a trailing dbxref was found

Input & Output
Pline:(Modify)Line with possible trailing dbxref text
Pdbxref:(Modify)Dbxref text
Returns
AjBool:True if a trailing dbxref was found

Description

Remove trailing dbxrefs in square braces

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajObolineCutModifier

Remove trailing modifiers in curly braces

Synopsis

Prototype
AjBool ajObolineCutModifier (
      AjPStr* Pline,
      AjPStr* Pmodifier
);

TypeNameRead/WriteDescription
AjPStr*PlineModifyLine with possible trailing modifier text
AjPStr*PmodifierModifyModifier text
AjBool RETURNTrue if a trailing modifier was found

Input & Output
Pline:(Modify)Line with possible trailing modifier text
Pmodifier:(Modify)Modifier text
Returns
AjBool:True if a trailing modifier was found

Description

Remove trailing modifiers in curly braces

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajObolineEscape

Clean up escaped characters

Synopsis

Prototype
AjBool ajObolineEscape (
      AjPStr* Pline
);

TypeNameRead/WriteDescription
AjPStr*PlineModifyLine with possible comment text
AjBool RETURNTrue if an escaped character was found

Input & Output
Pline:(Modify)Line with possible comment text
Returns
AjBool:True if an escaped character was found

Description

Clean up escaped characters

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: none

Miscellaneous functions

Sections: Print Miscellaneous Internals


Section: Print

Printing to a file

Functions: ajOboinprintBook ajOboinprintHtml ajOboinprintText ajOboinprintWiki


Function ajOboinprintBook

Reports the internal data structures as a Docbook table

Synopsis

Prototype
void ajOboinprintBook (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

Input & Output
outf:(Modify)Output file
Returns
void:No return value

Description

Reports the internal data structures as a Docbook table

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboinprintHtml

Reports the internal data structures as an HTML table

Synopsis

Prototype
void ajOboinprintHtml (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

Input & Output
outf:(Modify)Output file
Returns
void:No return value

Description

Reports the internal data structures as an HTML table

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboinprintText

Reports the internal data structures

Synopsis

Prototype
void ajOboinprintText (
      AjPFile outf,
      AjBool full
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
AjBoolfullInputFull report (usually ajFalse)
void RETURN

Input
full:(Input)Full report (usually ajFalse)
Input & Output
outf:(Modify)Output file
Returns
void:No return value

Description

Reports the internal data structures

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboinprintWiki

Reports the internal data structures as a wiki table

Synopsis

Prototype
void ajOboinprintWiki (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

Input & Output
outf:(Modify)Output file
Returns
void:No return value

Description

Reports the internal data structures as a wiki table

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Miscellaneous

Functions to initialise and clean up internals

Functions: ajOboinExit


Function ajOboinExit

Cleans up obo term input internal memory

Synopsis

Prototype
void ajOboinExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

Returns
void:No return value

Description

Cleans up obo term input internal memory

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Internals

Functions to return internal values

Functions: ajOboinTypeGetFields ajOboinTypeGetQlinks


Function ajOboinTypeGetFields

Returns the listof known field names for ajOboinRead

Synopsis

Prototype
const char* ajOboinTypeGetFields (
      void
);

TypeNameRead/WriteDescription
const char* RETURNList of field names

Returns
const char*:List of field names

Description

Returns the listof known field names for ajOboinRead

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboinTypeGetQlinks

Returns the listof known query link operators for ajOboinRead

Synopsis

Prototype
const char* ajOboinTypeGetQlinks (
      void
);

TypeNameRead/WriteDescription
const char* RETURNList of field names

Returns
const char*:List of field names

Description

Returns the listof known query link operators for ajOboinRead

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPTable

Internal call register table

Sections: Cast


Section: Cast

Return a reference to the call table

Functions: ajOboaccessGetDb ajOboaccessMethodGetQlinks ajOboaccessMethodGetScope ajOboaccessMethodTest


Function ajOboaccessGetDb

returns the table in which obo database access details are registered

Synopsis

Prototype
AjPTable ajOboaccessGetDb (
      void
);

TypeNameRead/WriteDescription
AjPTable RETURNAccess functions hash table

Returns
AjPTable:Access functions hash table

Description

returns the table in which obo database access details are registered

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboaccessMethodGetQlinks

Tests for a named method for obo term reading and returns the known query link operators

Synopsis

Prototype
const char* ajOboaccessMethodGetQlinks (
      const AjPStr method
);

TypeNameRead/WriteDescription
const AjPStrmethodInputMethod required.
const char* RETURNKnown link operators

Input
method:(Input)Method required.
Returns
const char*:Known link operators

Description

Tests for a named method for obo term reading and returns the known query link operators

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboaccessMethodGetScope

Tests for a named method for obo term reading and returns the scope (entry, query or all).

Synopsis

Prototype
ajuint ajOboaccessMethodGetScope (
      const AjPStr method
);

TypeNameRead/WriteDescription
const AjPStrmethodInputMethod required.
ajuint RETURNScope flags

Input
method:(Input)Method required.
Returns
ajuint:Scope flags

Description

Tests for a named method for obo term reading and returns the scope (entry, query or all).

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajOboaccessMethodTest

Tests for a named method for obo reading.

Synopsis

Prototype
AjBool ajOboaccessMethodTest (
      const AjPStr method
);

TypeNameRead/WriteDescription
const AjPStrmethodInputMethod required.
AjBool RETURNajTrue on success.

Input
method:(Input)Method required.
Returns
AjBool:ajTrue on success.

Description

Tests for a named method for obo reading.

See Also

See other functions in this section

Availability

In release 6.4.0