Further, it appears as if the id variable has to have a numeric variable. It
gives the same error if there is an alphanumeric variable.

On Feb 13, 2008 10:14 AM, Farrel Buchinsky <fjbuch@gmail.com> wrote:

> The error was indeed coming from the fact that the first line did not
> contain the name of the markers. By looking at the examples in the
> GeneticsBase vignette I had seen that first row and had tried emulating it
> without success. I have discovered why. I had only put in a line with two
> names yet there were three markers. Where does one add that to the
> instructions so that future naive people do not waste their time. Would
> GeneticsBase Wiki be the best place? If so I will do it.
>
> I have little experience in using space-delimited format (but have often
> used tab-delimted and csv). Am I correct to believe that the delimitation
> sees whitespace as whitespace regardless of size. So would the data be read
> correctly if their are two spaces separating adjacent values as opposed to
> one space.
> I saw that write.pedigree.file() from the genetics package had differing
> amount of spaces between values in order to line everything up neatly for my
> human appreciation.
>
>
>
> On Feb 12, 2008 9:50 AM, James W. MacDonald <jmacdon@med.umich.edu> wrote:
>
> > Hi Farrel,
> >
> > Farrel Buchinsky wrote:
> > > Any idea why I get this message
> > >
> > > b <-readGenes("pedformat.txt",gformat="ped")
> > > Error in FUN(X[[2L]], ...) : cannot coerce to vector
> >
> > I don't see that error. However, the pedfile you show below won't work
> > anyway. The first line needs to contain some marker names. This version
> > worked for me (saved as temp.ped):
> >
> > one two three
> > 100 1 0 0 1  1 2  1 2  1 2
> > 100 2 0 0 2  1 2  1 2  1 2
> > 100 3 1 2 1  1 1  2 2  1 1
> >
> >  > readGenes("temp.ped", gformat="ped")
> > Reading 3 markers and 3 subjects from ` temp.ped ' ...
> > generating 'geneSet' object...
> >
> > Successfully read the pedigree file ` temp.ped '.
> >
> > Number of Markers:  3
> > Number of Subjects: 3
> > Number of Families: 1
> >
> >
> > geneSet object
> > ------------------
> >
> > Number of Markers:      3
> > Number of Observations: 3
> >
> > Sample variables: family, pid, father, mother, sex
> >
> > Genetic data:
> >
> >       100.1 100.2 100.3
> > one   1/2   1/2   1/1
> > two   1/2   1/2   2/2
> > three 1/2   1/2   1/1
> >
> >  > sessionInfo()
> > R version 2.6.0 Patched (2007-10-20 r43232)
> > i386-pc-mingw32
> >
> > locale:
> > LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
> > States.1252;LC_MONETARY=English_United
> > States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
> >
> > attached base packages:
> > [1] stats     graphics  grDevices datasets  utils     methods   base
> >
> > other attached packages:
> > [1] GeneticsBase_1.2.0 haplo.stats_1.3.1  mvtnorm_0.8-1
> > xtable_1.5-2
> > [5] combinat_0.0-6     rcompgen_0.1-17
> >
> > loaded via a namespace (and not attached):
> > [1] gdata_2.4.0  gplots_2.3.2 gtools_2.4.0 MASS_7.2-37  tools_2.6.0
> >
> > Best,
> >
> > Jim
> >
> >
> >
> > >
> > > Where pedformat.txt was diretly copied from
> > > http://www.sph.umich.edu/csg/abecasis/GOLD/docs/pedigree.html
> > > 100 1 0 0 1  1 2  1 2  1 2
> > > 100 2 0 0 2  1 2  1 2  1 2
> > > 100 3 1 2 1  1 1  2 2  1 1
> > >
> > >
> >
> > --
> > James W. MacDonald, M.S.
> > Biostatistician
> > Affymetrix and cDNA Microarray Core
> > University of Michigan Cancer Center
> > 1500 E. Medical Center Drive
> > 7410 CCGC
> > Ann Arbor MI 48109
> > 734-647-5623
> >
>
>
>
> --
> Farrel Buchinsky
> GrandCentral Tel: (412) 567-7870
>



-- 
Farrel Buchinsky
GrandCentral Tel: (412) 567-7870

	[[alternative HTML version deleted]]

