libuproc  1.2.0
Data Structures | Functions
object uproc_idmap

Map between protein family name and its numeric identifier. More...

Data Structures

struct  uproc_idmap
 Map between protein family name and its numeric identifier. More...
 

Functions

uproc_idmapuproc_idmap_create (void)
 Create idmap object. More...
 
void uproc_idmap_destroy (uproc_idmap *map)
 Destroy idmap object. More...
 
uproc_family uproc_idmap_family (uproc_idmap *map, const char *name)
 Get family number. More...
 
char * uproc_idmap_str (const uproc_idmap *map, uproc_family family)
 Get family string. More...
 
uproc_idmapuproc_idmap_loads (uproc_io_stream *stream)
 Load idmap from stream. More...
 
uproc_idmapuproc_idmap_load (enum uproc_io_type iotype, const char *pathfmt,...)
 Load idmap from file. More...
 
uproc_idmapuproc_idmap_loadv (enum uproc_io_type iotype, const char *pathfmt, va_list ap)
 Load idmap from file. More...
 
int uproc_idmap_stores (const uproc_idmap *map, uproc_io_stream *stream)
 Store idmap to stream. More...
 
int uproc_idmap_storev (const uproc_idmap *map, enum uproc_io_type iotype, const char *pathfmt, va_list ap)
 Store idmap to file. More...
 
int uproc_idmap_store (const uproc_idmap *map, enum uproc_io_type iotype, const char *pathfmt,...)
 Store idmap to file. More...
 

Detailed Description

Map between protein family name and its numeric identifier.

Function Documentation

uproc_idmap* uproc_idmap_create ( void  )

Create idmap object.

void uproc_idmap_destroy ( uproc_idmap map)

Destroy idmap object.

uproc_family uproc_idmap_family ( uproc_idmap map,
const char *  name 
)

Get family number.

Returns the family number for name.

If needed, a copy of name is inserted into the map. If the number of families reaches UPROC_FAMILY_MAX, no more names can be added.

This is currently implemented as linear search, so it will slow down with a growing number of entries.

Returns
Returns a number in [0, UPROC_FAMILY_MAX] that maps to name, or UPROC_FAMILY_INVALID if an error occurs or the limit was reached while trying to insert a new name.
char* uproc_idmap_str ( const uproc_idmap map,
uproc_family  family 
)

Get family string.

Returns the family name associated with the family number family. If there is none, returns NULL.

Modifying the returned string will affect the stored value.

uproc_idmap* uproc_idmap_loads ( uproc_io_stream stream)

Load idmap from stream.

uproc_idmap* uproc_idmap_load ( enum uproc_io_type  iotype,
const char *  pathfmt,
  ... 
)

Load idmap from file.

Parameters
iotypeIO type, see uproc_io_type
pathfmtprintf format string for file path
...format string arguments
uproc_idmap* uproc_idmap_loadv ( enum uproc_io_type  iotype,
const char *  pathfmt,
va_list  ap 
)

Load idmap from file.

Like uproc_idmap_load, but with a va_list instead of a variable number of arguments.

int uproc_idmap_stores ( const uproc_idmap map,
uproc_io_stream stream 
)

Store idmap to stream.

int uproc_idmap_storev ( const uproc_idmap map,
enum uproc_io_type  iotype,
const char *  pathfmt,
va_list  ap 
)

Store idmap to file.

int uproc_idmap_store ( const uproc_idmap map,
enum uproc_io_type  iotype,
const char *  pathfmt,
  ... 
)

Store idmap to file.

Like uproc_idmap_store, but with a va_list instead of a variable number of arguments.