美文网首页
R conda 安装方式与 R包 安装

R conda 安装方式与 R包 安装

作者: Silver_42ac | 来源:发表于2019-12-10 15:47 被阅读0次

    dotPlotly 是两个R 脚本的项目,可以用来画PAF format (minimap2 比对软件的默认输出格式)mummer (nucmer -> show-coords) output 的图形,用来比较两个不同组装的效果

    由于没有自己的R ,集群R 没有包,也没有非 root 下安装所需的集群环境
    这里示范记录下过程
    [1]R 程序conda 安装

    export  PYTHONPATH=""
    #提前清空python 环境,防止conda 与自己修改的环境冲突
    
    conda create -n Rscript   r-base 
    #创建单独的环境,目录出现在miniconda2/envs 下
    
    conda activate Rscript
    #激活环境,关闭使用conda deactivate
    
    

    [2] R 包 安装
    在进入 Rscript 的环境后,命令中直接输入 R 回车,进入R 环境,依次输入命令进行安装

    #指定安装包的来源
    options(repos=structure(c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/")))
    install.packages(c("optparse", "ggplot2", "plotly"))
    
    #提示内容#Please update dplyr with `install.packages("dplyr")`.
    install.packages("dplyr") 继续执行
    
    #退出R终端
    q()
    Save workspace image? [y/n/c]: n
    

    R包 默认装在了~/R/x86_64-pc-linux-gnu-library/3.4

    [3]安装dotPlotly 其实单独下载脚本也行,这里有例子,就用git clone 了

    git clone https://github.com/tpoodotPlotlyrten/dotPlotly.git
    cd dotPlotly
    chmod 755 pafCoordsDotPlotly.R mummerCoordsDotPlotly.R
    #添加执行权限
    

    [4]minimap2 比对

    minimap2 -x asm5 Brassica_rapa.faa Brassica_napus_rape.faa > Brapa_Bnapus.minimap2.paf
    

    [5]使用pafCoordsDotPlotly.R 脚本绘图

    cd dotPlotly/example
    #进入例子里,用例子绘图
    
    ../pafCoordsDotPlotly.R -i Brapa_Bnapus.minimap2.paf -o Brapa_Bnapus.minimap2.plot -m 2000 -q 500000 -k 10 -s -t -l -p 12
    

    参考:
    [R]R指定国内镜像安装R包(R packages)
    https://github.com/tpoorten/dotPlotly

    相关文章

      网友评论

          本文标题:R conda 安装方式与 R包 安装

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