kbroman / qtl

R/qtl: A QTL mapping environment
https://rqtl.org
GNU General Public License v3.0
77 stars 45 forks source link

R/Qtl error #67

Closed DivijaGaniga closed 5 years ago

DivijaGaniga commented 5 years ago

I am new to R and when I am trying to read the file , Data.zip I am getting below error when I am trying to read the csv file for QTL anaysis.

Data <- read.cross("csv",file="Data.csv",genotypes=c("AA","BB","AB"),na.strings=c("","N")) Error in read.cross.csv(dir, file, na.strings, genotypes, estimate.map, : You must include at least one phenotype (e.g., an index). There was this value in the first column of the second row 'Age (Days)' where was supposed to be nothing. In addition: Warning message: In read.cross.csv(dir, file, na.strings, genotypes, estimate.map, : Including "" in na.strings will cause problems; omitted.

Here is my sample data

kbroman commented 5 years ago

R/qtl is intended for QTL analysis of data from simple crosses between inbred lines, such as a backcross or intercross. The input format is rather specific; see Chapter 2 of the R/qtl book.

The Data.csv file within the Data.zip file that you provide is tab-delimited, so you would need to use sep="\t" in the call to read.cross(), but the main problems are that you shouldn't include the founder strains, you would need many more than two individuals, and you would need to restructure the data file a bit; see the sample CSV data files at http://www.rqtl.org/sampledata/.

DivijaGaniga commented 5 years ago

Thank You. There are many more than two individuals in the analysis I just sent part of the file . To re-structure the file Phenotype should be put on columns which imay be difficult task as there are many number of rows for particular phenotype.

On Mon, Oct 29, 2018 at 1:35 PM Karl Broman notifications@github.com wrote:

R/qtl is intended for QTL analysis of data from simple crosses between inbred lines, such as a backcross or intercross. The input format is rather specific; see Chapter 2 of the R/qtl book http://rqtl.org/book.

The Data.csv file within the Data.zip file that you provide is tab-delimited, so you would need to use sep="\t" in the call to read.cross(), but the main problems are that you shouldn't include the founder strains, you would need many more than two individuals, and you would need to restructure the data file a bit; see the sample CSV data files at http://www.rqtl.org/sampledata/.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kbroman/qtl/issues/67#issuecomment-434003905, or mute the thread https://github.com/notifications/unsubscribe-auth/Aqg0Dii8QKV4icjI208E9O41AVDUWUh5ks5upzxwgaJpZM4X_dQC .

kbroman commented 5 years ago

I don't completely understand what you mean, but you could could use the "csvr" format where the rows are phenotypes and then markers, and the columns are individuals. Here's an example from the R/qtl book, chapter 2 pg 29:

figure_2-4

DivijaGaniga commented 5 years ago

I have two files for the same analysis one is my data and other is data from other source for the same phenotype and I need to compare my data with their data. So can I use "merge" function between the two files to compare in R/qtl?

On Tue, Oct 30, 2018 at 10:52 AM Karl Broman notifications@github.com wrote:

I don't completely understand what you mean, but you could could use the "csvr" format where the rows are phenotypes and then markers, and the columns are individuals. Here's an example from the R/qtl book http://rqtl.org/book, chapter 2 pg 29:

[image: figure_2-4] https://user-images.githubusercontent.com/53972/47726801-3671d600-dc29-11e8-9082-c494122ba860.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kbroman/qtl/issues/67#issuecomment-434331767, or mute the thread https://github.com/notifications/unsubscribe-auth/Aqg0Dh22Tnj2ONhSjJkIBdaqXr3Q-cawks5uqGe0gaJpZM4X_dQC .

kbroman commented 5 years ago

There's a c.cross() function that can be used to combine two crosses. Or you could load the two datasets, analyze them separately, and compare the results.