Help with: Error in seq.default(1, nchr, by = ncycle) : invalid '(to - from)/by'

Hello
I am recently using FarmCPU for my GWAS analysis. Whenever I quote command of covariate variable (PCA) that gives error message as below.

setwd("C:\\myFarmCPU")
myY <- read.table("mdp_traits_validation.txt", head = TRUE)
myGM <- read.table("mdp_SNP_information.txt", head = TRUE)
myGD <- read.big.matrix("mdp_numeric.txt", type="char", sep="\t", head = TRUE)
myCV <- read.table("Copy of Q_First_Three_Principal_Components.txt", head = TRUE)
myFarmCPU <- FarmCPU(
  Y=myY[,c(1,8)],
  GD=myGD,
  GM=myGM,
  CV=myCV
)
[1] "--------------------- Welcome to FarmCPU ----------------------------"
[1] "FarmCPU Started..."
[1] "Current loop: 1 out of maximum of 10"
[1] "seqQTN"
NULL
[1] "scanning..."
[1] "number of covariates in current loop is:"
[1] 4
[1] "Current loop: 2 out of maximum of 10"
[1] "optimizing possible QTNs..."
[1] "Top snps have little effect, set seqQTN to NULL!"
Error in seq.default(1, nchr, by = ncycle) : invalid '(to - from)/by'

Kindly suggest me solution for this

Hi Gopal, welcome to community.rstudio.com!

Helping resolve coding issues can be hard. Could you edit your question after reviewing our Guide for writing R-related questions?
For example, a reprex would be really helpful here.

Error in seq.default(1, nchr, by = ncycle) : invalid '(to - from)/by'
i just wanted to know the meaning of above output

Narrowly, that’s an error from the seq() function (here is its documentation). It has been called with the following parameters:

  • from = 1
  • to = nchr
  • by = ncycle

seq() produces regular sequences of numbers. When calling it with these arguments, it tries to produce a sequence from 1 to nchr, with an increment of ncycle — so (nchr - 1) / ncycle needs to be a number that makes sense. The error message is saying that this is not the case.

Broadly, you didn’t call this function yourself. It appears to be part of the internal operations of FarmCPU(). So understanding this specific error isn’t that helpful. Something is wrong further upstream that is causing this part of FarmCPU’s code to get called with invalid values for either nchr or ncycle.

I’m afraid I don’t know enough about this package to get much further than that. Maybe someone else with more experience with it will stop by! Otherwise, if you’ve consulted the documentation and compared it to your code to check for mistakes in how you’re using the function and you’re still getting the error, you might try posting a question to the mailing list for this package: https://groups.google.com/forum/#!forum/gapit-forum

2 Likes

I am not getting your point..Can u Pl help me to get out of this

There seem to be another person with the same challenge here.

As this seem to be a package specific challenge, perhaps you could consider asking that person, if a solution was found :slightly_smiling_face: