<p>In my personal experience, MUSCLE is the easiest program to use in conjunction with Biopython. Biopython features a <a href="https://biopython.org/docs/1.75/api/Bio.Align.Applications.html" rel="nofollow noreferrer">command line wrapper</a> for this program, which makes it very easy to use. Make sure to <a href="http://www.drive5.com/muscle/downloads.htm" rel="nofollow noreferrer">download the appropriate MUSCLE program from drive5</a> and save it somewhere. E.g., if you are using Jupyter in Linux:</p>
<pre><code>!wget https://www.drive5.com/muscle/downloads3.8.31/muscle3.8.31_i86linux64.tar.gz
!tar -xzvf muscle3.8.31_i86linux64.tar.gz
!cp muscle3.8.31_i86linux64 /usr/local/bin
!chmod 755 /usr/local/bin/muscle3.8.31_i86linux64
</code></pre>
<p>Then, you can run MUSCLE like so:</p>
<pre><code>from Bio.Align.Applications import MuscleCommandline
def runMUSCLE(infile, outfile):
    muscle_exe = r&quot;/usr/local/bin/muscle3.8.31_i86linux64&quot; #Here is where we installed MUSCLE
    muscle_cline = MuscleCommandline(muscle_exe,
                                     input=infile,
                                     out=outfile,
                                     clwstrict=True #Output in clustal format (more visually pleasing), otherwise the output is in FASTA. Whichever you need.
                                    )
    muscle_cline()
</code></pre>
<p>You don't need to specify that your sequence is amino acidic, however keep in mind that the input file must be in FASTA format.</p>

CC BY-SA 4.0
2021-01-08T11:30:22.840Z
2021-01-08T11:30:22.840Z
albertr
<p>I am very new to bioinformatics (and python in general), but I would like to use python to more efficiently analyse enzymes both in terms of structure and functio, using Jupiter notebook. I would like to ask what is the best program/source code for multiple sequence alignments (amino acids) to identify conserved binding sites etc. I see that <a href="https://biopython.org/docs/1.74/api/index.html#" rel="nofollow noreferrer">biopython</a> has a few ways of creating alignments, but I have the impression that it is more focused on nucleotide sequences?</p>

CC BY-SA 4.0
2020-05-02T08:18:53.530Z
It works for both —but for global alignments you'd want system calls to something better (`muscle` say) than the inbuilt pairwise method. I don't know about MSA viewers for Jupyter, but I'd like to say that `nglview` is a really nice module to view your 3D protein structure in the notebook —it is despotic to set up at times, but totally worth the struggle.
Matteo Ferla
CC BY-SA 4.0
2020-05-03T09:50:23.580Z
Thanks, yea I got nglview to work after some time! Still working on the MSA in python, most sites seem to focus on nucleotide alignments.
CuriousTree
CC BY-SA 4.0
2020-05-26T14:21:42.947Z
I found [a nice blog post](https://dmnfarrell.github.io/bioinformatics/bokeh-sequence-aligner) about plotting MSAs in Jupyter notebooks, which I thought was relevant to this.
Matteo Ferla
<phylogenetics><proteins><python>
MSA (protein) with biopython or something else?
# MSA (protein) with biopython or something else?

(Asked by: username_0 on 2020-05-01)

I am very new to bioinformatics (and python in general), but I would like to use python to more efficiently analyse enzymes both in terms of structure and functio, using Jupiter notebook. I would like to ask what is the best program/source code for multiple sequence alignments (amino acids) to identify conserved binding sites etc. I see that [biopython](https://biopython.org/docs/1.74/api/index.html#) has a few ways of creating alignments, but I have the impression that it is more focused on nucleotide sequences?

**Tags:** phylogenetics, proteins, python
> **Comments:**
> **username_1**: It works for both —but for global alignments you'd want system calls to something better (`muscle` say) than the inbuilt pairwise method. I don't know about MSA viewers for Jupyter, but I'd like to say that `nglview` is a really nice module to view your 3D protein structure in the notebook —it is despotic to set up at times, but totally worth the struggle.  
> **username_0**: Thanks, yea I got nglview to work after some time! Still working on the MSA in python, most sites seem to focus on nucleotide alignments.  
> **username_1**: I found [a nice blog post](https://dmnfarrell.github.io/bioinformatics/bokeh-sequence-aligner) about plotting MSAs in Jupyter notebooks, which I thought was relevant to this.  

---

## 1 answers

### Answer by username_2 on 2021-01-08. Score: 1

In my personal experience, MUSCLE is the easiest program to use in conjunction with Biopython. Biopython features a command line wrapper for this program, which makes it very easy to use. Make sure to download the appropriate MUSCLE program from drive5 and save it somewhere. E.g., if you are using Jupyter in Linux:
!wget https://www.drive5.com/muscle/downloads3.8.31/muscle3.8.31_i86linux64.tar.gz
!tar -xzvf muscle3.8.31_i86linux64.tar.gz
!cp muscle3.8.31_i86linux64 /usr/local/bin
!chmod 755 /usr/local/bin/muscle3.8.31_i86linux64

Then, you can run MUSCLE like so:
from Bio.Align.Applications import MuscleCommandline
def runMUSCLE(infile, outfile):
    muscle_exe = r"/usr/local/bin/muscle3.8.31_i86linux64" #Here is where we installed MUSCLE
    muscle_cline = MuscleCommandline(muscle_exe,
                                     input=infile,
                                     out=outfile,
                                     clwstrict=True #Output in clustal format (more visually pleasing), otherwise the output is in FASTA. Whichever you need.
                                    )
    muscle_cline()

You don't need to specify that your sequence is amino acidic, however keep in mind that the input file must be in FASTA format.


---

