snpStats 패키지를 사용하여 연결을 수행하려고합니다.S4 개체의 반복 열이 R
내 유전자형 데이터 ( $ genotypes, $ map, $ fam의 목록)를 포함하는 plink라는 plp 매트릭스가 있고 plink $ genotype은 다음과 같습니다. SNP 이름이 열 이름 (2 SNP)이고
plink$genotype
SnpMatrix with 6 rows and 2 columns
Row names: 1 ... 6
Col names: 203 204
가용 스루풋 데이터 세트는 다음 PED 및지도 파일을 복사하고 'plink.ped'로 저장 각각 plink.map '재현 할 수 있습니다 :
plink.ped:
1 1 0 0 1 -9 A A G G
2 2 0 0 2 -9 G A G G
3 3 0 0 1 -9 A A G G
4 4 0 0 1 -9 A A G G
5 5 0 0 1 -9 A A G G
6 6 0 0 2 -9 G A G G
plink.map:
1 203 0 792429
2 204 0 819185
행 이름과 주제 식별자
다음과 같이 plink를 사용하십시오 :
, I은 또한 결과를 포함하는 표현형 데이터 프레임을은 (outcome1, outcome2, ...) I이 인 유전자형으로 연결하고자
./plink --file plink --make-bed
@[email protected]
| PLINK! | v1.07 | 10/Aug/2009 |
|----------------------------------------------------------|
| (C) 2009 Shaun Purcell, GNU General Public License, v2 |
|----------------------------------------------------------|
| For documentation, citation & bug-report instructions: |
| http://pngu.mgh.harvard.edu/purcell/plink/ |
@[email protected]
Web-based version check (--noweb to skip)
Recent cached web-check found...Problem connecting to web
Writing this text to log file [ plink.log ]
Analysis started: Tue Nov 29 18:08:18 2011
Options in effect:
--file /ugi/home/claudiagiambartolomei/Desktop/plink
--make-bed
2 (of 2) markers to be included from [ /ugi/home/claudiagiambartolomei/Desktop /plink.map ]
6 individuals read from [ /ugi/home/claudiagiambartolomei/Desktop/plink.ped ]
0 individuals with nonmissing phenotypes
Assuming a disease phenotype (1=unaff, 2=aff, 0=miss)
Missing phenotype value is also -9
0 cases, 0 controls and 6 missing
4 males, 2 females, and 0 of unspecified sex
Before frequency and genotyping pruning, there are 2 SNPs
6 founders and 0 non-founders found
Total genotyping rate in remaining individuals is 1
0 SNPs failed missingness test (GENO > 1)
0 SNPs failed frequency test (MAF < 0)
After frequency and genotyping pruning, there are 2 SNPs
After filtering, 0 cases, 0 controls and 6 missing
After filtering, 4 males, 2 females, and 0 of unspecified sex
Writing pedigree information to [ plink.fam ]
Writing map (extended format) information to [ plink.bim ]
Writing genotype bitfile to [ plink.bed ]
Using (default) SNP-major mode
Analysis finished: Tue Nov 29 18:08:18 2011
:
가
ID<- 1:6
sex<- rep(1,6)
age<- c(59,60,54,48,46,50)
bmi<- c(26,28,22,20,23, NA)
ldl<- c(5, 3, 5, 4, 2, NA)
pheno<- data.frame(ID,sex,age,bmi,ldl)
연관이 작동 하나의 용어 나는이 작업을 수행 할 때 ("snp.rhs.test"공식을 사용하여) :
bmi<-snp.rhs.tests(bmi~sex+age,family="gaussian", data=pheno, snp.data=plink$genotype)
내 질문은, 어떻게 결과를 통해 I를 루프를 할 수 있습니까? 이 데이터 유형 은 다른 모든 것과 다르게 보입니다. 문제가 발생하면 을 조작합니다. 제안 사항이 있으면 내게 도움이 될 수있는 자습서 중 일부는 하위 집합과 같이 처리하는 데 도움이됩니다. 예를 들어 snp.matrix 데이터.
Error in eval(expr, envir, enclos) : object 'bmi' not found
for (cov in names(pheno)) {
association<-snp.rhs.tests(cov, family="gaussian",data=pheno, snp.data=plink$genotype)
}
당신의 도움을 평소와 같이 주셔서 감사합니다 : 그럼이 시도
rhs <- function(x) {
x<- snp.rhs.tests(x, family="gaussian", data=pheno,
snp.data=plink$genotype)
}
res_ <- apply(pheno,2,rhs)
Error in x$terms : $ operator is invalid for atomic vectors
:
이
내가 루프 시도 것입니다 ! -f
함께 놀 수있는 예제 데이터 세트가 있습니까? –
행렬에'$'를 쓰지 말고, 대신에 snp.matrix [, "genotype"]'을 사용하십시오. – James
혼란을 가져 주셔서 진심으로 질문드립니다. 생성 된 snpmatrix 데이터를 추가하겠습니다. 이것이 여전히 혼란 스럽다면 plink ... – user971102