正在載入完整 README。 以下為已儲存的摘錄。
If you use Assemblytics, please cite our paper in Bioinformatics: http://www.ncbi.nlm.nih.gov/pubmed/27318204
Assemblytics analyzes alignments of a "query" assembly to a "reference" genome (or another assembly) to identify structural variants. The pipeline consists of the following key steps:檢視完整 README ↗If you use Assemblytics, please cite our paper in Bioinformatics: http://www.ncbi.nlm.nih.gov/pubmed/27318204
BioRxiv preprint also available: https://www.biorxiv.org/content/10.1101/044925v1
Assemblytics analyzes alignments of a "query" assembly to a "reference" genome (or another assembly) to identify structural variants. The pipeline consists of the following key steps:
nucmer input instructions below for the exact command we recommend.Important: Use only contigs rather than scaffolds from the assembly. This will prevent false positives when the number of Ns in the scaffolded sequence does not match perfectly to the distance in the reference.
nucmer input instructionsSee my MUMmer tutorial on sandbox.bio.
IMPORTANT: Assemblytics was built for nucmer --maxmatch output and tuned to the following parameters, which is important for making the unique anchor filtering in Assemblytics work correctly.
Upload a delta file to analyze alignments of an assembly to another assembly or a reference genome
nucmer --maxmatch -l 100 -c 500 REFERENCE.fa ASSEMBLY.fa -prefix OUT
# Settings above are important for unique anchor filtering to work correctly in Assemblytics.
# I increased -l to 10000 for the human in input_examples, which cut down on file size significantly at the cost of losing a lot of sensitivity and thus alignments. I don't really recommend setting it that high for your main analysis, but it can be useful for a fast initial run.
# Optionally gzip
gzip OUT.delta
Consult the MUMmer github if you encounter problems.
See this example showing the point of unique anchor filtering (from the bioRxiv preprint supplementary materials):
For small genomes (e.g. bacteria), you may want to reduce the unique_length to 1000.
The analysis will run in a few seconds for most genomes, and for the human example which is a 6 MB gzipped delta, it takes 50 seconds. It should scale linearly with file size, so expect at least a minute per 10MB. On https://marianattestad.github.io/assemblytics/
, it runs client-side meaning using your computer's own CPU, so if you are working on a really slow computer, it could run somewhat slower. If it's an issue, see nucmer instructions note on -l above, or consider running the python version.
Assemblytics was built on MUMmer 3 but MUMmer 4 is still compatible. Other aligners do not produce .delta files but rather SAM/BAM outputs, which MUMmer 4 also supports now, but MUMmer was sort of the original aligner for genome assemblies (as opposed to reads), so that's what Assemblytics was built to work with. Many choices about which alignments are kept are also going to be different from other aligners, so I don't recommend using Assemblytics with anything other than MUMmer.
By default, candidate variants that span two different reference chromosomes ("Interchromosomal") are left out of the main results, since most of them come from misassemblies rather than real variants. Pass --long-range to also write these candidates to a separate assemblytics_long_range_variants.bed, so they're easy to find but clearly kept apart from the main, higher-confidence call set:
assemblytics -d input_examples/ecoli.delta.gz -o ecoli_output --long-range
# In addition to the usual output, this also writes ecoli_output/assemblytics_long_range_variants.bed.
# These candidates are usually misassemblies, but can occasionally be real translocations or
# other large-scale rearrangements -- review them manually before trusting them as true variants.
The python part of Assemblytics can be run without the web app.
Depends on Python 3.8+, and includes numpy, pandas, and matplotlib dependencies.
pip install assemblytics
The assemblytics command orchestrates the entire pipeline from filtering to plotting.
assemblytics -d <delta_file> -o <output_dir>
Example using the provided E. coli sample:
assemblytics -d input_examples/ecoli.delta.gz -o ecoli_output
# The output should match the one in the output_examples/ecoli folder.
git clone https://github.com/MariaNattestad/assemblytics.git
cd assemblytics
pip install -e .
assemblytics
The web app (public/) runs the entire Assemblytics pipeline client-side in the browser via Pyodide (Python compiled to WebAssembly) in a Web Worker. There is no server-side code, no upload step, and no installation beyond a static file server — your delta file never leaves your machine.
To run it locally, serve the public/ folder with any static file server, for example:
cd assemblytics
python3 -m http.server 8000 --directory public
# Then open http://localhost:8000 in your browser
The Python source lives in assemblytics/ at the repo root. The web app loads it as a Python wheel (public/assemblytics-2.0.0-py3-none-any.whl) installed at runtime by Pyodide's micropip.
After editing any Python files under assemblytics/, rebuild the wheel before testing or deploying:
make wheel
This runs python3 -m build --wheel and copies the result into public/. If you bump the version in pyproject.toml, also update the filename on line 18 of public/worker.js to match.
output_examples/ contains pre-computed results for five organisms, generated from the delta files in input_examples/. These are kept around (and untouched by any refactoring) specifically so the pipeline's correctness can be checked by re-running it and comparing the variant calls. The most important file to compare is assemblytics_structural_variants.bed (the combined, final set of structural variant calls) — everything else (plots, indices, summary stats) is derived from it.
To re-run the pipeline on each input and diff its variant calls against the matching example output:
pip3 uninstall assemblytics # remove whatever's installed
pip3 install -e . # install editable from current directory
# E. coli (uses a smaller unique anchor length since it's a small genome)
assemblytics -d input_examples/ecoli.delta.gz -o /tmp/assemblytics_test/ecoli -l 1000
diff <(tail -n +2 /tmp/assemblytics_test/ecoli/assemblytics_structural_variants.bed | sort) \
<(tail -n +2 output_examples/ecoli/E__coli_example.Assemblytics_structural_variants.bed | sort) \
&& echo "ecoli: OK"
# Yeast (Saccharomyces cerevisiae)
assemblytics -d input_examples/yeast.delta.gz -o /tmp/assemblytics_test/yeast
diff <(tail -n +2 /tmp/assemblytics_test/yeast/assemblytics_structural_variants.bed | sort) \
<(tail -n +2 output_examples/yeast/Saccharomyces_cerevisiae_example.Assemblytics_structural_variants.bed | sort) \
&& echo "yeast: OK"
# Arabidopsis thaliana
assemblytics -d input_examples/arabidopsis.delta.gz -o /tmp/assemblytics_test/arabidopsis
diff <(tail -n +2 /tmp/assemblytics_test/arabidopsis/assemblytics_structural_variants.bed | sort) \
<(tail -n +2 output_examples/arabidopsis/Arabidopsis_example.Assemblytics_structural_variants.bed | sort) \
&& echo "arabidopsis: OK"
# Drosophila melanogaster
assemblytics -d input_examples/drosophila.delta.gz -o /tmp/assemblytics_test/drosophila
diff <(tail -n +2 /tmp/assemblytics_test/drosophila/assemblytics_structural_variants.bed | sort) \
<(tail -n +2 output_examples/drosophila/Drosophila_example.Assemblytics_structural_variants.bed | sort) \
&& echo "drosophila: OK"
# Human (assembly aligned to hg19) -- the largest input, this one takes the longest to run
assemblytics -d input_examples/human.delta.gz -o /tmp/assemblytics_test/human
diff <(tail -n +2 /tmp/assemblytics_test/human/assemblytics_structural_variants.bed | sort) \
<(tail -n +2 output_examples/human/Human_NA12878_to_hg19.Assemblytics_structural_variants.bed | sort) \
&& echo "human: OK"
(No pip install -e . yet? Run these from inside public/ instead, replacing assemblytics with python -m assemblytics.cli and adjusting the input_examples//output_examples/ paths to ../input_examples//../output_examples/.)
Each diff should print nothing (no differences) followed by the "OK" line. The tail -n +2 skips the header line, and sort makes the comparison order-independent since variant IDs can legitimately be assigned in a different order between runs.
pyproject.toml and assemblytics/__init__.py.public/worker.js line 18 to reference the new wheel filename.public/:
make wheel
public/ and commit everything.main and merge.main, delete it and recreate it:
git tag -d vX.Y.Z
git push origin :refs/tags/vX.Y.Z
Then create a new release on GitHub targeting the updated main. This triggers the Publish to PyPI workflow automatically via OIDC Trusted Publishing.packaging/bioconda/meta.yaml): bump the version and update the sha256 to match the new PyPI tarball (find it on the PyPI release page or with pip download assemblytics==X.Y.Z && sha256sum assemblytics-X.Y.Z.tar.gz).