1.首先系統(tǒng)安裝軟件
ubuntu 18.04 下載軟件
apt-get install software
更改系統(tǒng)下載鏡像拥褂,更換阿里源或者清華源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
源文件內(nèi)容如下:
修改為:
# 阿里源
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)下載與換源
- 安裝包
install.packages("BiocInstaller") - 卸載已安裝包
remove.packages("BiocInstaller") - 查看已加載包
(.packages()) - 卸除已加載包
detach("package:BiocInstaller") - 查看已安裝的包
installed.packages() - 查看某個安裝包提供的函數(shù)
help(package="BiocInstaller") - 查看某個函數(shù)屬于哪個包
help("biocLite")
R包安裝路徑
.libPaths("~/R/lib") 如果不安裝到默認(rèn)路徑瞎疼,可以在此設(shè)置安裝路徑*
install.packages("ggplot2")
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("Logolas")
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(絕對路徑)
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)一個腳本直接運行時,一下內(nèi)容都會被輸出
當(dāng)被當(dāng)做模塊使用是:
直接運行該腳本時窖杀,會運行腳本內(nèi)所有內(nèi)容漓摩,但是當(dāng)被模塊導(dǎo)入時,不會運行if name == 'main':下面的內(nèi)容入客,一般后面會跟main()函數(shù)管毙,這樣寫避免了運行其他腳本腿椎,import模塊時因為模塊名字和該腳本名稱一樣,導(dǎo)致運行內(nèi)容不同夭咬。
4.shell相關(guān)下載
調(diào)用for循環(huán)批處理文件
for filename in ./seq/*_1.fq.gz
do
提取雙端公共文件名酥诽,并輸出檢驗
base=filename _1.fq.gz)
echo $base
多行fa序列變一行
awk '/^>/&&NR>1{print "";}{printf "%s",/^>/?0}' file.fa