[R] [R-pkgs] Version 1.0 of hapassoc now available from CRAN

2006-04-19 Thread Sigal Blay
Version 1.0 of hapassoc now available from CRAN

hapassoc is an R package for likelihood inference of trait associations 
with SNP haplotypes and other attributes using the EM Algorithm. Recent 
changes include the addition of anova and logLik methods for the 
class hapassoc, to allow users to perform likelihood ratio tests of 
haplotype effects. Other changes include bug-fixes and improvements to 
the documentation, such as the addition of a package vignette. See the 
exerpt from the ChangeLog for more details.

ChangeLog

2006-04-04 Version 1.0

 * hapassoc(): the baseline argument is documented to have default
   equal to the most common haplotype, but the code to implement this
   default was lost and needed to be replaced.
 * hapassoc(): added a verbose flag. Default is verbose=FALSE. If
   TRUE users see the iteration number and value of the convergence
   criterion at each iteration of the EM algorithm.
 * pre.hapassoc(): added a verbose flag. Default is verbose=TRUE.
   If TRUE users see a list of the SNP genotypes used to form
   haplotypes and a list of the other non-haplotype variables.
 * Package vignette hapassoc added. After loading the package, type
   vignette(hapassoc) to view.

2006-03-22

 * Overall addition of the log-likelihood functions
 * hapassoc(): function now returns log-likelihood and model
 * logLik.hapassoc(): New function to extract the log-likelihood from
   a hapassoc object
 * anova.hapassoc(): New function to perform likelihood ratio test on
   two hapassoc objects.

2006-02-02 Minor changes:

 * EMvar(): fixed a bug occurring when all haplotype phases are known.
 * RecodeHaplos(): fixed a bug where a single column of non-haplotype
   data in a non-allelic data set was losing its name.
 * hapassoc(): Change ... argument of hapassoc to start.
   Previously the only intended use of ... was to allow the user to
   pass in start for starting values to the glm function, rather
   than to allow the user to pass in other optional arguments to glm.
   We have now made this more explicit by making this argument more
   specific.

___
R-packages mailing list
[EMAIL PROTECTED]
https://stat.ethz.ch/mailman/listinfo/r-packages

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] handling warning messages

2006-03-15 Thread Sigal Blay
Is there any way to store the value of warnings but avoid printing them?

A simplified example:
 out - c(0.2,0.3,0.4)
 var - c(2,3,4)
 outcome - glm(out ~ var, family=binomial())
Warning message:
non-integer #successes in a binomial glm! in: eval(expr, envir, enclos)

I don't like the warning printed, 
but I would like to be able to check it's value after the top-level function 
has completed and than decide weather to print it or not.

Thanks,

Sigal Blay
Statistical Genetics Working Group
Department of Statistics and Actuarial Science
Simon Fraser University

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] [R-pkgs] New version of the LDheatmap package

2006-03-14 Thread Sigal Blay
Version 0.2 of the package LDheatmap is now on CRAN. The main function 
LDheatmap produces a graphical display, as a heat map, of measures of 
pairwise linkage disequilibria between SNPs. Users may optionally 
include the physical locations or genetic map distances of each SNP on 
the plot.

The revisions to the package are aimed at improving the user's ability 
to modify and annotate the heatmap. Most notably, LDheatmap is now based 
on grid graphics. Examples of how to modify the plot using tools from 
the grid package are included in the LDheatmap help file.

Sigal Blay

___
R-packages mailing list
[EMAIL PROTECTED]
https://stat.ethz.ch/mailman/listinfo/r-packages

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] ERROR: installing package indices failed

2004-12-15 Thread Sigal Blay
Turns out that this problem is a propagation of a bug from a
Depends package - gdata doesn't import stats in its NAMESPACE
file, although it makes use of objects defined in stats like 
reorder and na.omit.

I'm curious as to the reason why 'R CMD check' did not detect
this at the source package, and instead did not pass my new  
package. Something for you mighty R developers to consider?  

Thanks,
Sigal Blay

