Package: azulejo
azulejo
noun INFORMAL
a glazed tile, usually blue, found on the inside of churches and palaces in Spain and Portugal.azulejoazulejoazulejo combines homology and synteny information to
tile phylogenetic space.
The inputs toazulejoare FASTA files of nucleotide-space
sequences of primary-transcript protein genes and their associated GFF files.
Outputs are sets of proxy gene fragments chosen for
their concordance in multiple sequence alignments, along with
subtrees.PrerequisitesPython 3.7 or greater is required.azulejois tested under Linux
using Python 3.8 and 3.9 and under MacOS Big Sur using XCode command-line tools
system Python (currently 3.8). Mac users should see theinstructions
on configuring their systems.  Installation on BSD is not
supported because many of the python dependencies lack BSD wheels.We recommend you installazulejointo its own virtual environment due
to the large number of python dependencies.  The easiest way for most
users to install and maintain up-to-date virtual environments is via the
toolpipx.  If your system does
not havepipxinstalled, you can do so via the commands:python3 -m pip install --user --upgrade pip
python3 -m pip install --user --upgrade pipx
python3 -m pipx ensurepathFollow any instructions that the last command produces about starting a new
shell if necessary.If you choose to haveazulejocompile and install its binary dependencies,
you will need compilers,make, andcmakeand standard headers
forzlibandbz2.  All linux systems configured for development will have
these available.  We test compilation under gcc version 10.2 on linux and
clang 12.0.0 on MacOS.  We use program-guided optimization for one of the
binary dependencies, and we believe that gcc 10 does a much better job
of optimization than gcc 9, so it may benefit you to upgrade your compiler
if needed.Installation for UsersOnce the prerequisite has been met, you may then installazulejoin its own virtual environment by issuing the command:pipx install azulejoazulejocontains some long commands and many options.  To enable command-line
completion forazulejocommands, execute the following command if you are usingbashas your shell:eval "$(_AZULEJO_COMPLETE=source_bash azulejo)"If you are usingzsh, simply replacesource_bashin the above command line
withsource_zsh.You may next proceed with installing binary dependencies.Environmental Variablesazulejorecognizes the following environmental variables:AZULEJO_INSTALL_DIRThis is a writable directory for installation of binary dependencies.  Binaries
will go into thebindirectory.  The default is the virtual environment
directory.BUILD_DEVThis is the directory used for building binary dependencies.  Default is the
first memory device found for linux (e.g.,/run/shm) or/tmpfor MacOS.
Set this if compilation fails because it runs out of memory.SCRATCH_DEVThis is the directory used for temporary merging of lists.  The default is/tmp, but you may set it to a fast memory based device if you have enough
memory.MAKEOPTSThese are the arguments to themakeandmake installcommands when
building dependencies.  It’s good to set this to the number of processors
on your system before installing required dependencies.  This variable is
only used duringazulejo install.SPINNER_UPDATE_PERIODThis is the number of seconds between updates of the spinner.  This
defaults to 1, but it is advisable to set it higher for automated testing
so as not to exceed logfile character limits.LOG_TO_PRINTIf set to a log level such asinfo, the logger will be a simple print
without using the more
complex functions oflogurusuch as colors and logging to files.
This is sometimes useful in automated testing.In addition the optionaldagchainer-toolsubcommand recognizes the
some environmental variables which can be shown via the commandazulejodagchainer-tool--help.Installation of Binary DependenciesazulejorequiresMMseqsfor homology clustering andMUSCLEfor sequence alignment and initial tree-building.azulejoinstalls binaries into the virtualenv by default, so
any systemwide installations of these packages will not get clobbered by the install.
In particular,muscleis PGO-optimized, which gives nearly a factor of 2 higher
performance than prebuilt binaries.  For fastest installation, We recommand you setMAKEOPTSand install all required dependencies via the commands:export MAKEOPTS=$(python -c 'import multiprocessing as mp; print(mp.cpu_count())')
azulejo install allThere are three optional dependencies that can be installed viaazulejo installthat are of interest only to a small subset of users who wish to compare against
other homology clustering and synteny methods.usearchis a licensed homology clustering program that is free for individual, non-commercial
use that can be downloaded and installed by theazulejo install usearchcommand after accepting the license terms.azulejo installdagchainer-toolgets you
a somewhat crude Bash script that uses BLAST homology clustering followed by
synteny calculation viaDAGchainer.dagchainer-toolwill need the dependency ofperlwithbioperlinstalled.dagchainer_toolincreases the sequence ID length as part of its processing, so
if any of your sequence IDS are longer than about 30 characters, they will violate BLAST’s
hard limit of 50 characters in sequence ID fields.  In that case you will need
to install a patched version of BLAST using the commandazulejo installblast-longids.Installation For DevelopersIf you plan to developazulejo, you’ll need to install
thepoetrydependency manager.
If you haven’t previously installedpoetry, execute the command:curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | pythonNext, get the master branch from GitHubgit clone https://github.com/joelb123/azulejo.gitChange to theazulejo/directory and install with poetry:poetry install -vRunazulejowithpoetry:poetry run azulejoUsageInstallation puts a single script calledazulejoin your path.  The usage format is:azulejo [GLOBALOPTIONS] COMMAND [COMMANDOPTIONS][ARGS]Master Input Fileazulejouses a configuration file inTOMLformat as the master input that associates files with phylogeny.  The format of this file
is the familiar headings in square brackets followed by configuration values:[glycines]
rank = "genus"
name = "Glycine"

[glycines.glyso]
rank = "species"
name = "Glycine soja"

