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

Ubuntu 如何使用Conda在Google Colab中为反mash创建虚拟环境?,ubuntu,conda,google-colaboratory,bioinformatics,virtual-environment,Ubuntu,Conda,Google Colaboratory,Bioinformatics,Virtual Environment,我想在googlecolab中使用antiSMASH()。如何设置并运行示例?您必须首先安装Anaconda 以下命令将创建虚拟环境并在其中安装antiSMASH: %%shell eval "$(conda shell.bash hook)" # copy conda command to shell # Create virtual environment for antiSMASH, then install dependencies, antiSMASH, and databases

我想在googlecolab中使用antiSMASH()。如何设置并运行示例?

您必须首先安装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
下载样本基因组以测试反mash

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)
%%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
用反mash处理样本基因组

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)
%%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

基于这个问题(和答案),您似乎最感兴趣的是向antiSMASH添加文档,而对StackOverflow社区没有问题。既然反SMTASH是一个开源项目,那么请考虑并创建一个拉取请求,它包含了您在COLAB上使用它的文档。好主意。我认为在这种特殊情况下,这是有道理的。我还认为把它留在这里是值得的,因为我在尝试实现它的时候会发现在这里找到它是很有帮助的。是的,在这种情况下,我没有投反对票或投票结束,但要知道有些人可能会将其误解为边缘垃圾邮件,特别是因为这两个问题在形式和解决方案上几乎相同,而且软件包也不常见(例如,它们都没有标签)。在类似的例子中,我做过一件事,我制定了一个复杂的安装过程,那就是制作一个Gist脚本,并在问题页面或用户组中放置一个指向它的链接。如果我把它贴在这两个地方中的任何一个,它还会出现在谷歌搜索结果的显著位置吗?我认为这是其他用户能够找到它的唯一方法。我似乎能够在DuckDuckGo中轻松找到我的要点,而不知道我的名字(例如,“安装ascp linux”)。