ExpFile="rocSigExp. TXT"
ClinicalFile="clinical. TXT"
Exp=read. Table (expFile, sep="\ t", the header=t, check the names=F, row. Names=1)
Cli=read. Table (clinicalFile, sep="\ t", the header=t, check the names=F, row. Names=1)
Exp=exp [, 3: ncol (exp)]
SamSample=intersects (row. Names (exp), row. The names (cli))
Exp=exp/samSample,
Cli=cli/samSample,
PFilter=0.05
OutTab=c ()
OutTab=rbind (outTab, c (" id ", colnames (cli), "SigNum"))
Colnames (outTab)=c (" id ", colnames (cli), "SigNum")
For (I in colnames (exp)) {
ClinicalPvalVector=c ()
SigSum=0
For (clinical in colnames (cli)) {
Tab1=table (cli [, clinical])
LabelNum=length (tab1)
Rt1=cbind (expression=exp [, I], clinical=cli [, clinical])
If (labelNum==2) {
CliTest<- Wilcox. Test (expression to clinical, data=https://bbs.csdn.net/topics/rt1)
} else {
CliTest<- kruskal. Test (expression to clinical, data=https://bbs.csdn.net/topics/rt1)}
pValue=https://bbs.csdn.net/topics/cliTest$p.value
ClinicalPvalVector=c (clinicalPvalVector pValue)
If (pValue
}
}
GeneClinical=c (I, clinicalPvalVector sigSum)
OutTab=rbind (outTab geneClinical)
}
Write. The table (outTab, file="clinicalCor. XLS", sep="\ t", col. Names=F, row. Names=F, quote=F)
When running error
CodePudding user response:
Is there a great god to solve ah