On Sun, Nov 21, 2004 at 05:19:46PM +0100, Uwe Ligges wrote:
 Sigal Blay wrote:
 gregmisc is installed yet the problem persist.
 I installed gregmisc using 
 install.packages(c(combinat,gregmisc,genetics),lib='/home/sblay/lib')
 (on the same library path where I am trying to install LDheatmap)
 
 
 Have you set the environment variable R_LIBS appropriately?
 
 Uwe Ligges
 
 
 installed.packages(lib='/home/sblay/lib')
 
   Package LibPath   Version Priority Bundle   
 combinat  combinat  /home/sblay/lib 0.0-5 NA   NA   
 gdata gdata /home/sblay/lib 2.0.0 NA   
 gregmisc
 genetics  genetics  /home/sblay/lib 1.1.1 NA   NA   
 gmodels   gmodels   /home/sblay/lib 2.0.0 NA   
 gregmisc
 gplotsgplots/home/sblay/lib 2.0.0 NA   
 gregmisc
 gtoolsgtools/home/sblay/lib 2.0.0 NA   
 gregmisc
 LDheatmap LDheatmap /home/sblay/lib 1.0   NA   NA   
 
 ...
 
 
 
 I am developing a package named LDehatmap.
 It depends on the genetics package
 and includes two data files and a demo file.
 When I'm trying to install it, I get the following messages:
 
 * Installing *source* package 'LDheatmap' ...
 ** R
 ** data
 ** demo
 ** help
 
 Building/Updating help pages for package 'LDheatmap'
 
Formats: text html latex example
 LDheatmaptexthtmllatex   example
 ldheatmaptexthtmllatex   example
 Error: object 'reorder' not found whilst loading namespace 
 'gdata'
 Error: package 'gdata' could not be loaded
 Execution halted
 ERROR: installing package indices failed
 
 Any ideas?
 
 
 Yes.  You do not have gdata (part of gregmisc) installed, and 
 genetics depends on it.  How did you get genetics installed? A 
 binary install?
 
 Install gregmisc 
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] ERROR: installing package indices failed

2004-11-20 Thread Sigal Blay
gregmisc is installed yet the problem persist.
I installed gregmisc using 
install.packages(c(combinat,gregmisc,genetics),lib='/home/sblay/lib')
(on the same library path where I am trying to install LDheatmap)

 installed.packages(lib='/home/sblay/lib')
  Package LibPath   Version Priority Bundle
combinat  combinat  /home/sblay/lib 0.0-5 NA   NA
gdata gdata /home/sblay/lib 2.0.0 NA   gregmisc
genetics  genetics  /home/sblay/lib 1.1.1 NA   NA
gmodels   gmodels   /home/sblay/lib 2.0.0 NA   gregmisc
gplotsgplots/home/sblay/lib 2.0.0 NA   gregmisc
gtoolsgtools/home/sblay/lib 2.0.0 NA   gregmisc
LDheatmap LDheatmap /home/sblay/lib 1.0   NA   NA

...


 I am developing a package named LDehatmap.
 It depends on the genetics package
 and includes two data files and a demo file.
 When I'm trying to install it, I get the following messages:

 * Installing *source* package 'LDheatmap' ...
 ** R
 ** data
 ** demo
 ** help
  Building/Updating help pages for package 'LDheatmap'
 Formats: text html latex example
  LDheatmaptexthtmllatex   example
  ldheatmaptexthtmllatex   example
 Error: object 'reorder' not found whilst loading namespace 'gdata'
 Error: package 'gdata' could not be loaded
 Execution halted
 ERROR: installing package indices failed

 Any ideas?

Yes.  You do not have gdata (part of gregmisc) installed, and genetics 
depends on it.  How did you get genetics installed? A binary install?

Install gregmisc 

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] ERROR: installing package indices failed

2004-11-19 Thread Sigal Blay
Dear R-helpers,

I am developing a package named LDehatmap.
It depends on the genetics package
and includes two data files and a demo file.
When I'm trying to install it, I get the following messages:

* Installing *source* package 'LDheatmap' ...
** R
** data
** demo
** help
  Building/Updating help pages for package 'LDheatmap'
 Formats: text html latex example
  LDheatmaptexthtmllatex   example
  ldheatmaptexthtmllatex   example
Error: object 'reorder' not found whilst loading namespace 'gdata'
Error: package 'gdata' could not be loaded
Execution halted
ERROR: installing package indices failed

Any ideas?
 
Thanks,
  
Sigal

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] C function name garbled

