00001 #ifndef CCUTIL_H
00002 #define CCUTIL_H
00003
00004 #define ILEN 32
00005
00006 #define nmin(x, y) ((x<y)?x:y)
00007 #define nmax(x, y) ((x>y)?x:y)
00008
00009 typedef struct {
00010 struct {
00011 int expr;
00012 int exons;
00013 int genes;
00014 } tracks;
00015 struct {
00016 int on;
00017 int thold;
00018 int maxgap;
00019 int minrun;
00020 int showtars;
00021 } rfilter;
00022 int readlim;
00023 int minspan;
00024 } SVCfg_t;
00025
00026 typedef struct {
00027 int chromosome;
00028 int instance;
00029 int show;
00030 int start;
00031 int end;
00032 int mstart;
00033 int mend;
00034 } SRegion_t;
00035
00036 typedef struct {
00037 int show;
00038 int instances;
00039 } Chrdata_t;
00040
00044 typedef struct {
00045 char* chromosome;
00046 int start;
00047 int end;
00048 } Locus;
00049
00050 typedef struct {
00051 Locus read1;
00052 Locus read2;
00053 int id;
00054 } PEreads;
00055
00056 void swapInt (int *a, int *b);
00057
00058 int inRegion (int istart, int iend, int rstart, int rend);
00059 int inRegions (Array regions, int chromosome, int start, int end);
00060
00061 int SRegionCmp(SRegion_t *region1, SRegion_t *region2);
00062 int PEReadSizeCmp (PEreads *per1, PEreads *per2);
00063 int sortPosition( PEreads *per1, PEreads *per2);
00064
00065 char *getMchrname (int chromosome);
00066 char *getSchrname (int chromosome);
00067 char *getHchrname (int chromosome);
00068
00069 int getScale (Array regions);
00070 int getChrnum (char *chrname);
00071 int chrsize (int chromosome);
00072
00073
00074 int putsn (int ntabs, const char *str);
00075 char *striappend (char *str, int value, int base);
00076 char *strappend (char *destination, const char *source);
00077 int antoi (const char *str, size_t n);
00078 char *itoa (int value, char *str, int base);
00079 void reverse (char *str);
00080
00081 #endif