Catalog PyPI
PACKAGE EXPLORERView in registry

a3mtools

PyPI

tools for working with a3m files for structure prediction

Versions collected1
Direct dependencies6From release 0.1.0a6
Last observed20 Oct, 16:40 UTC

README

Version 0.1.0a6 documentation

a3mtools

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:

  • import a3m files from MMseqs2 search results into python objects
  • Easily slice MSAs while preserving insertions
  • Easily combine multiple MSAs into a single a3m file for complex prediction
  • Save manipulated MSAs to new a3m files
  • convert from fasta to a3m
  • coming soon: convert from a3m to fasta

If you have any questions, find any issues/bugs, or have suggestions, please open an issue on the github page.

Installation

pip install a3mtools

or if you want an editable version:

git clone https://github.com/jacksonh1/a3mtools.git
cd a3mtools
pip install -e .

What these tools do:

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

Usage

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

import an a3m file

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.

slicing the alignment

print(msa[2:5])
#3	1
>101
CDE
>ortho1
CDxxE
>ortho2
-DxxE
>ortho3
--xxE

concatenating alignments

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-

saving the alignment to a file

complex_msa = msa + msa2
complex_msa.save("example_complex.a3m")

creating an empty MSAa3m object

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.

importing a fasta file

fasta_msa = a3mtools.MSAfasta.from_fasta_file(examples.fasta_file1)
print(fasta_msa)
>q
LVT---FLAGCQ---
>a
LVTTTTFL--CQQQQ
>b
LVTTTTFLAGCQQQQ
>c
LVT---FLAGCQQQQ

convert MSAfasta to MSAa3m

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

important notes

  • slice numbering is relative to the query sequence
  • query sequence is always the first sequence in the MSA, and is named 101 or some combination of concatenated querys if the MSA is the result of concatenation (e.g. 101\t102)
  • slicing with a step size other than 1 is not supported yet and probably will not be supported
  • MSAs are combined in unpaired format
    • combining MSAs in paired format is not supported yet

future features:


  • documentation on readthedocs
    • examples and code
  • convert between fasta and a3m
  • convert between a3m and fasta
  • allow for more generic naming of query sequence
  • add better test functions
  • an option for combining MSAs in paired format

Downloads & popularity