2004-09-07 Thread Sigal Blay
On Tue, Sep 07, 2004 at 04:57:57PM -0400, Duncan Murdoch wrote:
 On Tue, 7 Sep 2004 12:46:55 -0700, S Blay [EMAIL PROTECTED] wrote :
 
 I wrote an R wrapper function (phylpro) around a C function 
 (Rphylpro).
 The first time I'm running my function, it runs with no errors.
 The second time I'm trying to run it, I get an error message 
 with the first argument to .Call garbled.
 
 Set up:
  dyn.load(Phylpro.so)
  source(phylpro.R)
  WinHalfWidth-30
  permReps-10
  breaks-c(548, 735, 832)
 
 First call to phylpro succeeds:
  b-phylpro(simulinfile, breaks, WinHalfWidth, permReps)
 
 
 Second call to phylpro fails:
  b-phylpro(simulinfile, breaks, WinHalfWidth, permReps)
 Error in .Call(PSg\bBh\b, input_file = 
 as.character(input_file), breaks = as.integer(breaks),  : 
 .Call function name not in load table
 
 Check if my C function name is in load table: 
  is.loaded(Rphylpro)
 [1] TRUE
 
 
 Any ideas?
 
 It looks to me as though your function is doing something to mess up
 R's internal data.  I'd try commenting out the whole body of the
 function, then adding it back gradually to find which part causes the
 trouble.
 
 Duncan Murdoch

I followed your advice - looks like I need some kind of a cast 
when I assign the values of a C vector to an R vector. I think.

Below is an example of something that doesn't work - 
Can someone give me a hand? 
(In the real function, there are also integer and Character 
string C vectors...) 
Thanks.

#include R.h
#include Rdefines.h

SEXP myfunc() {
double *corrs; 
corrs[0]=3.0;
SEXP Rcorrs; 
double *pRcorrs;
PROTECT(Rcorrs = NEW_NUMERIC(1));
pRcorrs = NUMERIC_POINTER(Rcorrs);
pRcorrs[0] = corrs[0];

UNPROTECT(1); 
return(R_NilValue);
}

/*
 dyn.load(myfunc.so)
 func-function().Call(myfunc)
 func()
*/

Run it once, it's ok:
  func() 
NULL

Run it twice, not ok:
  func() 
Error in .Call(NULL) : function name must be a string (of length 1)

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] allocating memory in C, not in R

2004-09-02 Thread Sigal Blay
 Below is a simplified version of my c function that I am 
 currenctly using with a .C() call.
 The values that has to be returned to R are the three outVectors.
 If I need to convert .C to .Call,
 How do I do it based on myFunction below?
 
 Thank you for your help.
  
 
 void myFunction(char **argv, int *inputVector, 
   int *RoutVector1, double *RoutVector2, char **RoutVector3) {
 int*outVector1;
 double *outVector2;
 char   **outVector3;
 int roof = 0;
 roof = calculate_values ( argv[0], 
   inputVector, 
   outVector1,
   outVector2, 
   outVector3   )
 
 for(i=0;iroof;i++) {
 RoutVector1[i] = outVector1[i];
 RoutVector2[i] = outVector2[i]; 
 } 
 return;
 }
 
 
 
 Well, you could read Writing R Extensions (Section 4.8). Your 
 function will have to change significantly, though. I would 
 create a list within the C-function (called val below) and 
 populate the RoutVectors with it.
 
 (I can't remember whether you'll need more than #include R.h. 
 Again, I direct you to the documentation.)
 
 SEXP myFunction(SEXP argv, SEXP inputVector) {
   SEXP val;
   PROTECT(val = allocVector(VECSXP, 3));
   /* some code you'll have to write */
   UNPROTECT(1);
   return val;
 }
 
 # in R
 RoutVectors - .Call(myFunction, argv, inputVector)
 
 --sundar

Thanks Sundar - but how do I return several vector objects of 
different modes wrapped in a list object using .Call?

Sigal

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] allocating memory in C, not in R

2004-09-01 Thread Sigal Blay
Thank you for the fast reply.

Below is a simplified version of my c function that I am 
currenctly using with a .C() call.
The values that has to be returned to R are the three outVectors.
If I need to convert .C to .Call,
How do I do it based on myFunction below?

Thank you for your help.
 

void myFunction(char **argv, int *inputVector, 
  int *RoutVector1, double *RoutVector2, char **RoutVector3) {
int*outVector1;
double *outVector2;
char   **outVector3;
int roof = 0;
roof = calculate_values ( argv[0], 
  inputVector, 
  outVector1,
  outVector2, 
  outVector3   )

for(i=0;iroof;i++) {
RoutVector1[i] = outVector1[i];
RoutVector2[i] = outVector2[i]; 
} 
return;
}


On Wed, Sep 01, 2004 at 10:16:59PM +0100, Prof Brian Ripley wrote:
 On Wed, 1 Sep 2004, S. Blay wrote:
 
  I need to retrieve several vectors of various types from a call 
  to .C(), but I don't know their length in advance. 
  Is there a way to do this without allocating an excessive amount 
  of memory? 
  If so, an example would be very helpful.
 
 It would be very much easier to use .Call rather than .C.
 
 Alternatively, generate and allocate in C on one C call and retrieve on a
 second, as rpart does.
 
 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html