Permalink
Browse files

Add some helper code and tests to demo evalue oddities (bug 1857); ca…

…sting issue?

svn path=/bioperl-ext/trunk/; revision=14492
  • Loading branch information...
1 parent 01233e8 commit ec1c440cee5ad5335857452a3f6b25e0a647eaf1 cjfields committed Feb 5, 2008
Showing with 20,892 additions and 39 deletions.
  1. +36 −0 Bio/Ext/Align/Align.xs
  2. +1 −1 Bio/Ext/Align/Makefile.PL
  3. +39 −7 Bio/Ext/Align/libs/histogram.c
  4. +23 −0 Bio/Ext/Align/libs/histogram.h
  5. +20,724 −0 Bio/Ext/Align/scores.lst
  6. +69 −31 Bio/Ext/Align/test.pl
View
@@ -1441,6 +1441,21 @@ DESTROY(obj)
MODULE = Bio::Ext::Align PACKAGE = Bio::Ext::Align::Histogram
+float
+mu(his)
+ bp_sw_Histogram * his
+ CODE:
+ RETVAL = bp_sw_mu(his);
+ OUTPUT:
+ RETVAL
+
+float
+lambda(his)
+ bp_sw_Histogram * his
+ CODE:
+ RETVAL = bp_sw_lambda(his);
+ OUTPUT:
+ RETVAL
double
evalue(his,score)
@@ -1451,6 +1466,27 @@ evalue(his,score)
OUTPUT:
RETVAL
+double
+extreme_fit_e(his,mu,lambda,score)
+ bp_sw_Histogram * his
+ float mu
+ float lambda
+ double score
+ CODE:
+ RETVAL = bp_sw_ExtremeValueE(his,mu,lambda,score);
+ OUTPUT:
+ RETVAL
+
+double
+extreme_fit_p(his,mu,lambda,score)
+ bp_sw_Histogram * his
+ float mu
+ float lambda
+ double score
+ CODE:
+ RETVAL = bp_sw_ExtremeValueP(his,mu,lambda,score);
+ OUTPUT:
+ RETVAL
void
UnfitHistogram(h)
@@ -3,7 +3,7 @@ use ExtUtils::MakeMaker;
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Bio::Ext::Align',
- 'VERSION' => '1.5.1',
+ 'VERSION' => '1.5.3',
'LIBS' => ['-lm'], # e.g., '-lm'
'DEFINE' => '-DPOSIX -DNOERROR', # e.g., '-DHAVE_SOMETHING'
'INC' => '-I./libs', # e.g., '-I/usr/include/other'
@@ -21,15 +21,20 @@ double Evalue_from_Histogram(Histogram * his,double score)
}
/* Function: new_Histogram(min,max,lumpsize)
- *
- * Descrip: No Description
- *
- * Arg: min [UNKN ] minimum score (integer) [int]
- * Arg: max [UNKN ] maximum score (integer) [int]
- * Arg: lumpsize [UNKN ] when reallocating histogram, the reallocation amount [int]
+ *
+ * Purpose: Allocate and return a histogram structure.
+ * min and max are your best guess. They need
+ * not be absolutely correct; the histogram
+ * will expand dynamically to accomodate scores
+ * that exceed these suggested bounds. The amount
+ * that the histogram grows by is set by "lumpsize".
+ *
+ * Args: min: minimum score (integer)
+ * max: maximum score (integer)
+ * lumpsize: when reallocating histogram, pad the reallocation
+ * by this much (saves excessive reallocation)
*
* Return [UNKN ] Undocumented return value [Histogram *]
- *
*/
# line 113 "histogram.dy"
Histogram * new_Histogram(int min, int max, int lumpsize)
@@ -1558,7 +1563,34 @@ Histogram * free_Histogram(Histogram * obj)
return NULL;
}
+/* Function: Mu(obj)
+ *
+ * Descrip: Returns value of EVD_MU
+ *
+ * Arg: None
+ *
+ * Return : float (current value of EVD_MU)
+ *
+ */
+float Mu(Histogram * obj)
+{
+ return obj->param[EVD_MU];
+}
+/* Function: Lambda(obj)
+ *
+ * Descrip: Returns value of EVD_LAMBDA
+ *
+ * Arg: None
+ *
+ * Return : float (current value of EVD_LAMBDA)
+ *
+ */
+
+float Lambda(Histogram * obj)
+{
+ return obj->param[EVD_LAMBDA];
+}
#ifdef _cplusplus
}
@@ -489,6 +489,29 @@ Histogram * bp_sw_Histogram_alloc(void);
Histogram * bp_sw_free_Histogram(Histogram * obj);
#define free_Histogram bp_sw_free_Histogram
+/* Function: Mu(obj)
+ *
+ * Descrip: Returns value of EVD_MU
+ *
+ * Arg: None
+ *
+ * Return : float (current value of EVD_MU)
+ *
+ */
+float bp_sw_mu(Histogram * obj);
+#define Mu bp_sw_mu
+
+/* Function: Lambda(obj)
+ *
+ * Descrip: Returns value of EVD_LAMBDA
+ *
+ * Arg: None
+ *
+ * Return : float (current value of EVD_LAMBDA)
+ *
+ */
+float bp_sw_lambda(Histogram * obj);
+#define Lambda bp_sw_lambda
/* Unplaced functions */
/* There has been no indication of the use of these functions */
Oops, something went wrong.

0 comments on commit ec1c440

Please sign in to comment.