安装 pRRophetic 包

作者: 王诗翔 | 来源:发表于2020-04-12 15:52 被阅读0次

    该包的 GitHub 项目地址:https://github.com/paulgeeleher/pRRophetic2

    从文档看这个包可以用基因表达数据预测表型和药物反应。

    这是一个感觉有点古老的包,特别大。

    我们先安装它的依赖包:

    BiocManager::install(c('sva', 'car', 'genefilter', 'preprocessCore', 'ridge'))
    

    这里 BiocManager 包需要提前安装好,使用 install.packages("BiocManager") 即可。

    搞定之后我们需要把这个包下载下来,网页在 https://osf.io/5xvsg/wiki/home/,使用命令:

    wget -O pRRophetic_0.5.tar.gz  https://osf.io/dwzce/?action=download
    

    有 500+MB,我把它存在坚果云了,可以使用 https://www.jianguoyun.com/p/DdY8HJAQ6uuVCBjljo4D (微信推文点击原文链接)点击下载。

    下载之后进行安装,在 R 控制台运行命令:

    install.packages("pRRophetic_0.5.tar.gz", repos = NULL, dependencies = TRUE)
    

    测试

    安装好之后我们需要测试下包能不能正常使用,这里就跟着文档做个几步看看。

    先载入包和进行设置:

    > library(pRRophetic)
    Warning message:
    replacing previous import ‘car::Anova’ by ‘genefilter::Anova’ when loading ‘pRRophetic’ 
    > set.seed(1234)
    

    载入数据,画个图看看:

    > data("bortezomibData")
    > pRRopheticQQplot("Bortezomib")
    

    五折交叉验证,这一点我的电脑有点 hold 不住:

    > cvOut <- pRRopheticCV("Bortezomib", cvFold=5, testExprData=exprDataBortezomib)
    
     11683  gene identifiers overlap between the supplied expression matrices... 
     
    Found2batches
    Adjusting for0covariate(s) or covariate level(s)
    Standardizing Data across genes
    Fitting L/S model and finding priors
    Finding parametric adjustments
    Adjusting the Data
    
    
    1 of 5 iterations complete.
    2 of 5 iterations complete.
    3 of 5 iterations complete.
    4 of 5 iterations complete.
    5 of 5 iterations complete.
    

    画个结果图:

    > plot(cvOut)
    

    一般般的效果:

    模型结果还是显著的:

    > summary(cvOut)
    
    Summary of cross-validation results:
    
    Pearsons correlation: 0.4 , P =  4.45287272844977e-12 
    R-squared value: 0.16
    Estimated 95% confidence intervals: -4.23, 4.23
    Mean prediction error: 1.64
    

    有了模型就可以做预测了:

    > predictedPtype <- pRRopheticPredict(exprDataBortezomib, "Bortezomib",
    +                                     selection=1)
    
     11683  gene identifiers overlap between the supplied expression matrices... 
     
    Found2batches
    Adjusting for0covariate(s) or covariate level(s)
    Standardizing Data across genes
    Fitting L/S model and finding priors
    Finding parametric adjustments
    Adjusting the Data
    
    
     2324 low variabilty genes filtered.
    Fitting Ridge Regression model... Done
    
    Calculating predicted phenotype...Done
    

    其他的我就不说了,感兴趣的读者可以把文档代码过一遍。这个是一个读者的问题,但我自己走下来发现没有难点,可能就这个包有点大。如果读者不会安装 R 包建议看下我在教程里写的有关 R 包安装的内容:https://shixiangwang.gitee.io/geek-r-tutorial/

    相关文章

      网友评论

        本文标题:安装 pRRophetic 包

        本文链接:https://www.haomeiwen.com/subject/drtbmhtx.html