2downloads
1-day window · source-reported counts20 Oct 2026
54270
2026-07-23: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-07-23–2026-07-232026-07-24: 6 · observed 2026-10-21T10:02:05.7944320Z · period 2026-07-24–2026-07-242026-07-26: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-07-26–2026-07-262026-07-27: 5 · observed 2026-10-21T10:02:05.7944320Z · period 2026-07-27–2026-07-272026-07-28: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-07-28–2026-07-282026-07-29: 19 · observed 2026-10-21T10:02:05.7944320Z · period 2026-07-29–2026-07-292026-07-30: 4 · observed 2026-10-21T10:02:05.7944320Z · period 2026-07-30–2026-07-302026-07-31: 4 · observed 2026-10-21T10:02:05.7944320Z · period 2026-07-31–2026-07-312026-08-01: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-01–2026-08-012026-08-02: 3 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-02–2026-08-022026-08-03: 18 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-03–2026-08-032026-08-04: 8 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-04–2026-08-042026-08-05: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-05–2026-08-052026-08-06: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-06–2026-08-062026-08-08: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-08–2026-08-082026-08-09: 4 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-09–2026-08-092026-08-10: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-10–2026-08-102026-08-12: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-12–2026-08-122026-08-13: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-13–2026-08-132026-08-14: 6 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-14–2026-08-142026-08-15: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-15–2026-08-152026-08-17: 9 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-17–2026-08-172026-08-18: 54 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-18–2026-08-182026-08-19: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-19–2026-08-192026-08-20: 3 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-20–2026-08-202026-08-21: 3 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-21–2026-08-212026-08-23: 3 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-23–2026-08-232026-08-24: 18 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-24–2026-08-242026-08-26: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-26–2026-08-262026-08-28: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-28–2026-08-282026-08-29: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-29–2026-08-292026-08-31: 4 · observed 2026-10-21T10:02:05.7944320Z · period 2026-08-31–2026-08-312026-09-01: 3 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-01–2026-09-012026-09-02: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-02–2026-09-022026-09-03: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-03–2026-09-032026-09-05: 7 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-05–2026-09-052026-09-07: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-07–2026-09-072026-09-09: 4 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-09–2026-09-092026-09-10: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-10–2026-09-102026-09-11: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-11–2026-09-112026-09-12: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-12–2026-09-122026-09-14: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-14–2026-09-142026-09-16: 3 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-16–2026-09-162026-09-17: 5 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-17–2026-09-172026-09-18: 8 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-18–2026-09-182026-09-19: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-19–2026-09-192026-09-20: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-20–2026-09-202026-09-22: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-22–2026-09-222026-09-23: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-23–2026-09-232026-09-24: 8 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-24–2026-09-242026-09-25: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-25–2026-09-252026-09-26: 5 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-26–2026-09-262026-09-27: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-27–2026-09-272026-09-28: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-28–2026-09-282026-09-29: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-29–2026-09-292026-09-30: 3 · observed 2026-10-21T10:02:05.7944320Z · period 2026-09-30–2026-09-302026-10-01: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-01–2026-10-012026-10-03: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-03–2026-10-032026-10-05: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-05–2026-10-052026-10-06: 3 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-06–2026-10-062026-10-07: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-07–2026-10-072026-10-08: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-08–2026-10-082026-10-09: 4 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-09–2026-10-092026-10-10: 8 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-10–2026-10-102026-10-11: 10 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-11–2026-10-112026-10-12: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-12–2026-10-122026-10-13: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-13–2026-10-132026-10-15: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-15–2026-10-152026-10-17: 3 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-17–2026-10-172026-10-18: 1 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-18–2026-10-182026-10-19: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-19–2026-10-192026-10-20: 2 · observed 2026-10-21T10:02:05.7944320Z · period 2026-10-20–2026-10-20
23 Jul20 Oct

pypistats · 72 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-20 – 2026-10-2022026-10-21T10:02:05.7944320Z
2026-10-19 – 2026-10-1922026-10-21T10:02:05.7944320Z
2026-10-18 – 2026-10-1812026-10-21T10:02:05.7944320Z
2026-10-17 – 2026-10-1732026-10-21T10:02:05.7944320Z
2026-10-15 – 2026-10-1522026-10-21T10:02:05.7944320Z
2026-10-13 – 2026-10-1322026-10-21T10:02:05.7944320Z
2026-10-12 – 2026-10-1222026-10-21T10:02:05.7944320Z
2026-10-11 – 2026-10-11102026-10-21T10:02:05.7944320Z
2026-10-10 – 2026-10-1082026-10-21T10:02:05.7944320Z
2026-10-09 – 2026-10-0942026-10-21T10:02:05.7944320Z
2026-10-08 – 2026-10-0812026-10-21T10:02:05.7944320Z
2026-10-07 – 2026-10-0712026-10-21T10:02:05.7944320Z
2026-10-06 – 2026-10-0632026-10-21T10:02:05.7944320Z
2026-10-05 – 2026-10-0512026-10-21T10:02:05.7944320Z
2026-10-03 – 2026-10-0312026-10-21T10:02:05.7944320Z
2026-10-01 – 2026-10-0112026-10-21T10:02:05.7944320Z
2026-09-30 – 2026-09-3032026-10-21T10:02:05.7944320Z
2026-09-29 – 2026-09-2912026-10-21T10:02:05.7944320Z
2026-09-28 – 2026-09-2822026-10-21T10:02:05.7944320Z
2026-09-27 – 2026-09-2712026-10-21T10:02:05.7944320Z
2026-09-26 – 2026-09-2652026-10-21T10:02:05.7944320Z
2026-09-25 – 2026-09-2522026-10-21T10:02:05.7944320Z
2026-09-24 – 2026-09-2482026-10-21T10:02:05.7944320Z
2026-09-23 – 2026-09-2322026-10-21T10:02:05.7944320Z
2026-09-22 – 2026-09-2212026-10-21T10:02:05.7944320Z
2026-09-20 – 2026-09-2012026-10-21T10:02:05.7944320Z
2026-09-19 – 2026-09-1922026-10-21T10:02:05.7944320Z
2026-09-18 – 2026-09-1882026-10-21T10:02:05.7944320Z
2026-09-17 – 2026-09-1752026-10-21T10:02:05.7944320Z
2026-09-16 – 2026-09-1632026-10-21T10:02:05.7944320Z
2026-09-14 – 2026-09-1422026-10-21T10:02:05.7944320Z
2026-09-12 – 2026-09-1212026-10-21T10:02:05.7944320Z
2026-09-11 – 2026-09-1112026-10-21T10:02:05.7944320Z
2026-09-10 – 2026-09-1012026-10-21T10:02:05.7944320Z
2026-09-09 – 2026-09-0942026-10-21T10:02:05.7944320Z
2026-09-07 – 2026-09-0722026-10-21T10:02:05.7944320Z
2026-09-05 – 2026-09-0572026-10-21T10:02:05.7944320Z
2026-09-03 – 2026-09-0322026-10-21T10:02:05.7944320Z
2026-09-02 – 2026-09-0212026-10-21T10:02:05.7944320Z
2026-09-01 – 2026-09-0132026-10-21T10:02:05.7944320Z
2026-08-31 – 2026-08-3142026-10-21T10:02:05.7944320Z
2026-08-29 – 2026-08-2912026-10-21T10:02:05.7944320Z
2026-08-28 – 2026-08-2812026-10-21T10:02:05.7944320Z
2026-08-26 – 2026-08-2612026-10-21T10:02:05.7944320Z
2026-08-24 – 2026-08-24182026-10-21T10:02:05.7944320Z
2026-08-23 – 2026-08-2332026-10-21T10:02:05.7944320Z
2026-08-21 – 2026-08-2132026-10-21T10:02:05.7944320Z
2026-08-20 – 2026-08-2032026-10-21T10:02:05.7944320Z
2026-08-19 – 2026-08-1912026-10-21T10:02:05.7944320Z
2026-08-18 – 2026-08-18542026-10-21T10:02:05.7944320Z
2026-08-17 – 2026-08-1792026-10-21T10:02:05.7944320Z
2026-08-15 – 2026-08-1522026-10-21T10:02:05.7944320Z
2026-08-14 – 2026-08-1462026-10-21T10:02:05.7944320Z
2026-08-13 – 2026-08-1322026-10-21T10:02:05.7944320Z
2026-08-12 – 2026-08-1212026-10-21T10:02:05.7944320Z
2026-08-10 – 2026-08-1012026-10-21T10:02:05.7944320Z
2026-08-09 – 2026-08-0942026-10-21T10:02:05.7944320Z
2026-08-08 – 2026-08-0812026-10-21T10:02:05.7944320Z
2026-08-06 – 2026-08-0622026-10-21T10:02:05.7944320Z
2026-08-05 – 2026-08-0512026-10-21T10:02:05.7944320Z
2026-08-04 – 2026-08-0482026-10-21T10:02:05.7944320Z
2026-08-03 – 2026-08-03182026-10-21T10:02:05.7944320Z
2026-08-02 – 2026-08-0232026-10-21T10:02:05.7944320Z
2026-08-01 – 2026-08-0112026-10-21T10:02:05.7944320Z
2026-07-31 – 2026-07-3142026-10-21T10:02:05.7944320Z
2026-07-30 – 2026-07-3042026-10-21T10:02:05.7944320Z
2026-07-29 – 2026-07-29192026-10-21T10:02:05.7944320Z
2026-07-28 – 2026-07-2812026-10-21T10:02:05.7944320Z
2026-07-27 – 2026-07-2752026-10-21T10:02:05.7944320Z
2026-07-26 – 2026-07-2612026-10-21T10:02:05.7944320Z
2026-07-24 – 2026-07-2462026-10-21T10:02:05.7944320Z
2026-07-23 – 2026-07-2322026-10-21T10:02:05.7944320Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.0a630 Jul 20256

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
jacksonh1/a3mtools

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:40 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:27f4d8d2d4c97a32302066ae6e9b7c903be9a4935f1b6935e8955f50fa7fe953