使用R语言的biomart包,可以完成这个任务。
```r
# 安装biomaRt包
source("http://bioconductor.org/biocLite.R")
biocLite("biomaRt")
# 加载biomaRt包
library(biomaRt)
# 定义数据库
mart <- useMart("ensembl", dataset="hsapiens_gene_ensembl")
# 根据基因名,批量提取蛋白质序列
seq = getSequence(id = c("BRCA1","TP53"),
type = "hgnc_symbol",
seqType = "peptide",
mart = mart)
# 显示基因名和蛋白质序列
show(seq)
# 默认目录下输出fasta格式seq
exportFASTA(seq, file="seq")
```
|
|
|