From pjotr at pckassa.com Mon Jun 13 17:16:34 2005 From: pjotr at pckassa.com (Pjotr Prins) Date: Mon Jun 13 17:09:47 2005 Subject: [BioRuby] BioRuby Documentation effort Message-ID: <20050613211634.GA28151@tm2.nmi-agro.nl> The time has come to work on BioRuby documentation. I would like to start a transparent process where people can contribute if they feel like it. We could use a Wiki, or something, but I prefer to work straight in the sources, so we have it in one place, and use a tool like rdoc. For this we would need CVS access. I would not like several people to work on documentation and wait for patches applied by others. It would also be good to add unit tests - and use those as code examples in the documentation. Can we develop a policy for this, so we can all see what is happening? I suggest we allow documenters access to CVS - as long as they promise not to touch other people's code (w.o. permission from the section author). Is this a good idea? Pj. From mmhohman at northwestern.edu Tue Jun 14 13:59:18 2005 From: mmhohman at northwestern.edu (Moses Hohman) Date: Tue Jun 14 13:51:35 2005 Subject: [BioRuby] BioRuby Documentation effort In-Reply-To: <20050613211634.GA28151@tm2.nmi-agro.nl> References: <20050613211634.GA28151@tm2.nmi-agro.nl> Message-ID: <97816A38-9657-4D4F-B151-80C72F736FB5@northwestern.edu> Sounds good to me. There are already some unit tests, but of course more are welcome. rdoc seems like a good method to me, too. Toshiaki? Moses On Jun 13, 2005, at 4:16 PM, Pjotr Prins wrote: > The time has come to work on BioRuby documentation. I would like to > start a transparent process where people can contribute if they feel > like it. > > We could use a Wiki, or something, but I prefer to work straight in > the sources, so we have it in one place, and use a tool like rdoc. For > this we would need CVS access. I would not like several people to work > on documentation and wait for patches applied by others. It would also > be good to add unit tests - and use those as code examples in the > documentation. > > Can we develop a policy for this, so we can all see what is happening? > I suggest we allow documenters access to CVS - as long as they promise > not to touch other people's code (w.o. permission from the section > author). > > Is this a good idea? > > Pj. > _______________________________________________ > BioRuby mailing list > BioRuby@open-bio.org > http://portal.open-bio.org/mailman/listinfo/bioruby > > From ktym at hgc.jp Thu Jun 16 10:38:41 2005 From: ktym at hgc.jp (Toshiaki Katayama) Date: Thu Jun 16 10:30:30 2005 Subject: [BioRuby] BioRuby Documentation effort In-Reply-To: <97816A38-9657-4D4F-B151-80C72F736FB5@northwestern.edu> References: <20050613211634.GA28151@tm2.nmi-agro.nl> <97816A38-9657-4D4F-B151-80C72F736FB5@northwestern.edu> Message-ID: <5E1BB168-FAB7-4258-9C1E-9403CF56BF16@hgc.jp> Hi, I'm pleased to announce that we obtained a grant (very recently) for the BioRuby development including documentations and unit tests. We will be able to start developping shortly after the BOSC meeting next week. I'm really appreciate if any of you could take part in this effort and I'm happy to grant the CVS access (I believe Moses already have). Let's start planning. Does anybody here attend the BOSC2005? Regards, Toshiaki Katayama On 2005/06/15, at 2:59, Moses Hohman wrote: > Sounds good to me. There are already some unit tests, but of course > more are welcome. rdoc seems like a good method to me, too. Toshiaki? > > Moses > > On Jun 13, 2005, at 4:16 PM, Pjotr Prins wrote: > > >> The time has come to work on BioRuby documentation. I would like to >> start a transparent process where people can contribute if they feel >> like it. >> >> We could use a Wiki, or something, but I prefer to work straight in >> the sources, so we have it in one place, and use a tool like rdoc. >> For >> this we would need CVS access. I would not like several people to >> work >> on documentation and wait for patches applied by others. It would >> also >> be good to add unit tests - and use those as code examples in the >> documentation. >> >> Can we develop a policy for this, so we can all see what is >> happening? >> I suggest we allow documenters access to CVS - as long as they >> promise >> not to touch other people's code (w.o. permission from the section >> author). >> >> Is this a good idea? >> >> Pj. >> _______________________________________________ >> BioRuby mailing list >> BioRuby@open-bio.org >> http://portal.open-bio.org/mailman/listinfo/bioruby >> >> >> > > _______________________________________________ > BioRuby mailing list > BioRuby@open-bio.org > http://portal.open-bio.org/mailman/listinfo/bioruby > From ngoto at gen-info.osaka-u.ac.jp Tue Jun 28 09:59:26 2005 From: ngoto at gen-info.osaka-u.ac.jp (GOTO Naohisa) Date: Tue Jun 28 09:50:42 2005 Subject: [BioRuby] patch for ruby-cluster 1.4 Message-ID: <200506281350.j5SDoaPB025838@portal.open-bio.org> Hi, I want to use ruby-cluster (interface for hierarchical clustering methods for Ruby. http://bioruby.org/archive/contrib/ruby-cluster/ ) but it did not work well in Ruby 1.8.x. So, I wrote a patch for ruby-cluster 1.4. ChangeLog * Added rb_require("hcluster/hcluster") to work "require 'hcluster'" properly, as written in the README. Previously, we must have wrote "require 'hcluster/hcluster'". * Changed to define 'initialize' and 'alloc' methods insted of 'new' class method. * Changed to use rb_obj_is_kind_of(). * Changed to use rb_const_get() to obtain HCluster::Tree class. -- Naohisa GOTO ngoto@gen-info.osaka-u.ac.jp Department of Genome Informatics, Genome Information Research Center, Research Institute for Microbial Diseases, Osaka University, Japan -------------- next part -------------- --- ruby-cluster-1.4/ext/hclusterso/hcluster.c.ORIG 2002-12-04 08:19:53.000000000 +0900 +++ ruby-cluster-1.4/ext/hclusterso/hcluster.c 2005-06-27 20:25:48.459180000 +0900 @@ -41,15 +41,15 @@ static VALUE mHCluster; static VALUE cRelation; -static VALUE cTree; static ID id_new; -static ID id_kind_of; +static ID id_tree; static void free_rel (struct reldata *relp) { if (relp->rel) xfree (relp->rel); + xfree(relp); } static void @@ -82,14 +82,20 @@ } static VALUE -Relation_new (int argc, VALUE *argv, VALUE klass) +Relation_alloc (VALUE klass) +{ + struct reldata *relp = ALLOC(struct reldata); + return Data_Wrap_Struct(klass, 0, free_rel, relp); +} + +static VALUE +Relation_initialize (int argc, VALUE *argv, VALUE self) { VALUE vsize; VALUE vfill; int size; double fill; struct reldata *relp; - VALUE obj; rb_scan_args (argc, argv, "02", &vsize, &vfill); @@ -104,10 +110,10 @@ else fill = NUM2DBL (vfill); - obj = Data_Make_Struct (klass, struct reldata, 0, free_rel, relp); + Data_Get_Struct (self, struct reldata, relp); init_rel (relp, size, fill); - return obj; + return Qnil; } static VALUE @@ -220,7 +226,7 @@ vleft = create_tree (left, rel, tree, size); vright = create_tree (right, rel, tree, size); - return rb_funcall (cTree, id_new, 3, + return rb_funcall (rb_const_get(mHCluster, id_tree), id_new, 3, vleft, vright, rb_float_new (tmp)); } @@ -252,7 +258,7 @@ while (num_member > 1) { int i1, i2; - int max_i1 = -1, max_i2; + int max_i1 = -1, max_i2 = -1; int max_m1, max_m2; int max_size1, max_size2; double max = -1.0 / 0.0; @@ -290,7 +296,7 @@ num_member, num_tree, max); #endif - if (max < threshold || max_i1 == -1) + if (max < threshold || max_i1 == -1 || max_i2 == -1) break; max_m1 = member[max_i1]; @@ -397,7 +403,7 @@ rb_scan_args (argc, argv, "11", &vrel, &vthr); - if (rb_funcall (vrel, id_kind_of, 1, cRelation) == Qfalse) + if (RTEST (rb_obj_is_kind_of (vrel, cRelation)) == 0) rb_raise (rb_eArgError, "the first argument must be Relation"); if (NIL_P (vthr)) @@ -431,7 +437,7 @@ rb_scan_args (argc, argv, "11", &vrel, &vthr); - if (rb_funcall (vrel, id_kind_of, 1, cRelation) == Qfalse) + if (RTEST (rb_obj_is_kind_of (vrel, cRelation)) == 0) rb_raise (rb_eArgError, "the first argument must be Relation"); if (NIL_P (vthr)) @@ -459,7 +465,7 @@ rb_scan_args (argc, argv, "11", &vrel, &vthr); - if (rb_funcall (vrel, id_kind_of, 1, cRelation) == Qfalse) + if (RTEST (rb_obj_is_kind_of (vrel, cRelation)) == 0) rb_raise (rb_eArgError, "the first argument must be Relation"); if (NIL_P (vthr)) @@ -478,19 +484,19 @@ mHCluster = rb_define_module ("HCluster"); cRelation = rb_define_class_under (mHCluster, "Relation", rb_cObject); - rb_define_singleton_method (cRelation, "new", Relation_new, -1); + rb_define_alloc_func(cRelation, Relation_alloc); + rb_define_private_method (cRelation, "initialize", Relation_initialize, -1); rb_define_method (cRelation, "size", Relation_size, 0); rb_define_method (cRelation, "get", Relation_get, 2); rb_define_method (cRelation, "set", Relation_set, 3); rb_define_method (cRelation, "clear", Relation_clear, 2); - /* Dummy. If I knew a method to obtain a class object by name in C... */ - cTree = rb_define_class_under (mHCluster, "Tree", rb_cObject); - rb_define_module_function (mHCluster, "scluster", scluster, -1); rb_define_module_function (mHCluster, "ccluster", ccluster, -1); rb_define_module_function (mHCluster, "mcluster", mcluster, -1); id_new = rb_intern ("new"); - id_kind_of = rb_intern ("kind_of?"); + id_tree = rb_intern ("Tree"); + + rb_require("hcluster/hcluster"); }