How to get rid of the extra ID phenotype?

58 views
Skip to first unread message

Karl Broman

unread,
Nov 3, 2014, 5:17:09 PM11/3/14
to rqtl...@googlegroups.com
I got the following question by email, and I thought others might be interested in the question and my response.

karl

----

I have formatted my files into csvsr format, but when I used the read.cross function, I always have one more phenotype which is actually the id number. How should I correct this?

 mydata <- read.cross("csvsr",dir="",genfile="updated_step3_geno.csv",
                      phefile
="pheno_drate_mapped.csv", na.strings=c("-", "NA"),
                      genotypes
=c("A", "B"))

----

You could just delete the ID phenotype afterwards:

idcolumn <- grep("id", phenames(mydata))
mydata$pheno
<- mydata$pheno[,-idcolumn]

Lara B

unread,
Nov 22, 2021, 8:55:46 PM11/22/21
to R/qtl discussion
Hi Dr. Broman,

I am having a similar issue as above and I'm not sure how to remedy it. I noticed it when I received an error with the scanone function:
> out.em <- scanone(chilling)
Error in checkcovar(cross, pheno.col, addcovar, intcovar, perm.strata,: Following phenotypes are not numeric: id

For the phefile, I have 1 phenotype column named "necrosis" and the other column labeled as "id" with the progeny names (emailed). However the program is counting the id column as a phenotype:

> chilling <- read.cross(format="csvs", fileEncoding = 'UTF-8-BOM',
                     dir="populations.1", 
                     genfile="populations.F2.rqtl.csv", 
                     phefile="necrosis.csv",
                     genotypes=c("a", "b", "h")
                     )

> summary(chilling)
2 phenotypes


I tried deleting the ID phenotype with your code from the previous email before the scanone step (after plotting markers, calculating rf, and calculating error.lod), but I get the error:
#Error in if (ncol(object$pheno) <= 30) missing.phe <- as.numeric(cbind(apply(object$pheno,  :  argument is of length zero

I tried starting from scratch and deleting the ID phenotype with your code right after defining the datafile as above, but then I get the error:
> summary(chilling)
Error in if (ncol(object$pheno) <= 30) missing.phe <- as.numeric(cbind(apply(object$pheno,:argument is of length zero

Please advise. Thanks!

Karl Broman

unread,
Nov 22, 2021, 9:06:45 PM11/22/21
to rqtl...@googlegroups.com
Try using pheno.col=2 or pheno.col=“necrosis” in the call to scanone().

karl

On Nov 22, 2021, at 7:55 PM, Lara B <ljbri...@gmail.com> wrote:

Hi Dr. Broman,
--
You received this message because you are subscribed to the Google Groups "R/qtl discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rqtl-disc+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rqtl-disc/a1e8b356-7baa-4c0d-be6a-dc0d6feeae74n%40googlegroups.com.

Lara B

unread,
Nov 22, 2021, 9:44:06 PM11/22/21
to R/qtl discussion
Perfect thank you! 
Reply all
Reply to author
Forward
0 new messages