[GenABEL-dev] [Genabel-commits] r638 - in pkg/VariABEL: R src

Yurii Aulchenko yurii.aulchenko at gmail.com
Tue Feb 8 12:57:26 CET 2011


Great work -- I see you implement iterator!

Few suggestions/comments

> +"var.test.gwaa" <- function(formula, genodata, phenodata, genodata_info="", testname="sqlm", analysis_type="AAvsABvsBB")

it is probably more conventional to use

genodata_info=NULL

and then

use

if(!is.null(genodata_info) & file.exists(genodata_info))

instead of

if(genodata_info != "" & file.exists(genodata_info))


> +       else if(is(formula, "numeric") || is(formula, "integer") || is(formula, "double"))

it seems that simply

else if(is(formula, "numeric"))

should work, see

a <- rnorm(10)
is(a,"numeric")
is(as.integer(a),"numeric")
is(as.double(a),"numeric")

returns all TRUE

> +                                                                                                                           coding=as.character(genodata at coding),
> +                                                                                                                                strand=as.character(genodata at strand),
> +                                                                                                                                chromosome=as.character(genodata at chromosome),
> +                                                                                                                                map=genodata at map

better style, and more robust to possible future changes:

coding(genodata)
strand(genodata)
chromosome(genodata)
map(srdta)

Yurii


More information about the genabel-devel mailing list