| 1 |
/** |
| 2 |
|
| 3 |
Copyright (c) 2010-2014, 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_LOCUS_STREAM |
| 12 |
#define AEGEAN_LOCUS_STREAM |
| 13 |
|
| 14 |
#include "core/logger_api.h" |
| 15 |
#include "extended/node_stream_api.h" |
| 16 |
#include "AgnUnitTest.h" |
| 17 |
|
| 18 |
/** |
| 19 |
* @class AgnLocusStream |
| 20 |
* |
| 21 |
* Implements the ``GtNodeStream`` interface. The only feature nodes delivered |
| 22 |
* by this stream have type ``locus``, and the only direct children of these |
| 23 |
* features are gene features present in the input stream. Any overlapping genes |
| 24 |
* are children of the same locus feature. |
| 25 |
*/ |
| 26 |
typedef struct AgnLocusStream AgnLocusStream; |
| 27 |
|
| 28 |
|
| 29 |
/** |
| 30 |
* @function Use the given filenames to label the direct children of each iLocus |
| 31 |
* as a 'reference' feature or a 'prediction' feature, to facilitate pairwise |
| 32 |
* comparison. Note that these labels carry no connotation as to the relative |
| 33 |
* quality of the respective annotation sources. |
| 34 |
*/ |
| 35 |
void agn_locus_stream_label_pairwise(AgnLocusStream *stream, |
| 36 |
const char *refrfile,const char *predfile); |
| 37 |
|
| 38 |
/** |
| 39 |
* @function Calculate iLoci from a node stream which may or may not include |
| 40 |
* data from multiple sources. Extend each iLocus boundary as far as possible |
| 41 |
* without overlapping a gene from another iLocus, or by `delta` nucleotides, |
| 42 |
* whichever is shorter. |
| 43 |
*/ |
| 44 |
GtNodeStream *agn_locus_stream_new(GtNodeStream *in_stream, GtUword delta); |
| 45 |
|
| 46 |
/** |
| 47 |
* @function Terminal iLoci or 'end loci' are empty iLoci at either end of a |
| 48 |
* sequence. To exclude terminal iLoci from the output, set `endmode` < 0. To |
| 49 |
* output only terminal iLoci, set `endmode` > 0. By default (`endmode == 0`), |
| 50 |
* terminal iLoci are reported along with all other iLoci. |
| 51 |
*/ |
| 52 |
void agn_locus_stream_set_endmode(AgnLocusStream *stream, int endmode); |
| 53 |
|
| 54 |
/** |
| 55 |
* @function Assign a `Name` attribute with a serial number to each iLocus |
| 56 |
* using the specified printf-style format. |
| 57 |
*/ |
| 58 |
void agn_locus_stream_set_name_format(AgnLocusStream *stream, const char *fmt); |
| 59 |
|
| 60 |
/** |
| 61 |
* @function By default, the locus stream will produce loci containing features |
| 62 |
* and loci containing no features. This function disables reporting of the |
| 63 |
* latter. |
| 64 |
*/ |
| 65 |
void agn_locus_stream_skip_iiLoci(AgnLocusStream *stream); |
| 66 |
|
| 67 |
/** |
| 68 |
* @function Set the source value to be used for all iLoci created by this |
| 69 |
* stream. Default value is 'AEGeAn::AgnLocusStream'. |
| 70 |
*/ |
| 71 |
void agn_locus_stream_set_source(AgnLocusStream *stream, const char *source); |
| 72 |
|
| 73 |
/** |
| 74 |
* @function Record the length of each intergenic iLocus as loci are being |
| 75 |
* parsed. |
| 76 |
*/ |
| 77 |
void agn_locus_stream_track_ilens(AgnLocusStream *stream, FILE *ilenfile); |
| 78 |
|
| 79 |
/** |
| 80 |
* @function Run unit tests for this class. Returns true if all tests passed. |
| 81 |
*/ |
| 82 |
bool agn_locus_stream_unit_test(AgnUnitTest *test); |
| 83 |
|
| 84 |
#endif |