如何使用 Conda 在 Google Colab 中为 BiG-SCAPE 创建虚拟环境?
How do I create a virtual environment for BiG-SCAPE in Google Colab using Conda?
我想在 Google Colab 中使用 BiG-SCAPE (https://git.wageningenur.nl/medema-group/BiG-SCAPE/-/wikis/home)。我如何设置它并 运行 一个例子?
您必须先安装 Anaconda。
以下命令将创建一个虚拟环境并将 BiG-SCAPE 安装到其中:
%%shell
eval "$(conda shell.bash hook)" # copy conda command to shell
# Create virtual environment for BiG-SCAPE, then install dependencies, BiG-SCAPE, and databases into it (this will take a while)
conda create --prefix /usr/local/envs/bigscape python==3.6 -y
conda install --name bigscape hmmer biopython mafft fasttree networkx numpy scipy scikit-learn=0.19.1 -y
conda activate bigscape
# Clone BiG-SCAPE from Git and install in virtual environment
cd /usr/local/envs/bigscape
git clone https://git.wur.nl/medema-group/BiG-SCAPE.git
# Download Pfam database and check that everything was installed properly
cd BiG-SCAPE
mkdir -p databases
cd databases
wget ftp://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam32.0/Pfam-A.hmm.gz && gunzip Pfam-A.hmm.gz
hmmpress Pfam-A.hmm
# Check that everything was installed correctly
cd ..
python bigscape.py --version
conda deactivate
以下命令将下载示例数据集和 运行 BiG-SCAPE:
%%shell
eval "$(conda shell.bash hook)" # copy conda command to shell
# Download example dataset
cd /usr/local/envs/bigscape/BiG-SCAPE
mkdir -p demo
cd demo
wget https://raw.githubusercontent.com/nselem/bigscape-corason/master/scripts/data_bigscape_corason.sh
chmod a+x data_bigscape_corason.sh
bash data_bigscape_corason.sh -b
# Run BiG-SCAPE on example dataset
conda activate bigscape
python /usr/local/envs/bigscape/BiG-SCAPE/bigscape.py \
--inputdir /usr/local/envs/bigscape/BiG-SCAPE/demo/gbks \
--outputdir /gdrive/My\ Drive/Github/cluster_identification/demo/output/BiG-SCAPE \
--pfam_dir /usr/local/envs/bigscape/BiG-SCAPE/databases
conda deactivate
我想在 Google Colab 中使用 BiG-SCAPE (https://git.wageningenur.nl/medema-group/BiG-SCAPE/-/wikis/home)。我如何设置它并 运行 一个例子?
您必须先安装 Anaconda。
以下命令将创建一个虚拟环境并将 BiG-SCAPE 安装到其中:
%%shell
eval "$(conda shell.bash hook)" # copy conda command to shell
# Create virtual environment for BiG-SCAPE, then install dependencies, BiG-SCAPE, and databases into it (this will take a while)
conda create --prefix /usr/local/envs/bigscape python==3.6 -y
conda install --name bigscape hmmer biopython mafft fasttree networkx numpy scipy scikit-learn=0.19.1 -y
conda activate bigscape
# Clone BiG-SCAPE from Git and install in virtual environment
cd /usr/local/envs/bigscape
git clone https://git.wur.nl/medema-group/BiG-SCAPE.git
# Download Pfam database and check that everything was installed properly
cd BiG-SCAPE
mkdir -p databases
cd databases
wget ftp://ftp.ebi.ac.uk/pub/databases/Pfam/releases/Pfam32.0/Pfam-A.hmm.gz && gunzip Pfam-A.hmm.gz
hmmpress Pfam-A.hmm
# Check that everything was installed correctly
cd ..
python bigscape.py --version
conda deactivate
以下命令将下载示例数据集和 运行 BiG-SCAPE:
%%shell
eval "$(conda shell.bash hook)" # copy conda command to shell
# Download example dataset
cd /usr/local/envs/bigscape/BiG-SCAPE
mkdir -p demo
cd demo
wget https://raw.githubusercontent.com/nselem/bigscape-corason/master/scripts/data_bigscape_corason.sh
chmod a+x data_bigscape_corason.sh
bash data_bigscape_corason.sh -b
# Run BiG-SCAPE on example dataset
conda activate bigscape
python /usr/local/envs/bigscape/BiG-SCAPE/bigscape.py \
--inputdir /usr/local/envs/bigscape/BiG-SCAPE/demo/gbks \
--outputdir /gdrive/My\ Drive/Github/cluster_identification/demo/output/BiG-SCAPE \
--pfam_dir /usr/local/envs/bigscape/BiG-SCAPE/databases
conda deactivate