[R] Qtl - package - Question
Uwe Ligges
ligges at statistik.tu-dortmund.de
Sat Nov 7 17:08:52 CET 2009
Can you please try to ask the package maintainer who will certainly be
happy to know if his function is broken and may know how to fix it.
Best,
Uwe Ligges
Uwe Ligges
Sunny Srivastava wrote:
> Dear R-Helpers,
> I am using qtl package to analyze qtl data from QTL cartographer.
>
> I have the map file and cro file from QTL cartographer. I was trying to
> import these two files in R using qtl package.
>
> data=read.cross("qtlcart", ".", "crofile.txt", "mapfile.txt") ### I have
> matched the file structure with the one on the website of qtl package - It
> matches perfectly.
>
> It gives me the following error:
>
>> data.qtl <- read.cross("qtlcart", "F:/data",
> + file="crofile.txt", mapfile="mapfile.txt")
> Error in names(x) <- value :
> 'names' attribute [9] must be the same length as the vector [0]
>
> I checked the code for read.cross function in the package
>
> read.map.qtlcart("mapfile.txt") works fine...
>
> The problem was in the following function:
> read.cro.qtlcart("crofile.txt")
>
> I tried to debug and find the problem:
>
> debug: traits <- t(f[-(1:(2 + nmarkers)), ])
> debug: traits = as.data.frame(traits)
> debug: if (nrow(traits) == 1) traits <- as.data.frame(t(traits))
> ******************data frame with 0 columns and 102 rows**************** ---
> This is the problem portion ---It should read my 9 trait values for all the
> 102 individuals.
> *************************It should have 9 col. and 102 rows.. but it is
> unable to do so...
> debug: colnames(traits) <- trait.names
> Browse[1]> n
> Error in names(x) <- value :
> 'names' attribute [9] must be the same length as the vector [0]
>
> It cannot read my trait values - I have 102 individuals, each with 9 trait
> values.
>
> Can anyone tell me how to solve this problem? Any help would be great.
>
> Thanks and Best Regards,
> S.
>
> -------------------------------------
> R version 2.9.2 (2009-08-24)
> 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 utils datasets methods base
>
> other attached packages:
> [1] qtl_1.14-2 plyr_0.1.9
>
> ------------------------------------
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list