Xihl Editor v0.3 · macOS ARM64
XIHL / Editor

Prepare an index, then align

Guide contents · Tools · Local MCP setup

In Local Jobs → New job, choose DNA short reads or RNA-seq. Select an aligner profile and the reference FASTA. STAR also needs a matching GTF or GFF3. Choose Prepare index before selecting any FASTQ. This runs as a separate cancellable job. Check index reads the cache and verifies the selected reference, annotation, executable and build settings. It does not run an index build. A ready entry is a disk index; there is no shared memory preload.

Choose your reads and select Run alignment. DNA short-read mapping and STAR accept plain or gzip FASTQ. For paired reads, select Paired-end reads and provide separate R1 and R2 files in the same record order. For STAR with gzip inputs, configure the gzip executable in Advanced aligner settings. See short-read preparation for supported mate names and preprocessing options. Alignment refuses a missing, incomplete or incompatible index. Changing a build setting requires preparation for the new selection. Alignment-only changes reuse a compatible index. Prepare again for warm reuse, or move aside the identified corrupt entry and prepare a replacement. After an interrupted build that left a hidden staging directory, first verify the worker exited before moving that directory aside.

After alignment, open Report for the read totals, coverage and Open mapped reads in Genome Viewer. RNA reports also show STAR GeneCounts and the chosen strand column. Nanopore plasmid verification has a separate workflow and its own coordinate rules.

Inspect Log and Inputs & resources while work runs. To stop a job, choose Cancel and wait for its terminal status. To try again in the desktop app, check the input and index settings and submit a new job. The headless jobs-retry command starts a new attempt from the recorded request. For a changed profile or executable, use a new request and check or prepare its index first.

Edit aligners.txt

Copy the editable template and open it in a text editor. In Advanced aligner settings, use Load aligners.txt… to select your copy. Reload it after editing; Use built-in profiles restores the shipped choices. Settings adjusted in the form apply to the next request. A submitted job keeps its effective profile and a digest of each selected executable, so edits to the file or a tool replacement cannot silently change queued work.

The file is UTF-8 JSON with schema_version: 1 and a profiles array. Names must be unique. Keep the file at or below 128 KiB. The optional executable_path is an absolute path; omit it to use the workflow's configured tool. Each method names the tool integration and its settings. Unknown or duplicate fields are errors. Xihl controls input/output flags, sorting, counting and index load mode; raw flags such as STAR genomeLoad are refused.

AdapterIndex settingsAlignment settings
star_rnaRequired sjdb_overhang in bases; optional suffix_array_sparsity (stride), suffix_array_index_bases, chromosome_bin_bits, generation_ram_bytesOptional bam_sort_ram_bytes, bam_sort_threads, io_buffer_bytes as two numbers (input, output)
minimap2_dnaOptional partition_bases (reference bases per part). Preset is sr.Optional query_batch_bases, sort_memory_mib_per_thread (samtools sort memory per thread)

STAR uses the selected maximum read length minus one as the usual overhang choice. For example, the template's 99 supports reads up to 100 bases. Shorter reads may use the index. Longer reads require a new index. Omitted STAR BAM sort RAM uses the existing workflow memory setting; other omitted tool options retain the established defaults. Known profiles accept STAR 2.7.11b (including the reviewed local1 build), minimap2 2.31-r1302 (also 2.28 for the ordinary DNA profile), and samtools 1.24/1.24.1 (also 1.21 for DNA). Configured multipart DNA uses minimap2 2.31-r1302's split merge. A multipart merge can change results relative to a single index; this workflow makes no universal equivalence claim. Minimap2 RNA is not available.

Use an approved packaged DNA toolchain where installed, or provide paths to your own executables. STAR is user-provided. The CPU and memory fields and individual tool options are stage settings and planning inputs. They do not cap process-wide RAM. STAR preparation uses the selected thread count; minimap2 preparation uses the aligner's default threads in profile version 1. Splitting an index can use extra scratch disk. Per-base coverage includes zero-depth positions and can be very large. The prepared alignment path checks the minimum space for that TSV on the output volume, and existing estimates account for some other files. Free space can change and the estimate is not a reservation. Full-human capacity and minimum host RAM are unqualified.

Headless and MCP

