How to load QTL Cartographer file

89 views
Skip to first unread message

Sunny Srivastava

unread,
Nov 6, 2009, 6:21:59 PM11/6/09
to R/qtl discussion
Dear Dr. Broman,
I am using your qtl package to analyze qtl data from QTL cartographer.

My data is from RIL (self) and it has 102 individuals with 9
phenotypes for each of the 102 individuals.

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 the code to find what was the problem:

trait.names:
[1] "Tannins" "ES" "DR" "DS" "DT" "ER"
"G29per" "G4per" "ET"

The code is doing what it should do until here ...

now the next few lines of this function perform the following task:

f <- matrix(scan(file, "", skip = skip, nlines = nlines, na.strings =
".",
blank.lines.skip = FALSE, quiet = TRUE), ncol = size)

f contains all the starting from "-s" to "-e" from the .cro file ...
(so this is also fine)

but i think - there is some problem with the following chunk of the
code:

traits <- t(f[-(1:(2 + nmarkers)), ])

--

the traits variable doesnt contain the value of the phenotypes ...

traits is an empty matrix ..

which leads to the error :
Error in names(x) <- value :
'names' attribute [9] must be the same length as the vector [0]

This is the error when I use the function read.cross

Can you please help me with this?

Thanks and Best Regards,
S.



Karl Broman

unread,
Nov 6, 2009, 10:30:50 PM11/6/09
to R/qtl discussion, Sunny Srivastava
If you send me the file directly, I'll try to figure it out.

The analysis of RIL in R/qtl is not well documented and read.cross
doesn't handle such data at all, at the moment.

karl
Reply all
Reply to author
Forward
0 new messages