Taxonomy: new functions and improvements

This commit is contained in:
Celine Mercier
2017-10-04 15:55:13 +02:00
parent 0ab081f79e
commit 535692b020
6 changed files with 329 additions and 96 deletions

View File

@ -308,7 +308,7 @@ int obi_taxo_add_preferred_name_with_taxon(OBIDMS_taxonomy_p tax, ecotx_t* taxon
* @param rankidx The index of the rank wanted.
*
* @returns A pointer on the parent taxon at the wanted rank.
* @retval NULL if no parent taxon was found at the wanted rank.
* @retval NULL if no parent taxon was found at the wanted rank or if an error occurred.
*/
ecotx_t* obi_taxo_get_parent_at_rank(ecotx_t* taxon, int32_t rankidx);
@ -320,7 +320,7 @@ ecotx_t* obi_taxo_get_parent_at_rank(ecotx_t* taxon, int32_t rankidx);
* @param taxid The taxid of the taxon.
*
* @returns A pointer on the wanted taxon.
* @retval NULL if no taxon was found with the given taxid.
* @retval NULL if no taxon was found with the given taxid or if an error occurred.
*
* @since January 2017
* @author Celine Mercier (celine.mercier@metabarcoding.org)
@ -334,9 +334,12 @@ ecotx_t* obi_taxo_get_taxon_with_taxid(OBIDMS_taxonomy_p taxonomy, int32_t taxid
* @param taxon A pointer on the first taxon.
* @param other_taxid The taxid of the second taxon.
*
* @returns A boolean indicating whether the first taxon is under the second taxon in the taxonomy tree.
* @returns A value indicating whether the first taxon is under the second taxon in the taxonomy tree.
* @retval 0 if the first taxon is not under the second taxon in the taxonomy tree.
* @retval 1 if the first taxon is under the second taxon in the taxonomy tree.
* @retval -1 if an error occurred.
*/
bool obi_taxo_is_taxon_under_taxid(ecotx_t* taxon, int32_t other_taxid);
int obi_taxo_is_taxon_under_taxid(ecotx_t* taxon, int32_t other_taxid);
/**
@ -398,3 +401,16 @@ ecotx_t* obi_taxo_get_kingdom(ecotx_t* taxon, OBIDMS_taxonomy_p taxonomy);
*/
ecotx_t* obi_taxo_get_superkingdom(ecotx_t* taxon, OBIDMS_taxonomy_p taxonomy);
/**
* @brief Function returning the label of a rank in an ecorankidx_t structure.
*
* @param rank_idx The index of the rank.
* @param ranks A pointer on an ecorankidx_t structure.
*
* @returns The label of a rank in the ecorankidx_t structure.
* @retval NULL if there is no rank at that index.
*
* @see rank_label_to_index()
*/
const char* obi_taxo_rank_index_to_label(int32_t rank_idx, ecorankidx_t* ranks);