List built-in profiles or parse an edited file:

dna-cli aligner-profiles
dna-cli aligner-profiles --input ./aligners.txt

Copy one object from result.selections into the selection field below. This example uses the checked DNA tools in the macOS arm64 test app. Empty minimap2 and samtools paths request those defaults. With a source build or on another host, give explicit executable paths instead. Replace the reference, cache, FASTQ and output paths with your own; create the parent directory first.

{
  "schema_version": 1,
  "request": {
    "AlignerIndex": {
      "selection": {
        "schema_version": 1,
        "profile": {
          "name": "minimap2 DNA / short reads",
          "method": {"adapter": "minimap2_dna", "index": {}, "alignment": {}}
        }
      },
      "executable_path": "",
      "reference_fasta_path": "/tmp/toy/reference.fa",
      "index_cache_dir": "/tmp/toy/index-cache",
      "cpu_threads": 2,
      "memory_limit_mb": 2048
    }
  }
}

Save that as prepare.json. If an executable is set in the profile, it takes precedence over the request's fallback path. A STAR preparation request must name a configured STAR and include annotation_path. Use the same selection as alignment in a DnaMapping or RnaMapping request, with the same reference, cache directory and aligner path. STAR also needs the same annotation and preparation thread count. An example DNA request body (inside request.DnaMapping) is:

{
  "fastq_path": "/tmp/toy/reads.fastq",
  "reference_fasta_path": "/tmp/toy/reference.fa",
  "index_cache_dir": "/tmp/toy/index-cache",
  "output_dir": "/tmp/toy/new-results",
  "minimap2_path": "",
  "samtools_path": "",
  "cpu_threads": 2,
  "memory_limit_mb": 2048,
  "alignment": {
    "schema_version": 1,
    "profile": {
      "name": "minimap2 DNA / short reads",
      "method": {"adapter": "minimap2_dna", "index": {}, "alignment": {}}
    }
  }
}
dna-cli aligner-index-inspect --request prepare.json
dna-cli workflow-run --request prepare.json
dna-cli workflow-plan --request align.json
dna-cli workflow-run --request align.json --descriptor-out result.json

aligner-profiles returns result.selections. The inspection result has status: ready and an index object with paths and checksums, status: missing and an expected directory, or status: invalid with a directory and reason. Bad input or tool settings return a command error. workflow-plan reports runnable and any failures; a successful JSON response alone does not mean the alignment can run. Use jobs-submit --request prepare.json or --request align.json for durable execution. Keep the result directory, and use the emitted descriptor with revision-checked workflow-register to attach a completed result to a saved project. MCP exposes the same commands and schema discovery for STAR and minimap2, subject to its configured data roots, write authorization and trusted executable paths. For example, call xihl_aligner_index_inspect with {"request":"/absolute/path/to/prepare.json"} under a granted root. Older mapping requests without alignment retain their original prepare-and-align behavior. Mapping replay uses the recorded settings and original executable digests and prepares a private index under the replay bundle; it does not reread aligners.txt. Replay compares the established canonical outputs.

External-only profiles

For locally trusted software without a native adapter, use the separate External tool workflow or the local CLI. The contract accepts one FASTA to prepare and one plain FASTQ to align. For example, a local tool implementing this exact argument convention could declare:

{
  "name": "My external aligner",
  "executable_path": "/absolute/path/to/my-aligner",
  "method": {
    "adapter": "external_only",
    "version_args": ["--version"],
    "prepare_args": ["prepare", "{reference}", "{index}"],
    "align_args": ["align", "{index}", "{reads}", "{output}"]
  }
}

Each array entry is one literal argument. Placeholders must be complete arguments, each occurring exactly once in its documented stage. The version probe must exit successfully with bounded nonempty text. Prepare must create a nonempty index file at {index}; align must create one nonempty file at {output}. Use an AlignerIndex request to prepare it. An ExternalAlignment request embeds the same preparation body as index, plus fastq_path and a fresh output_dir. The result contains the opaque artifact and its provenance. It is never adopted as Xihl BAM, coverage, counts, or GeneCounts. There is no external-only scientific replay. Choose an executable you trust; the external tool runs as your account. MCP refuses the open-ended argv contract, since arbitrary tool flags could access paths outside its grants.