[glycines.glyso.PI483463]
rank = "strain"
gff = "glyso.PI483463.gnm1.ann1.3Q3Q.gene_models_main.gff3.gz"
fasta = "glyso.PI483463.gnm1.ann1.3Q3Q.protein_primaryTranscript.faa.gz"
uri = "https://v1.legumefederation.org/data/index/public/Glycine_soja/PI483463.gnm1.ann1.3Q3Q/"
comments = """
Glycine soja accession PI 483463 has been identified as being unusually
salt-tolerant (Lee et al., 2009)."""[headings]There can be only one top-level heading, and that will be the name of the
resulting output set.  This name will be the name of an output directory that will be
created in the current working directory, so this heading (and all subheadings) must
obey UNIX filesystem naming rules or an error will result.  Each heading level
(indicated by a “.”) will result in another taxonomic level and another directory level
in the output directory.  Depths do not need to be consistent.rankEach level defined must have arankdefined, and that rank must match one of the
taxonomic ranks defined byazulejo, which you can view and test using thecheck-taxonomic-rankcommand.   There are 24 major taxonomic ranks, each of which
may be modified by 16 different prefixes for a total of 174 taxonomic levels (some of
which are synonoymous).nameEach level may (and usually should) have anamedefined.  This name is intended
to be human-readable with no restrictions on the characters used, but it goes into
plot legends in places, so it’s best to not make it too long. If the name is not specified,
it will be taken from the level name enclosed in single quotes (e.g., ‘PI483463’ for the
example above).fastaIf the level specifies a genome, it must have afastaentry corresponding
to the name of theproteinFASTA file.  In eukaryotes, the FASTA file should be a
file of primary (generally longest) protein transcripts, if available, rather than all protein
transcripts (i.e., not including splice variants). Sequences will be cleaned of dashes, stops,
and other out-of-alphabet characters.  Ambiguous residues at the beginnings and ends of
sequences will be trimmed. Zero-length sequences will be discarded, which can result in a
smaller number of sequences out.  These files may be compressed, with extensions.gzor.bz2.gffIf the level specifies a genome, it must have agffentry corresponding
to a version 3 Genome Feature File (GFF3) containingCDSentries with ID values
matching those IDs in the FASTA file.  The same compression extensions as forfastaentries apply.  If theSOURCEfields in those CDS entries
(which contain the names of the DNA fragments such as scaffolds that the CDS came from)
contain dot-separated components, those components that are identical across the entire
file will be discarded by default.  There is an opportunity later in the process to
remap DNA source names to a common dictionary for comparison among chromosomes and
plastids.uriThis optional field may contain a a uniform resource identifier such ashttps://sitename/dir/.azulejousessmart-openfor doing transparent on-the-fly decompression from a variety of file systems
including HTTPS, HDFS, SSH, and SFTP (but not FTP).
If this field is not supplied, local file access is assumed with paths relative to
the current working directory. The URI will be prepended tofastaandgffpaths, allowing for convenient downloading on-the-fly from sites such as
LegumeInfo or GenBank.   Downloads are not cached, so if you intend to runazulejomultiple times on the same input data, you will save time by downloading and uncompressing
files to local storage.preferenceThis optional field may be used to override the genome preference heuristic
that is the fall-thru preference after proxy-gene heuristics have been applied.  This is an integer
value, with lower integers getting the highest priority.  Set this value to zero if you
know in advance that one of the input genomes is considered the reference genome and,
all things being equal, you would prefer to select proxy genes from this genome.  You
may also set these preference values later, after the default genome preference (genomes
will be preferred in order of the most genes in a single DNA fragment) has already been
applied, but before proxy gene selection.other infoA design goal forazulejowas to not lose metadata, even if it
was not used byazulejoitself, while keeping metadata out of file names.
As an aid in that goal, for each (sub)heading level/output directory,azulejocreates a JSON file namednode_properties.jsonat each node in the output
hierarchy that containing all information from this file as well as other information
calculated at ingestion time byazulejo.  You may specify any additional data you would
like to pass along (e.g., for later use in a web page) and it will be translated from TOML
to JSON and passed along, such as the multi-linecommentsfield in the example.
Examples of useful metadata that may be easier to enter at ingestion time than to
garner later include taxon IDs of the level and its parent, common names, URLs of
papers describing the genome, and geographic origin of the sample.A copy of the input file will be saved in the output directory under the nameinput.toml.
See the examples in thetests/testdatarepository directory for examples of input data.Global OptionsThe following options are global in scope and, if used must be placed beforeCOMMAND:-v, –verboseLog debugging info to stderr.-q, –quietSuppress logging to stderr.–no-logfileSuppress logging to file.-e, –warnings_as_errorsTreat warnings as fatal (for testing).CommandsA listing of commands is available viaazulejo--help.
The currently implemented commands are, in the order they will normally be run:installCheck for/install binary dependencies.ingestMarshal protein and genome sequence information.homologyCalculate homology clusters, MSAs, trees.syntenyCalculate synteny anchors.proxy-genesCalculate a set of proxy genes from synteny files.parquet-to-tsvReads parquet file, writes tsv.azulejostores most intermediate results in the Parquet format with
extension.parq.  These binary files are compressed and typically can
be read more than 30X faster than the tab-separated-value (TSV) files they
can be interconverted with.  In addition, Parquet files do not lose metadata
such as binary representation sizes.Each command has itsCOMMANDOPTIONS, which may be listed with:azulejo COMMAND --helpProject StatusLatest ReleaseActivityDownloadsDownload RateLicenseCode GradeCoverageTravis BuildIssuesCode Style