軟件與數(shù)據(jù)下載問題

1.首先系統(tǒng)安裝軟件

ubuntu 18.04 下載軟件
apt-get install software

更改系統(tǒng)下載鏡像,更換阿里源或者清華源

cp /etc/apt/sources.list /etc/apt/sources.list.bak

源文件內(nèi)容如下:


圖片.png

修改為:

# 阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multivers
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# 清華源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

修改完 保存并更新
apt-get update
apt-get upgrade

注意原文件中“bionic” 要與更換源的“bionic”一致,不然更新會出問題

R 相關(guān)下載與換源

  1. 安裝包
    install.packages("BiocInstaller")
  2. 卸載已安裝包
    remove.packages("BiocInstaller")
  3. 查看已加載包
    (.packages())
  4. 卸除已加載包
    detach("package:BiocInstaller")
  5. 查看已安裝的包
    installed.packages()
  6. 查看某個安裝包提供的函數(shù)
    help(package="BiocInstaller")
  7. 查看某個函數(shù)屬于哪個包
    help("biocLite")
    R包安裝路徑

.libPaths("~/R/lib") 如果不安裝到默認(rèn)路徑,可以在此設(shè)置安裝路徑*
install.packages("ggplot2")
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")

BiocManager::install("Logolas")

圖片.png

perl相關(guān)下載

perl模塊安裝:

perl -MCPAN -e 'install 模塊'

cpan> install  模塊

perl 安裝模塊換源

cpan[2]> o conf urllist

urllist

0 [[http://www.cpan.org/](http://www.cpan.org/)]

Type 'o conf' to view all configuration items

[http://mirrors.ustc.edu.cn/CPAN/](http://mirrors.ustc.edu.cn/CPAN/)

cpan[3]> o conf urllist push https:////[mirrors.aliyun.com/CPAN/](http://mirrors.aliyun.com/CPAN/)

Please use 'o conf commit' to make the config permanent!

cpan[4]> o conf commit

commit: wrote '/root/.cpan/CPAN/MyConfig.pm'

cpan[5]> o conf urllist

urllist

0 [[http://www.cpan.org/](http://www.cpan.org/)]

1 [[https://mirrors.aliyun.com/CPAN/](https://mirrors.aliyun.com/CPAN/)]

Type 'o conf' to view all configuration items

查找模塊在哪個路徑
/usr/bin/perldoc -l Bio::DB::GFF
在腳本中定義使用模塊的路徑

1.第一種辦法:
use lib qw(絕對路徑)


圖片.png

perl安裝模塊會到不同的路徑中,缺哪個模塊就去找到該模塊的路徑 ,沒有的話在安裝

2.第二種辦法:

添加perl調(diào)用模塊的路徑到環(huán)境變量中

export PERL5LIB="/usr/share/perl5:/usr/local/lib/x86_64-linux-gnu/perl/5.26.1:$PERL5LIB"

o conf urllist # 查看cpan模塊源

o conf urllist push https:////mirrors.aliyun.com/CPAN/ # 添加阿里云的源

o conf commit # 保存

3.python相關(guān)下載

pypi 鏡像使用幫助

pypi 鏡像每 5 分鐘同步一次。

臨時使用


pip install -i [https://pypi.tuna.tsinghua.edu.cn/simple](https://pypi.tuna.tsinghua.edu.cn/simple) some-package

注意,simple 不能少, 是 https 而不是 http

設(shè)為默認(rèn)

升級 pip 到最新的版本 (>=10.0.0) 后進(jìn)行配置:

pip install pip -U

pip config set global.index-url [https://pypi.tuna.tsinghua.edu.cn/simple](https://pypi.tuna.tsinghua.edu.cn/simple)

如果您到 pip 默認(rèn)源的網(wǎng)絡(luò)連接較差,臨時使用本鏡像站來升級 pip:

pip install -i [https://pypi.tuna.tsinghua.edu.cn/simple](https://pypi.tuna.tsinghua.edu.cn/simple) pip -U

光速安裝python包

pip install matplotlib==1.5.1 -i [http://pypi.douban.com/simple](http://pypi.douban.com/simple) --trusted-host [pypi.douban.com](http://pypi.douban.com/)

pip install matplotlib -i https://[pypi.tuna.tsinghua.edu.cn/simple](http://pypi.tuna.tsinghua.edu.cn/simple)

刪除python包

pip uninstall matplotlib

查看包的版本

pip show matplotlib

不同版本python之間 pip的用法

已有python2.7與python3,沒有python3的pip,先安裝pip

apt-get install python3-pip

python3.8 -m pip install biopython

安裝biopython

if name == 'main' 解釋:

當(dāng)一個腳本直接運(yùn)行時,一下內(nèi)容都會被輸出


圖片.png

當(dāng)被當(dāng)做模塊使用是:

圖片.png

直接運(yùn)行該腳本時,會運(yùn)行腳本內(nèi)所有內(nèi)容,但是當(dāng)被模塊導(dǎo)入時,不會運(yùn)行if name == 'main':下面的內(nèi)容,一般后面會跟main()函數(shù),這樣寫避免了運(yùn)行其他腳本,import模塊時因為模塊名字和該腳本名稱一樣,導(dǎo)致運(yùn)行內(nèi)容不同。

4.shell相關(guān)下載

調(diào)用for循環(huán)批處理文件

for filename in ./seq/*_1.fq.gz
do

提取雙端公共文件名,并輸出檢驗

base=(basenamefilename _1.fq.gz)
echo $base

多行fa序列變一行

awk '/^>/&&NR>1{print "";}{printf "%s",/^>/?0"\n":0}' file.fa

圖片.png

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容