| 1 |
/** |
| 2 |
|
| 3 |
Copyright (c) 2010-2015, Daniel S. Standage and CONTRIBUTORS |
| 4 |
|
| 5 |
The AEGeAn Toolkit is distributed under the ISC License. See |
| 6 |
the 'LICENSE' file in the AEGeAn source code distribution or |
| 7 |
online at https://github.com/standage/AEGeAn/blob/master/LICENSE. |
| 8 |
|
| 9 |
**/ |
| 10 |
|
| 11 |
#ifndef AEGEAN_TYPECHECK |
| 12 |
#define AEGEAN_TYPECHECK |
| 13 |
|
| 14 |
#include "extended/feature_node_api.h" |
| 15 |
|
| 16 |
/** |
| 17 |
* @module AgnTypecheck |
| 18 |
* |
| 19 |
* Functions for testing feature types. |
| 20 |
*/ //; |
| 21 |
|
| 22 |
/** |
| 23 |
* @function Returns true if the given feature is a CDS; false otherwise. |
| 24 |
*/ |
| 25 |
bool agn_typecheck_cds(GtFeatureNode *fn); |
| 26 |
|
| 27 |
/** |
| 28 |
* @function Count the number of ``fn``'s children that have the given type. |
| 29 |
*/ |
| 30 |
GtUword agn_typecheck_count(GtFeatureNode *fn, bool (*func)(GtFeatureNode *)); |
| 31 |
|
| 32 |
/** |
| 33 |
* @function Returns true if the given feature is an exon; false otherwise. |
| 34 |
*/ |
| 35 |
bool agn_typecheck_exon(GtFeatureNode *fn); |
| 36 |
|
| 37 |
/** |
| 38 |
* @function Traverse the feature graph starting at `root` and add up the length |
| 39 |
* of all features matching the given selection function `func`. |
| 40 |
*/ |
| 41 |
GtUword agn_typecheck_feature_combined_length(GtFeatureNode *root, |
| 42 |
bool (*func)(GtFeatureNode *)); |
| 43 |
|
| 44 |
/** |
| 45 |
* @function Returns true if the given feature is a gene; false otherwise. |
| 46 |
*/ |
| 47 |
bool agn_typecheck_gene(GtFeatureNode *fn); |
| 48 |
|
| 49 |
/** |
| 50 |
* @function Returns true if the given feature is an intron; false otherwise. |
| 51 |
*/ |
| 52 |
bool agn_typecheck_intron(GtFeatureNode *fn); |
| 53 |
|
| 54 |
/** |
| 55 |
* @function Returns true if the given feature is an mRNA; false otherwise. |
| 56 |
*/ |
| 57 |
bool agn_typecheck_mrna(GtFeatureNode *fn); |
| 58 |
|
| 59 |
/** |
| 60 |
* @function Returns true if the given feature is declared as a pseudogene; |
| 61 |
* false otherwise. |
| 62 |
*/ |
| 63 |
bool agn_typecheck_pseudogene(GtFeatureNode *fn); |
| 64 |
|
| 65 |
/** |
| 66 |
* @function Gather the children of a given feature that have a certain type. |
| 67 |
* Type is tested by ``func``, which accepts a single ``GtFeatureNode`` object. |
| 68 |
*/ |
| 69 |
GtArray *agn_typecheck_select(GtFeatureNode *fn, bool (*func)(GtFeatureNode *)); |
| 70 |
|
| 71 |
/** |
| 72 |
* @function Gather the children of a given feature that have a certain type. |
| 73 |
* Type is tested by comparing `type` to the type of `fn`. |
| 74 |
*/ |
| 75 |
GtArray *agn_typecheck_select_str(GtFeatureNode *fn, const char *); |
| 76 |
|
| 77 |
/** |
| 78 |
* @function Returns true if the given feature is a start codon; false |
| 79 |
* otherwise. |
| 80 |
*/ |
| 81 |
bool agn_typecheck_start_codon(GtFeatureNode *fn); |
| 82 |
|
| 83 |
/** |
| 84 |
* @function Returns true if the given feature is a stop codon; false otherwise. |
| 85 |
*/ |
| 86 |
bool agn_typecheck_stop_codon(GtFeatureNode *fn); |
| 87 |
|
| 88 |
/** |
| 89 |
* @function Returns true if the given feature is an mRNA, tRNA, or rRNA; false |
| 90 |
* otherwise. |
| 91 |
*/ |
| 92 |
bool agn_typecheck_transcript(GtFeatureNode *fn); |
| 93 |
|
| 94 |
/** |
| 95 |
* @function Returns true if the given feature is a UTR; false otherwise. |
| 96 |
*/ |
| 97 |
bool agn_typecheck_utr(GtFeatureNode *fn); |
| 98 |
|
| 99 |
/** |
| 100 |
* @function Returns true if the given feature is a 3' UTR; false otherwise. |
| 101 |
*/ |
| 102 |
bool agn_typecheck_utr3p(GtFeatureNode *fn); |
| 103 |
|
| 104 |
/** |
| 105 |
* @function Returns true if the given feature is a 5' UTR; false otherwise. |
| 106 |
*/ |
| 107 |
bool agn_typecheck_utr5p(GtFeatureNode *fn); |
| 108 |
|
| 109 |
#endif |