0
$\begingroup$

Can anyone offer advice on what the below error code relates to. I am using co-loc R package with 2 GWAS datasets. Using coloc.abf function with pvalues, MAF, sample size and case/control cohort. Thank you

  results <- coloc.abf(  dataset1=list(snp=as.character(1_subset[,2]),pvalues=1_subset[,11],N=1_data_subset$sample_size, type="cc",s=0.327,MAF=1_data_subset[,12]),   dataset2=list(snp=as.character(2_subset[,2]),pvalues=2_subset[,8],N=2_subset$sample_size,s=0.4319,MAF=1_subset[,12], type="cc"),p12=1e-06)


error code: Error in data.frame(V, z, r, lABF) : 
  arguments imply differing number of rows: 1994, 1992
In addition: Warning messages:
1: In 2 * N * f :
  longer object length is not a multiple of shorter object length
2: In 2 * N * f * (1 - f) :
  longer object length is not a multiple of shorter object length
3: In r * z^2 :
  longer object length is not a multiple of shorter object length
$\endgroup$
2
  • $\begingroup$ Hi, I can't replicate your error message. Can you double check that the line of code you inputted is the same as that which gave the error message. $\endgroup$
    – user438383
    Apr 3 '20 at 11:00
  • $\begingroup$ The only thing different is that I put the code in a loop to make code quicker if(length(tmp)>0){ results = coloc.abf( dataset1=list(snp=as.character(1_subset[,2]),pvalues=1_subset[,11],N=1_subset$sample_size, type="cc",s=0.327,MAF=1_subset[,12]), dataset2=list(snp=as.character(2_subset[,2]),pvalues=2_subset[,8],N=2_subset$sample_size,s=CCRATIO,MAF=1_subset[,12], type="cc"),p12=1e-06) } $\endgroup$ Apr 3 '20 at 14:21
0
$\begingroup$

In your dataset2 = list(), the MAF argument should be MAF=2_subset[,12] instead of MAF=1_subset[,12]. Since your two datasets have different numbers of lines, this is what causes the error.

I am not sure whether this is a typo in your code, or it is because you do not have MAF information in the second dataset. What I like to do before COLOC is to filter two datasets so they have the same number of lines, and then feed those filtered datasets to the coloc function.

(Also just out of curiosity, is 1_subset a data frame for your GWAS results? I think it is not recommended to have variable names starting with a number.)

$\endgroup$
1
  • $\begingroup$ Thank you for your reply. That is really kind. I dont have MAF for dataset two so used dataset 1 for both. I will try the filter function and then maybe input MAF detail first onto the second dataset using 1st dataset. I did change the names, didnt want to use the disease names on forum. Thank you for double checking! Have a safe day, kind regards! $\endgroup$ Apr 5 '20 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.