如何使用 Conda 在 Google Colab 中为 antiSMASH 创建虚拟环境?

教堂

我想用antiSMASH(https://docs.antismash.secondarymetabolites.org/在谷歌Colab)。如何设置并运行示例?

教堂

您必须首先安装 Anaconda。

以下命令将创建一个虚拟环境并将 antiSMASH 安装到其中:

%%shell
eval "$(conda shell.bash hook)" # copy conda command to shell

# Create virtual environment for antiSMASH, then install dependencies, antiSMASH, and databases into it (this will take a while)
conda create --prefix /usr/local/envs/antismash antismash -y
conda activate antismash

# Download antiSMASH databases and check that everything was installed properly
download-antismash-databases
antismash --check-prereqs
conda deactivate

下载样本基因组以测试 antiSMASH

accession = 'NC_013216'
antismash_path = '/usr/local/envs/antismash'
output_string = '%s/output/%s.gbk'%(antismash_path, accession.strip())

handle = Entrez.efetch(db="nucleotide", id=accession, rettype="gbwithparts", retmode="text")
print('Download of %s successful'%(accession.strip()))
print('Reading ' + output_string + '...')
record_string = handle.read()
with open(output_string, 'w') as record_writer:
    record_writer.write(record_string)
print('Saved as: ' + output_string)

使用 antiSMASH 处理样本基因组

%%shell
eval "$(conda shell.bash hook)" # copy conda command to shell

conda activate antismash

echo "Processing with antiSMASH..."
antismash /usr/local/envs/antismash/output/NC_013216.gbk \
  --output-dir /usr/local/envs/antismash/output/NC_013216

conda deactivate

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何使用conda在Flask中设置虚拟环境?

如何使用python==2.7.12创建conda虚拟环境

如何在 conda 的虚拟环境中安装 Anaconda。

使用 conda 在虚拟环境中更新包

在Windows 10中静默创建conda虚拟环境

如何在Pycharm中为Django创建虚拟环境?

Conda:创建虚拟环境

忽略VSCode中的Conda虚拟环境

如何在“基础”中基于新安装更新conda虚拟环境?

如何在 conda 虚拟环境中获得程序的“sudo”特权?

在 conda 虚拟环境中以 pip 兼容格式创建 requirements.txt

Conda 在 VSCode 中使用 pypy 作为解释器创建虚拟环境

Docker无法创建conda虚拟环境

如何更改现有conda虚拟环境的Python版本?

我无法在conda中激活虚拟环境

Conda虚拟环境/ Atom.ide中的Plotly问题

conda 虚拟环境中的 Jupyter 魔术命令 %%time 错误

从 conda 中选择 atom 中的虚拟环境

在Conda虚拟环境中使用Github的软件包

如何使用bash命令在Windows 10中创建和激活虚拟环境

使用conda创建虚拟环境,尽管指定了版本,但我得到的Python版本错误。为什么?

为什么在虚拟环境中无法使用Google AI平台进行本地培训?

创建符合旧版 Anaconda 的 conda 虚拟环境

使用Python文档创建虚拟环境

如何防止conda虚拟环境点使用Python 2.7系统库?

如何使用VSCode在虚拟环境中调试python代码?

如何使conda虚拟环境持久且可用于Jupyter Notebook之类的工具?

致命的Python错误:无法在conda虚拟环境中启动旧版本的python

在 Windows 上的 conda 虚拟环境中安装旧版本的 h2o