1 #ifndef SPLICETRIE_BUILD_INCLUDED
2 #define SPLICETRIE_BUILD_INCLUDED
3 
4 
5 #include "bool.h"
6 #include "genomicpos.h"
7 #include "types.h"
8 #include "iit-read-univ.h"
9 #include "iit-read.h"
10 #include "genome.h"
11 #include "list.h"
12 #include "splicestringpool.h"
13 
14 
15 /* For offsets */
16 /* #define USE_2BYTE_RELOFFSETS 1 */
17 #ifdef USE_2BYTE_RELOFFSETS
18 #define NULL_POINTER 65535
19 #else
20 #define NULL_POINTER -1U    /* Note: 0 does not work */
21 #endif
22 
23 #define MAX_DUPLICATES 1000
24 #define DUPLICATE_NODE -1000U	/* Needs to be -MAX_DUPLICATES */
25 
26 #define INTERNAL_NODE -1U
27 
28 #define single_leaf_p(x) (x) < DUPLICATE_NODE
29 #define multiple_leaf_p(x) (x) < INTERNAL_NODE
30 
31 extern char *
32 Splicetype_string (Splicetype_T splicetype);
33 
34 extern Univcoord_T *
35 Splicetrie_retrieve_via_splicesites (bool *distances_observed_p,
36 #ifdef GSNAP
37 				     Genomecomp_T **splicecomp,
38 #endif
39 				     Splicetype_T **splicetypes, Chrpos_T **splicedists,
40 				     List_T **splicestrings, Genomecomp_T **splicefrags_ref, Genomecomp_T **splicefrags_alt,
41 				     int *nsplicesites, IIT_T splicing_iit, int *splicing_divint_crosstable,
42 				     int donor_typeint, int acceptor_typeint, Univ_IIT_T chromosome_iit,
43 				     Genome_T genome, Genome_T genomealt, Chrpos_T shortsplicedist,
44 				     Splicestringpool_T splicestringpool);
45 extern Univcoord_T *
46 Splicetrie_retrieve_via_introns (
47 #ifdef GSNAP
48 				 Genomecomp_T **splicecomp,
49 #endif
50 				 Splicetype_T **splicetypes, Chrpos_T **splicedists,
51 				 List_T **splicestrings, Genomecomp_T **splicefrags_ref, Genomecomp_T **splicefrags_alt,
52 				 int *nsplicesites, IIT_T splicing_iit, int *splicing_divint_crosstable,
53 				 Univ_IIT_T chromosome_iit, Genome_T genome, Genome_T genomealt,
54 				 Splicestringpool_T splicestringpool);
55 extern void
56 Splicetrie_npartners (int **nsplicepartners_skip, int **nsplicepartners_obs, int **nsplicepartners_max,
57 		      Univcoord_T *splicesites, Splicetype_T *splicetypes,
58 		      Chrpos_T *splicedists, List_T *splicestrings, int nsplicesites,
59 		      Univ_IIT_T chromosome_iit, Chrpos_T max_distance,
60 		      bool distances_observed_p);
61 
62 extern void
63 Splicetrie_build_via_splicesites (Triecontent_T **triecontents_obs, Trieoffset_T **trieoffsets_obs,
64 				  Triecontent_T **triecontents_max, Trieoffset_T **trieoffsets_max,
65 				  int *nsplicepartners_skip, int *nsplicepartners_obs, int *nsplicepartners_max,
66 				  Splicetype_T *splicetypes, List_T *splicestrings, int nsplicesites);
67 
68 extern void
69 Splicetrie_build_via_introns (Triecontent_T **triecontents_obs, Trieoffset_T **trieoffsets_obs,
70 			      Univcoord_T *splicesites, Splicetype_T *splicetypes,
71 			      List_T *splicestrings, int nsplicesites,
72 			      Univ_IIT_T chromosome_iit, IIT_T splicing_iit, int *splicing_divint_crosstable);
73 
74 #endif
75 
76