-1

I would like to use antiSMASH (https://docs.antismash.secondarymetabolites.org/) in Google Colab. How can I set it up and run an example?

rchurt
  • 1,395
  • 1
  • 10
  • 21
  • Based on this question (and answer) and [a related one](https://stackoverflow.com/q/62418312/570918), it appears that you are mostly interested in adding documentation to antiSMASH and do not have questions for the StackOverflow community. Since antiSMASH is an open source project, consider instead [forking their documentation](https://github.com/antismash/documentation) and creating a pull request that incorporates your documentation for using it on Colab. – merv Jun 17 '20 at 00:10
  • Good idea. I think that makes sense in this specific case. I also think that it's worth leaving this here, since I would have found it helpful to find it here when I was trying to implement it. – rchurt Jun 17 '20 at 02:00
  • Yeah, I'm not downvoting or voting to close in this case, but just be aware some might misconstrue it as borderline spam, especially since the two questions are nearly identical in form and solution and the software packages are uncommon (e.g., there's no tag for either of them). One thing I've done in similar instances, where I worked out a complicated install process is to make a Gist script and drop a link to it on an Issues page or Users group. – merv Jun 17 '20 at 02:25
  • Ok I see. If I post it in either of those places, will it still show up prominently in Google search results? I think that's the only way that another user would be able to find it. – rchurt Jun 17 '20 at 02:39
  • I seem to be able to find my Gist things readily in DuckDuckGo without knowing my name (e.g., "install ascp linux"). – merv Jun 17 '20 at 03:42

1 Answers1

2

You must first have Anaconda installed.

The following commands will create a virtual environment and install antiSMASH into it:

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

Download a sample genome to test 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)

Process sample genome with 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
rchurt
  • 1,395
  • 1
  • 10
  • 21