Observed since 20 Oct, 16:40 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
tools for working with a3m files for structure prediction
DEPRECATED: This package had been renamed from a3mtools to a3mcat. Please use the new package instead: a3mcat
Tools for working with a3m files. Designed to help generate input for structure prediction tools like alphafold.
>meow
---------/\_/\--
--------( o.o )-
--------- >^< --
Main features:
If you have any questions, find any issues/bugs, or have suggestions, please open an issue on the github page.
pip install a3mtools
or if you want an editable version:
git clone https://github.com/jacksonh1/a3mtools.git
cd a3mtools
pip install -e .
The current implementation of the tools are designed to handle MSAs retrieved using the colabfold MMseqs2 search tool. There are some strange quirks about those files specifically that I tried to account for. Mainly query sequence names are denoted by 3 digit integers starting at 101. So if an MSA only has 1 query sequence it will be named 101. If there are 2 query sequences they will be named 101 and 102 etc. This comes into play when combining MSAs for predicting protein complexes. Additionally, when combining 2 MSAs, the query sequences are combined into a single sequence. This is required to predict the complex structure. The query sequences are also added back to the MSA as individual sequences. MSAs are combined in unpaired format.
Here's an example (with no homologous sequences):
MSA1 a3m file:
#9 1
>101
ABCDEFGHI
MSA2 a3m file:
#17 1
>101
JKLMNOPQRSTUVWXYZ
MSA1 + MSA2 a3m file:
#9,17 1,1
>101 102
ABCDEFGHIJKLMNOPQRSTUVWXYZ
>101
ABCDEFGHI-----------------
>102
---------JKLMNOPQRSTUVWXYZ
The MSA1 + MSA2 a3m file could be used as input to many structure prediction tools to predict the structure of the complex formed by the 2 query sequences.
I don't know if maintaining this specific 101, 102, 103 ... naming scheme is strictly necessary, but we'll stick with it for now.
The tools also allow for slicing the MSA and saving the MSA to a file.
When slicing or combining MSAs, insertions are maintained (see output of examples).
There will eventually be a more complete guide. But for now, you can install the package and run the following code to see some of the basic functionality.
See the demo notebook (demo.ipynb) for additional examples and usage.
import a3mtools
import a3mtools.examples as examples # examples that come installed with a3mtools
msa = a3mtools.MSAa3m.from_a3m_file(examples.a3m_file1)
print(msa)
#9 1
>101
ABCDEFGHI
>ortho1
xxABCDxxEFGZZ
>ortho2
A--DxxE-GHIxxxx
>ortho3
----xxEFGH-
The input to the a3mtools.MSAa3m.from_a3m_file function is the path to an a3m file.
print(msa[2:5])
#3 1
>101
CDE
>ortho1
CDxxE
>ortho2
-DxxE
>ortho3
--xxE
msa2 = a3mtools.MSAa3m.from_a3m_file(examples.a3m_file2)
print(msa2)
#17 1
>101
JKLMNOPQRSTUVW
>ortho1
JKLMNOPQRSTUVWxxxxxx
>ortho2
------PQRSTUVW
print(msa + msa2)
#9,17 1,1
>101 102
ABCDEFGHIJKLMNOPQRSTUVW
>101
ABCDEFGHI--------------
>ortho1
xxABCDxxEFGZZ--------------
>ortho2
A--DxxE-GHIxxxx--------------
>ortho3
----xxEFGH---------------
>102
---------JKLMNOPQRSTUVW
>ortho1
---------JKLMNOPQRSTUVWxxxxxx
>ortho2
---------------PQRSTUVW
print(msa + msa2[2:5] + msa[5:])
#9,3,4 1,1,1
>101 102 103
ABCDEFGHILMNFGHI
>101
ABCDEFGHI-------
>ortho1
xxABCDxxEFGZZ-------
>ortho2
A--DxxE-GHIxxxx-------
>ortho3
----xxEFGH--------
>102
---------LMN----
>ortho1
---------LMN----
>103
------------FGHI
>ortho1
------------FGZZ
>ortho2
-------------GHI
>ortho3
------------FGH-
complex_msa = msa + msa2
complex_msa.save("example_complex.a3m")
empty_msa = a3mtools.MSAa3m.empty_MSA('ABCDEFG')
print(empty_msa)
#7 1
>101
ABCDEFG
>101
ABCDEFG
notice that there are 2 query sequences in the empty MSAa3m object. This is to mimic the colabfold behavior. I do not know if this is actually necessary or not.
fasta_msa = a3mtools.MSAfasta.from_fasta_file(examples.fasta_file1)
print(fasta_msa)
>q
LVT---FLAGCQ---
>a
LVTTTTFL--CQQQQ
>b
LVTTTTFLAGCQQQQ
>c
LVT---FLAGCQQQQ
To convert a fasta to an a3m, you have to select a query sequence, since a3m files are all formatted relative to a query sequence.
y = fasta_msa.to_a3m(query_header="q")
print(y)
#9 1
>101
LVTFLAGCQ
>a
LVTtttFL--CQqqq
>b
LVTtttFLAGCQqqq
>c
LVTFLAGCQqqq
notice the difference in formatting when we choose a different query sequence:
y = fasta_msa.to_a3m(query_header="a")
print(y)
#13 1
>101
LVTTTTFLCQQQQ
>q
LVT---FLagCQ---
>b
LVTTTTFLagCQQQQ
>c
LVT---FLagCQQQQ
pypistats · 72 observations shown. Missing days are unknown. Source category: overall: without mirrors.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-20 – 2026-10-20 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-19 – 2026-10-19 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-18 – 2026-10-18 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-17 – 2026-10-17 | 3 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-15 – 2026-10-15 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-13 – 2026-10-13 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-12 – 2026-10-12 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-11 – 2026-10-11 | 10 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-10 – 2026-10-10 | 8 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-09 – 2026-10-09 | 4 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-08 – 2026-10-08 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-07 – 2026-10-07 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-06 – 2026-10-06 | 3 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-05 – 2026-10-05 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-03 – 2026-10-03 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-10-01 – 2026-10-01 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-30 – 2026-09-30 | 3 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-29 – 2026-09-29 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-28 – 2026-09-28 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-27 – 2026-09-27 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-26 – 2026-09-26 | 5 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-25 – 2026-09-25 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-24 – 2026-09-24 | 8 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-23 – 2026-09-23 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-22 – 2026-09-22 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-20 – 2026-09-20 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-19 – 2026-09-19 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-18 – 2026-09-18 | 8 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-17 – 2026-09-17 | 5 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-16 – 2026-09-16 | 3 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-14 – 2026-09-14 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-12 – 2026-09-12 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-11 – 2026-09-11 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-10 – 2026-09-10 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-09 – 2026-09-09 | 4 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-07 – 2026-09-07 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-05 – 2026-09-05 | 7 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-03 – 2026-09-03 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-02 – 2026-09-02 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-09-01 – 2026-09-01 | 3 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-31 – 2026-08-31 | 4 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-29 – 2026-08-29 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-28 – 2026-08-28 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-26 – 2026-08-26 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-24 – 2026-08-24 | 18 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-23 – 2026-08-23 | 3 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-21 – 2026-08-21 | 3 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-20 – 2026-08-20 | 3 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-19 – 2026-08-19 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-18 – 2026-08-18 | 54 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-17 – 2026-08-17 | 9 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-15 – 2026-08-15 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-14 – 2026-08-14 | 6 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-13 – 2026-08-13 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-12 – 2026-08-12 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-10 – 2026-08-10 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-09 – 2026-08-09 | 4 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-08 – 2026-08-08 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-06 – 2026-08-06 | 2 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-05 – 2026-08-05 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-04 – 2026-08-04 | 8 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-03 – 2026-08-03 | 18 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-02 – 2026-08-02 | 3 | 2026-10-21T10:02:05.7944320Z |
| 2026-08-01 – 2026-08-01 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-07-31 – 2026-07-31 | 4 | 2026-10-21T10:02:05.7944320Z |
| 2026-07-30 – 2026-07-30 | 4 | 2026-10-21T10:02:05.7944320Z |
| 2026-07-29 – 2026-07-29 | 19 | 2026-10-21T10:02:05.7944320Z |
| 2026-07-28 – 2026-07-28 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-07-27 – 2026-07-27 | 5 | 2026-10-21T10:02:05.7944320Z |
| 2026-07-26 – 2026-07-26 | 1 | 2026-10-21T10:02:05.7944320Z |
| 2026-07-24 – 2026-07-24 | 6 | 2026-10-21T10:02:05.7944320Z |
| 2026-07-23 – 2026-07-23 | 2 | 2026-10-21T10:02:05.7944320Z |
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0a6 | 30 Jul 2025 | 6 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 16:40 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:27f4d8d2d4c97a32302066ae6e9b7c903be9a4935f1b6935e8955f50fa7fe953