Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with check.missing #1

Open
fkgruber opened this issue Jun 14, 2017 · 2 comments
Open

issue with check.missing #1

fkgruber opened this issue Jun 14, 2017 · 2 comments

Comments

@fkgruber
Copy link

Hi,
I was trying to use your package and I'm getting the following error:
after typing:

pdata = load.plink.file("PlinkFiles/noout_75min_p.bed")
cdata = load.coord.file("coord2.txt")
raw.data <- check.missing(pdata, cdata)

I'm getting:

Error in .local(x, i, j, ..., drop) : 
  One or more row selections out of range

This is what pdata looks like:

> str(pdata)
List of 3
 $ genotypes:Formal class 'SnpMatrix' [package "snpStats"] with 1 slot
  .. ..@ .Data: raw [1:90, 1:7667] 03 03 03 03 ...
  .. .. ..- attr(*, "dimnames")=List of 2
  .. .. .. ..$ : chr [1:90] "101156" "101157" "101160" "101164" ...
  .. .. .. ..$ : chr [1:7667] "locus_12958:1" "locus_27912:1" "locus_30206:1" "locus_35978:1" ...
 $ fam      :'data.frame':	90 obs. of  6 variables:
  ..$ pedigree: chr [1:90] "101156" "101157" "101160" "101164" ...
  ..$ member  : chr [1:90] "101156" "101157" "101160" "101164" ...
  ..$ father  : logi [1:90] NA NA NA NA NA NA ...
  ..$ mother  : logi [1:90] NA NA NA NA NA NA ...
  ..$ sex     : logi [1:90] NA NA NA NA NA NA ...
  ..$ affected: logi [1:90] NA NA NA NA NA NA ...
 $ map      :'data.frame':	7667 obs. of  6 variables:
  ..$ chromosome: int [1:7667] 1 1 1 1 1 1 1 1 1 1 ...
  ..$ snp.name  : chr [1:7667] "locus_12958:1" "locus_27912:1" "locus_30206:1" "locus_35978:1" ...
  ..$ cM        : logi [1:7667] NA NA NA NA NA NA ...
  ..$ position  : int [1:7667] 1 1 1 1 1 1 1 1 1 1 ...
  ..$ allele.1  : chr [1:7667] "A" "T" "G" "C" ...
  ..$ allele.2  : chr [1:7667] "G" "C" "A" "T" ...

and this is what the cdata looks like:

str(cdata)
'data.frame':	90 obs. of  4 variables:
 $ id       : int  113582 103263 91917 113566 92127 101156 101157 113574 113576 103210 ...
 $ latitude : num  -23.1 -23 -22.9 -23 -22.9 ...
 $ longitude: num  119 119 119 119 119 ...
 $ region   : chr  "region_1" "region_1" "region_1" "region_1" ...
@BenjaminPeter
Copy link
Owner

hmm, I wonder if the type mismatch between coordinate file ids (int) and genotypes (pdata$genotype) (str) is the issue. If so, the recent commit should have fixed that, would you mind trying it?

@fkgruber
Copy link
Author

thanks
I ended up fixing the mismatch. It seems that there was a sample with a different id in the genotype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants