Image size: 35.1 MB

For more on pulling from the registry, see the ilifu documentation.

First, once: add the registry and make it your default

singularity remote add --no-login idia-registry https://sregistry.idia.ac.za
singularity remote use idia-registry

If you added it before, as the ilifu docs describe, remote add says it already exists: just run remote use.

Log in, for a private collection

singularity remote login idia-registry

Paste a token from your token page when asked. Public collections need no login.

Pull the container

singularity pull library://bioinformatics/mafft:7.526

Shell into the container

singularity shell library://bioinformatics/mafft:7.526

Run the container

singularity run library://bioinformatics/mafft:7.526

First, once: add the registry and make it your default

apptainer remote add --no-login idia-registry https://sregistry.idia.ac.za
apptainer remote use idia-registry

If you added it before, as the ilifu docs describe, remote add says it already exists: just run remote use.

Log in, for a private collection

apptainer remote login idia-registry

Paste a token from your token page when asked. Public collections need no login.

Pull the container

apptainer pull library://bioinformatics/mafft:7.526

Shell into the container

apptainer shell library://bioinformatics/mafft:7.526

Run the container

apptainer run library://bioinformatics/mafft:7.526
MAFFT 7.526 by Kazutaka Katoh et al. (https://mafft.cbrc.jp/alignment/software/).

This image packages the unmodified upstream 7.526 release, built from source
(https://gitlab.com/sysimm/mafft). IDIA builds and maintains the image only; report
MAFFT bugs upstream (https://mafft.cbrc.jp/alignment/software/ or
https://gitlab.com/sysimm/mafft/-/issues). Report image problems to support@ilifu.ac.za.

Usage:
  singularity run mafft_7.526.sif --auto --thread 4 input.fasta > aligned.fasta
  singularity exec mafft_7.526.sif linsi input.fasta > aligned.fasta
  singularity run --app mafft-qinsi mafft_7.526.sif rna.fasta > aligned.fasta

Included: mafft and its aliases (linsi, ginsi, einsi, fftns, fftnsi, nwns, nwnsi and
mafft-linsi ... mafft-xinsi, mafft-qinsi), mafft-profile, mafft-distance, and the MXSCARNA extension
used by X-INS-i. Not included: mafft-homologs.rb and mafft-sparsecore.rb (need Ruby).
No sequence databases are included; bind your own with --bind.

Licence: the MAFFT core is under a BSD licence (/opt/mafft/LICENSE). The extensions
(MXSCARNA, Vienna RNA package parameters, ProbCons) have their own terms
(/opt/mafft/LICENSE.extensions and /opt/mafft/licenses/): free for research,
educational and commercial use, but they may not be redistributed for a fee, and
their authors must be credited.

Citation: Katoh K, Standley DM. MAFFT multiple sequence alignment software version 7:
improvements in performance and usability. Mol Biol Evol 30:772-780 (2013).
See https://mafft.cbrc.jp/alignment/software/ for method-specific references.

This image has 7 apps. Pick one to see how to use it.

singularity run --app mafft-distance library://bioinformatics/mafft:7.526

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

Pairwise distances between unaligned sequences, estimated from shared 6-mers as in MAFFT's
first guide tree. By default it prints one line per pair ("1-2 d=0.35 l=320,318", with
sequences numbered in input order); -p prints a square matrix instead. The sequence type
is detected; force it with -D (nucleotide) or -P (protein).

  singularity run --app mafft-distance mafft_7.526.sif -p input.fasta > distances.txt

Docs: https://mafft.cbrc.jp/alignment/software/algorithms/algorithms.html

Runs

exec mafft-distance "$@"
singularity run --app mafft-einsi library://bioinformatics/mafft:7.526

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

E-INS-i: iterative refinement with generalized affine gap costs (mafft --genafpair
--maxiterate 1000), which leaves long unalignable regions unaligned. Suits up to about
200 sequences with conserved motifs in long unalignable regions, and is upstream's pick
when the nature of the sequences is unclear. Long sequences need a lot of memory.

  singularity run --app mafft-einsi mafft_7.526.sif --thread 4 input.fasta > aligned.fasta

Docs: https://mafft.cbrc.jp/alignment/software/algorithms/algorithms.html

Runs

exec mafft-einsi "$@"
singularity run --app mafft-ginsi library://bioinformatics/mafft:7.526

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

G-INS-i: iterative refinement with global pairwise alignment (mafft --globalpair
--maxiterate 1000). It assumes the sequences align over their whole length, so trim
flanking regions first. Suits up to about 200 sequences of similar length.

  singularity run --app mafft-ginsi mafft_7.526.sif --thread 4 input.fasta > aligned.fasta

Docs: https://mafft.cbrc.jp/alignment/software/algorithms/algorithms.html

Runs

exec mafft-ginsi "$@"
singularity run --app mafft-linsi library://bioinformatics/mafft:7.526

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

L-INS-i, MAFFT's most accurate mode: iterative refinement with local pairwise
alignment (mafft --localpair --maxiterate 1000). Suits up to about 200 sequences
with one alignable domain and long gaps.

  singularity run --app mafft-linsi mafft_7.526.sif --thread 4 input.fasta > aligned.fasta

Docs: https://mafft.cbrc.jp/alignment/software/algorithms/algorithms.html

Runs

exec mafft-linsi "$@"
singularity run --app mafft-profile library://bioinformatics/mafft:7.526

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

Aligns two existing alignments to each other (group-to-group), keeping the alignment
within each group, and writes the result to stdout. It writes scratch files named "pre"
and "trace" into the current directory, overwriting any with those names. Upstream says
mafft --merge covers what mafft-profile does and plans to remove it.

  singularity run --app mafft-profile mafft_7.526.sif group1.fasta group2.fasta > merged.fasta

Docs: https://mafft.cbrc.jp/alignment/software/merge.html

Runs

exec mafft-profile "$@"
singularity run --app mafft-qinsi library://bioinformatics/mafft:7.526

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

Q-INS-i: global alignment of highly divergent ncRNAs that also uses RNA secondary
structure (base-pairing probabilities from the McCaskill algorithm). Very slow; suits
up to about 200 sequences of about 1,000 nt. The --contrafold variant needs CONTRAfold,
which the image doesn't include.

  singularity run --app mafft-qinsi mafft_7.526.sif rna.fasta > aligned.fasta

Docs: https://mafft.cbrc.jp/alignment/software/source66.html

Runs

exec mafft-qinsi "$@"
singularity run --app mafft-xinsi library://bioinformatics/mafft:7.526

This works once you've added the registry as a remote (see the CLI tab). Add the app's arguments after the command. With Apptainer, start it with apptainer instead.

Help

X-INS-i: structural alignment of highly divergent ncRNAs, built from pairwise structural
alignments by the bundled MXSCARNA and McCaskill base-pairing probabilities. Suits up to
about 50 sequences of about 1,000 nt. The --larapair, --foldalignlocalpair,
--foldalignglobalpair and --contrafold variants need programs the image doesn't include.

  singularity run --app mafft-xinsi mafft_7.526.sif rna.fasta > aligned.fasta

Docs: https://mafft.cbrc.jp/alignment/software/source66.html

Runs

exec mafft-xinsi "$@"
Bootstrap: docker
From: debian:13-slim
Stage: build

%post
  export MAFFT_VERSION=7.526
  export MAFFT_SHA256=2d81ba74ad6181df3c662b882f529734f3eb78af9b205d6840ca345612bf6410
  export DEBIAN_FRONTEND=noninteractive

  apt-get update -y
  apt-get install -y --no-install-recommends \
    ca-certificates \
    curl \
    g++ \
    gcc \
    make

  # The -src.tgz on mafft.cbrc.jp 404s for 7.526, so use upstream's GitLab tag archive.
  # NOTE: GitLab generates tag archives on the fly and may regenerate them byte-differently.
  # If sha256sum -c fails on a rebuild, re-verify the checksum against the v7.526 tag; never
  # remove the check.
  mkdir -p /tmp/src
  cd /tmp/src || exit 1
  curl -fsSL -o "mafft-v${MAFFT_VERSION}.tar.gz" \
    "https://gitlab.com/sysimm/mafft/-/archive/v${MAFFT_VERSION}/mafft-v${MAFFT_VERSION}.tar.gz"
  echo "${MAFFT_SHA256}  mafft-v${MAFFT_VERSION}.tar.gz" | sha256sum -c -
  tar xzf "mafft-v${MAFFT_VERSION}.tar.gz"
  cd "mafft-v${MAFFT_VERSION}" || exit 1

  # Upstream's own flags (-O3), no host-specific CPU tuning.
  make -C core PREFIX=/opt/mafft
  make -C core PREFIX=/opt/mafft install
  make -C extensions PREFIX=/opt/mafft
  make -C extensions PREFIX=/opt/mafft install

  # mafft-homologs.rb and mafft-sparsecore.rb need Ruby, which this image leaves out.
  rm -f /opt/mafft/bin/mafft-homologs.rb /opt/mafft/bin/mafft-sparsecore.rb \
    /opt/mafft/share/man/man1/mafft-homologs.1

  mkdir -p /opt/mafft/licenses/mxscarna /opt/mafft/licenses/vienna /opt/mafft/licenses/probconsRNA
  cp license /opt/mafft/LICENSE
  cp license.extensions /opt/mafft/LICENSE.extensions
  cp extensions/mxscarna_src/README /opt/mafft/licenses/mxscarna/README
  cp extensions/mxscarna_src/vienna/COPYING /opt/mafft/licenses/vienna/COPYING
  cp extensions/mxscarna_src/probconsRNA/README /opt/mafft/licenses/probconsRNA/README

  cd / || exit 1
  rm -rf /tmp/src

Bootstrap: docker
From: debian:13-slim
Stage: final
# The mafft wrapper is a bash script using awk, grep, sed and coreutils, and mxscarnamod
# needs libstdc++6; debian-slim already has all of them, so the final stage has no %post.
# core/Makefile strips the binaries at install time.

%files from build
  /opt/mafft /opt/mafft

%environment
  export PATH=/opt/mafft/bin:$PATH

%labels
  Maintainer IDIA <support@ilifu.ac.za>
  Version 7.526
  Source https://mafft.cbrc.jp/alignment/software/
  License BSD-3-Clause (core); extensions (MXSCARNA, Vienna RNA, ProbCons) free for research, educational and commercial use, not to be redistributed for a fee
  Authors Kazutaka Katoh and the MAFFT developers (CBRC/Osaka University)

%help
  MAFFT 7.526 by Kazutaka Katoh et al. (https://mafft.cbrc.jp/alignment/software/).

  This image packages the unmodified upstream 7.526 release, built from source
  (https://gitlab.com/sysimm/mafft). IDIA builds and maintains the image only; report
  MAFFT bugs upstream (https://mafft.cbrc.jp/alignment/software/ or
  https://gitlab.com/sysimm/mafft/-/issues). Report image problems to support@ilifu.ac.za.

  Usage:
    singularity run mafft_7.526.sif --auto --thread 4 input.fasta > aligned.fasta
    singularity exec mafft_7.526.sif linsi input.fasta > aligned.fasta
    singularity run --app mafft-qinsi mafft_7.526.sif rna.fasta > aligned.fasta

  Included: mafft and its aliases (linsi, ginsi, einsi, fftns, fftnsi, nwns, nwnsi and
  mafft-linsi ... mafft-xinsi, mafft-qinsi), mafft-profile, mafft-distance, and the MXSCARNA extension
  used by X-INS-i. Not included: mafft-homologs.rb and mafft-sparsecore.rb (need Ruby).
  No sequence databases are included; bind your own with --bind.

  Licence: the MAFFT core is under a BSD licence (/opt/mafft/LICENSE). The extensions
  (MXSCARNA, Vienna RNA package parameters, ProbCons) have their own terms
  (/opt/mafft/LICENSE.extensions and /opt/mafft/licenses/): free for research,
  educational and commercial use, but they may not be redistributed for a fee, and
  their authors must be credited.

  Citation: Katoh K, Standley DM. MAFFT multiple sequence alignment software version 7:
  improvements in performance and usability. Mol Biol Evol 30:772-780 (2013).
  See https://mafft.cbrc.jp/alignment/software/ for method-specific references.

%runscript
  exec mafft "$@"

%apprun mafft-linsi
  exec mafft-linsi "$@"

%apphelp mafft-linsi
  L-INS-i, MAFFT's most accurate mode: iterative refinement with local pairwise
  alignment (mafft --localpair --maxiterate 1000). Suits up to about 200 sequences
  with one alignable domain and long gaps.

    singularity run --app mafft-linsi mafft_7.526.sif --thread 4 input.fasta > aligned.fasta

  Docs: https://mafft.cbrc.jp/alignment/software/algorithms/algorithms.html

%apprun mafft-ginsi
  exec mafft-ginsi "$@"

%apphelp mafft-ginsi
  G-INS-i: iterative refinement with global pairwise alignment (mafft --globalpair
  --maxiterate 1000). It assumes the sequences align over their whole length, so trim
  flanking regions first. Suits up to about 200 sequences of similar length.

    singularity run --app mafft-ginsi mafft_7.526.sif --thread 4 input.fasta > aligned.fasta

  Docs: https://mafft.cbrc.jp/alignment/software/algorithms/algorithms.html

%apprun mafft-einsi
  exec mafft-einsi "$@"

%apphelp mafft-einsi
  E-INS-i: iterative refinement with generalized affine gap costs (mafft --genafpair
  --maxiterate 1000), which leaves long unalignable regions unaligned. Suits up to about
  200 sequences with conserved motifs in long unalignable regions, and is upstream's pick
  when the nature of the sequences is unclear. Long sequences need a lot of memory.

    singularity run --app mafft-einsi mafft_7.526.sif --thread 4 input.fasta > aligned.fasta

  Docs: https://mafft.cbrc.jp/alignment/software/algorithms/algorithms.html

%apprun mafft-qinsi
  exec mafft-qinsi "$@"

%apphelp mafft-qinsi
  Q-INS-i: global alignment of highly divergent ncRNAs that also uses RNA secondary
  structure (base-pairing probabilities from the McCaskill algorithm). Very slow; suits
  up to about 200 sequences of about 1,000 nt. The --contrafold variant needs CONTRAfold,
  which the image doesn't include.

    singularity run --app mafft-qinsi mafft_7.526.sif rna.fasta > aligned.fasta

  Docs: https://mafft.cbrc.jp/alignment/software/source66.html

%apprun mafft-xinsi
  exec mafft-xinsi "$@"

%apphelp mafft-xinsi
  X-INS-i: structural alignment of highly divergent ncRNAs, built from pairwise structural
  alignments by the bundled MXSCARNA and McCaskill base-pairing probabilities. Suits up to
  about 50 sequences of about 1,000 nt. The --larapair, --foldalignlocalpair,
  --foldalignglobalpair and --contrafold variants need programs the image doesn't include.

    singularity run --app mafft-xinsi mafft_7.526.sif rna.fasta > aligned.fasta

  Docs: https://mafft.cbrc.jp/alignment/software/source66.html

%apprun mafft-profile
  exec mafft-profile "$@"

%apphelp mafft-profile
  Aligns two existing alignments to each other (group-to-group), keeping the alignment
  within each group, and writes the result to stdout. It writes scratch files named "pre"
  and "trace" into the current directory, overwriting any with those names. Upstream says
  mafft --merge covers what mafft-profile does and plans to remove it.

    singularity run --app mafft-profile mafft_7.526.sif group1.fasta group2.fasta > merged.fasta

  Docs: https://mafft.cbrc.jp/alignment/software/merge.html

%apprun mafft-distance
  exec mafft-distance "$@"

%apphelp mafft-distance
  Pairwise distances between unaligned sequences, estimated from shared 6-mers as in MAFFT's
  first guide tree. By default it prints one line per pair ("1-2 d=0.35 l=320,318", with
  sequences numbered in input order); -p prints a square matrix instead. The sequence type
  is detected; force it with -D (nucleotide) or -P (protein).

    singularity run --app mafft-distance mafft_7.526.sif -p input.fasta > distances.txt

  Docs: https://mafft.cbrc.jp/alignment/software/algorithms/algorithms.html

%test
  export PATH=/opt/mafft/bin:$PATH
  mafft --version 2>&1 | grep -q 'v7.526' || exit 1

  workdir=$(mktemp -d) || exit 1
  cat > "$workdir/in.fa" <<'EOF'
>seq1
MNGTEGDNFYVPFSNKTGLARSPYEYPQYYLAEPWKYSALAAYMFFLILVGFPVNFLTLF
>seq2
MNGTEGPNFYVPFSNITGVVRSPFEQPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLY
>seq3
MNGTEGINFYVPMSNKTGVVRSPFEYPQYYLAEPWKYRLVCCYIFFLISTGLPINLLTLL
EOF
  mafft --quiet --auto "$workdir/in.fa" > "$workdir/out.fa" || exit 1
  [ "$(grep -c '^>' "$workdir/out.fa")" -eq 3 ] || exit 1
  linsi --quiet "$workdir/in.fa" > "$workdir/out2.fa" || exit 1
  [ "$(grep -c '^>' "$workdir/out2.fa")" -eq 3 ] || exit 1

  # X-INS-i runs the C++ MXSCARNA extension (libexec/mafft/mxscarnamod).
  cat > "$workdir/rna.fa" <<'EOF'
>rna1
GGGCUAUUAGCUCAGUUGGUUAGAGCGCACCCCUGAUAAGGGUGAGGUCGCUGAUUCGAAUUCAGCAUAGCCCA
>rna2
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUCUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
>rna3
GGGGCUAUAGCUCAGCUGGGAGAGCGCUUGCAUGGCAUGCAAGAGGUCAGCGGUUCGAUCCCGCUUAGCUCCA
EOF
  mafft-xinsi --quiet "$workdir/rna.fa" > "$workdir/out3.fa" || exit 1
  [ "$(grep -c '^>' "$workdir/out3.fa")" -eq 3 ] || exit 1
  rm -rf "$workdir"
Download bioinformatics-mafft_7.526.def
#!/bin/sh

  exec mafft "$@"
#!/bin/sh

  export PATH=/opt/mafft/bin:$PATH
  mafft --version 2>&1 | grep -q 'v7.526' || exit 1

  workdir=$(mktemp -d) || exit 1
  cat > "$workdir/in.fa" <<'EOF'
>seq1
MNGTEGDNFYVPFSNKTGLARSPYEYPQYYLAEPWKYSALAAYMFFLILVGFPVNFLTLF
>seq2
MNGTEGPNFYVPFSNITGVVRSPFEQPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLY
>seq3
MNGTEGINFYVPMSNKTGVVRSPFEYPQYYLAEPWKYRLVCCYIFFLISTGLPINLLTLL
EOF
  mafft --quiet --auto "$workdir/in.fa" > "$workdir/out.fa" || exit 1
  [ "$(grep -c '^>' "$workdir/out.fa")" -eq 3 ] || exit 1
  linsi --quiet "$workdir/in.fa" > "$workdir/out2.fa" || exit 1
  [ "$(grep -c '^>' "$workdir/out2.fa")" -eq 3 ] || exit 1

  # X-INS-i runs the C++ MXSCARNA extension (libexec/mafft/mxscarnamod).
  cat > "$workdir/rna.fa" <<'EOF'
>rna1
GGGCUAUUAGCUCAGUUGGUUAGAGCGCACCCCUGAUAAGGGUGAGGUCGCUGAUUCGAAUUCAGCAUAGCCCA
>rna2
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUCUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCA
>rna3
GGGGCUAUAGCUCAGCUGGGAGAGCGCUUGCAUGGCAUGCAAGAGGUCAGCGGUUCGAUCCCGCUUAGCUCCA
EOF
  mafft-xinsi --quiet "$workdir/rna.fa" > "$workdir/out3.fa" || exit 1
  [ "$(grep -c '^>' "$workdir/out3.fa")" -eq 3 ] || exit 1
  rm -rf "$workdir"
# /.singularity.d/env/10-docker2singularity.sh
#!/bin/sh
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# /.singularity.d/env/90-environment.sh
#!/bin/sh
# Custom environment shell code should follow


  export PATH=/opt/mafft/bin:$PATH