ANFO-TOOL(1)

πŸ“¦ version 0.98, in ubuntu jammy

πŸ’– NAME πŸ’–

okay bestie, the manual name is anfo-tool and it's all about processing native ANFO binary files πŸ¦‹

🌸 SYNOPSIS 🌸

anfo-tool [ option | pattern ... ]

🧚 DESCRIPTION 🧚

okay so, anfo-tool is the one that filters, processes and converts the files that anfo makes πŸ’…. Every pattern you hand it gets wildcard expanded ✨. Then, for every input file (or stdin if you don't give a pattern), it builds a chain of input filters πŸŽ€, merges those input streams in one of several ways πŸ”₯, and splits the result into multiple output streams. Each output stream can have its own chain of output filters πŸ’œ. Main character energy, literally.

✨ OPTIONS ✨

πŸŽ€ General Options

These options are global, so they change how the whole program behaves πŸ‘‘. They can go anywhere on the command line 🫢.

  • -V, --version β€” prints the version number and exits 🌈
  • -q, --quiet β€” shhh 🀫, suppresses all output except fatal error messages
  • -v, --verbose β€” gives you more output, including progress indicators for most operations πŸ“ˆ
  • --debug β€” debugging output on top of the progress info πŸ™ˆ
  • -n, --dry-run β€” parses the command line, can optionally print what it intends to do, then exits πŸ“
  • --vmem X β€” limits virtual memory to X megabytes. If memory runs out, anfo-tool tries to free some up by forgetting about big files, e.g. genomes πŸ’€. Use this to avoid swapping or out-of-memory situations when you're dealing with big or multiple genomes 😭

πŸ’… Setting Parameters

A parameter can be set multiple times on the command line, and each new one overwrites the last πŸ”„. Any filter option that needs a parameter picks up the last definition that showed up before it.

  • --set-slope S β€” sets the slope to S. Slope works together with intercept where filters check alignment scores. Alignments scoring no worse than slope * (length - intercept) count as good πŸ¦‹. Default is 7.5.
  • --set-intercept L β€” sets the intercept to L. Same deal as slope, since they team up for scoring. Default is 20.
  • --set-context C β€” sets the context to C, which is the number of surrounding bases of the reference included when alignments get printed in text form. Default is 0.
  • --set-genome G β€” sets the genome to G. When it's set, lots of filters only look at the best alignments to that specific genome 🧬. If no genome is set, the globally best alignment gets used 🌍.
  • --clear-genome β€” clears the genome parameter 🧹. Filters apply to the globally best alignment afterwards.

πŸ”₯ Filter Options

Filters can go before merging the inputs or after splitting the back up πŸ”€.

  • -s, --sort-pos=n β€” sorts by alignment position while buffering no more than n MiB in memory. If a genome is set, alignments to that genome are used.
  • -S, --sort-name=n β€” sorts by read name while buffering no more than n MiB in memory.
  • -l, --filter-length=L β€” keeps alignments only for reads that are at least L bases long πŸ“. The reads themselves stick around too.
  • -f, --filter-score β€” keeps alignments only if their score is good enough. Uses slope and intercept.
  • --filter-mapq=Q β€” removes alignments with mapping quality below Q.
  • -h, --filter-hit=SEQ β€” keeps only reads that have a hit to a sequence named SEQ. If SEQ is empty, reads are kept if they have any hit at all. If the genome parameter is set, only hits to that genome count.
  • --delete-hit=SEQ β€” deletes alignments to SEQ. If SEQ is empty, all alignments get deleted πŸ’€. If the genome parameter is set, only alignments to that genome are deleted.
  • --filter-qual=Q β€” masks out bases with quality below Q. Each one gets replaced by the N ambiguity code πŸ«₯.
  • --multiplicity=N β€” keeps only reads from molecules that have been sequenced at least N times. Reads count as coming from the same original molecule if their aligned coordinates are identical.
  • --subsample=F β€” subsamples a fraction F of the results 🎲. Every read is independently and randomly chosen to be kept or not.
  • --inside-regions=FILE β€” reads a list of regions from FILE, then keeps only alignments that overlap an annotated region.
  • --outside-regions=FILE β€” reads a list of regions from FILE, then keeps only alignments that do not overlap an annotated region.

πŸ‘‘ Special Filters

  • -d, --rmdup=Q β€” removes PCR duplicates and clamps quality scores to Q 🧼. Two reads count as duplicates if their aligned coordinates are identical. If a genome is set, the best alignment to that genome is used, otherwise the globally best alignment is used. Both alignments have to be good, as determined by slope and intercept. For a set of duplicates, a consensus is called, which generally bumps the quality scores up. If a resulting quality score goes above Q, it's set to Q. This filter requires the input to be sorted by alignment coordinate on the selected genome.
    • --duct-tape=NAME β€” duct-tapes overlapping alignments into contigs and calls a consensus for them 🩹. If a genome is set, alignments to that genome are used, otherwise the globally best alignments are used. This filter requires input sorted by alignment coordinate on the genome. The output is a set of contigs. Every position gets assigned a consensus base, a quality score, and likelihoods for every possible diallele. (It's called duct-taping because it kinda looks like an assembly, but it's not nearly as solid.)
  • --edit-header=ED β€” invokes the editor ED on the text representation of the stream's header. This is handy for cleaning up headers that have accumulated too much cruft 🧹.

πŸ”€ Merging Filters

Exactly one merging filter should be given on the command line 🧩. All filter options that come before it are part of the input filter chains, and all further filters become output chains. If no merging filter is given, --concat is assumed and all filters are input filters.

  • -c, --concat β€” concatenates all input streams in the order they appear on the command line.
  • -m, --merge β€” merges sorted input streams, producing a sorted result. All inputs must be sorted in the same way.
  • -j, --join β€” joins input streams and retains the single best hits to each genome. Every input stream must contain a record for every read. Reads are buffered in memory until all of their hits are collected, so joining works well if all inputs are nearly in the same order. If reads are missing from some streams, joining them will waste memory 😬.
  • --mega-merge β€” merges many streams, such as those produced by running anfo-sge. Streams that operated on the same reads are joined first, then everything is merged.

πŸ“€ Output Options

If an output option is given on the command line, the current output filter chain ends and a new one starts πŸ”š. If no output option is given, a textual representation of the final stream is written to stdout. All output options accept - to write to stdout.

  • -o, --output FILE β€” writes a native binary stream (a compressed protobuf message) to FILE. Writing a binary stream and reading it back in is lossless πŸ’Ž.
  • --output-text FILE β€” writes a protobuf text stream to FILE. If the necessary genomes are available, a textual representation of the alignments is included. If the context parameter is set, that many additional bases of the reference upstream and downstream from the alignment are included.
  • --output-sam=FILE β€” writes alignments in SAM format to FILE.
  • --output-glz FILE β€” writes contigs in GLZ 0.9 format to FILE. Generating GLZ only works after --duct-tape, and every contig becomes a GLZ record.
  • --output-3aln FILE β€” writes contigs in a table-based format to FILE. The format is still subject to change, so see the source code for detailed documentation.
  • --output-fasta FILE β€” writes alignments(!) in FastA format to FILE. Each alignment is written as a pair of reference and query sequence, and the aligned coordinates are indicated in the description of the query sequence. If the context parameter is set, that many additional bases of the reference upstream and downstream from the alignment are included. This format is not suggested for any serious use. It only exists to support legacy applications πŸ¦•.
  • --output-fastq FILE β€” writes sequences(!) in FastQ format to FILE. Writing FastQ effectively reconstitutes the input to ANFO if no filtering was done on the results.
  • --output-table FILE β€” writes per-alignment statistics to FILE. The file has three columns: sequence length, alignment score, and difference to the next best alignment. It's mainly useful for analyzing and visualizing the distribution of alignment scores πŸ“Š.
  • --stats FILE β€” writes simple statistics to FILE πŸ“. You get summary stats for a whole stream: number of aligned sequences, average length, and GC content.

🌍 ENVIRONMENT 🌍

  • ANFO_PATH β€” a colon-separated list of directories searched for genome and index files πŸ—‚οΈ.
  • ANFO_TEMP β€” temporary space used for sorting large files.

πŸ“ FILES πŸ“

  • /etc/popt β€” the system-wide configuration file for popt(3). anfo-tool identifies itself as "anfo-tool" to popt.
  • ~/.popt β€” the per-user configuration file for popt(3).

πŸ› BUGS πŸ›

The command line of this tool is way too complicated, and its semantics are counterintuitive. Using anfo-tool is probably best avoided in most cases. The guile bindings should provide a much more scalable and easier-to-understand interface πŸ™ˆ.

πŸ¦‹ AUTHOR πŸ¦‹

Udo Stenzel <udo_stenzel@eva.mpg.de>

πŸ’œ SEE ALSO πŸ’œ

anfo(1), fa2dna(1), popt(3), fasta(5)


bestie, that's the whole tea 🫢 Pulled from the Applications pages, last updated October 2009 πŸ’–βœ¨

πŸ“¦ where this page comes from