Как создать виртуальную среду для antiSMA SH в Google Colab с помощью Conda? - PullRequest
0 голосов
/ 17 июня 2020

Я хотел бы использовать antiSMA SH (https://docs.antismash.secondarymetabolites.org/) в Google Colab. Как мне настроить и запустить пример?

1 Ответ

2 голосов
/ 17 июня 2020

Сначала необходимо установить Anaconda.

Следующие команды создадут виртуальную среду и установят в нее antiSMA SH:

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

Загрузите образец генома для проверки antiSMA SH

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)

Обработка образца генома с помощью antiSMA SH

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