LEAFF(1)

πŸ¦‹ NAME πŸ¦‹

okay so, bestie, meet leaff β€” sequence library utilities and applications πŸ’–. This is the LEAFF(1) page from the General Commands Manual, and we're gonna read it together like it's a group chat, no cap ✨.


🌸 SYNOPSIS 🌸

leaff [-f fasta-file] [options]

✨ DESCRIPTION ✨

LEAFF stands for Let's Extract Anything From Fasta (yes, the name is literally iconic πŸ’…) and it's a utility program for working with multi-fasta files. Not only does it give you random access to the base level, it also comes with a whole little friend group of analysis functions 🫢. It's giving swiss army knife. It's giving main character energy πŸ”₯.


πŸŽ€ OPTIONS πŸŽ€

πŸ’œ SOURCE FILES

  • -f file β€” use the sequence in file. (-F is also allowed, for historical reasons, so if you see -F don't panic, it's the same vibe πŸ’€)
  • -A file β€” read actions from file

🧚 SOURCE FILE EXAMINATION

  • -d β€” print the number of sequences in the fasta
  • -i name β€” print an index, labelling the source name

🌈 OUTPUT OPTIONS

  • -6 <#> β€” insert a newline every 60 letters. If the next arg is a number, newlines are inserted every n letters, e.g., -6 80. Disable line breaks with -6 0, or just don't use -6 at all, queen 😌
  • -e beg end β€” Print only the bases from position beg to position end (space based, relative to the FORWARD sequence!). If beg == end, then the entire sequence is printed. It is an error to specify beg > end, or beg > len, or end > len β€” so pls don't, it will simply not slay πŸ™ˆ
  • -ends n β€” Print n bases from each end of the sequence. One input sequence generates two output sequences, with _5 or _3 appended to the ID. If 2n >= length of the sequence, the sequence itself is printed, no ends are extracted (they overlap) πŸ’«
  • -C β€” complement the sequences
  • -H β€” DON'T print the defline
  • -h β€” Use the next word as the defline (-H -H will reset to the original defline)
  • -R β€” reverse the sequences
  • -u β€” uppercase all bases

πŸ“ SEQUENCE SELECTION

  • -G n s l β€” print n randomly generated sequences, 0 < s <= length <= l
  • -L s l β€” print all sequences such that s <= length < l
  • -N l h β€” print all sequences such that l <= % N composition < h
    • (NOTE 0.0 <= l < h < 100.0)
    • (NOTE that you cannot print sequences with 100% N. This is a useful bug πŸ›πŸ’€)
  • -q file β€” print sequences from the seqid list in file
  • -r num β€” print num randomly picked sequences
  • -s seqid β€” print the single sequence seqid
  • -S f l β€” print all the sequences from ID f to l (inclusive)
  • -W β€” print all sequences (do the whole file)

πŸ’… LONGER HELP

  • -help analysis
  • -help examples

πŸ‘‘ ANALYSIS FUNCTIONS

  • --findduplicates a.fasta β€” Reports sequences that are present more than once. Output is a list of pairs of deflines, separated by a newline.
  • --mapduplicates a.fasta b.fasta β€” Builds a map of IIDs from a.fasta and b.fasta that have identical sequences. Format is "IIDa <-> IIDb"
  • --md5 a.fasta β€” Don't print the sequence, but print the md5 checksum (of the entire sequence) followed by the entire defline.
  • --partition prefix [ n[gmk]bp | n ] a.fasta
  • --partitionmap [ n[gmk]bp | n ] a.fasta

Partition the sequences into roughly equal size pieces of size nbp, nkbp, nmbp or ngbp; or into n roughly equal sized partitions. Sequences larger that the partition size are in a partition by themself. --partitionmap writes a description of the partition to stdout; --partiton creates a fasta file prefix-###.fasta for each partition.

Example:

-F some.fasta --partition parts 130mbp
-F some.fasta --partition parts 16
  • --segment prefix n a.fasta β€” Splits the sequences into n files, prefix-###.fasta. Sequences are not reordered; the first n sequences are in the first file, the next n in the second file, etc.
  • --gccontent a.fasta β€” Reports the GC content over a sliding window of 3, 5, 11, 51, 101, 201, 501, 1001, 2001 bp.
  • --testindex a.fasta β€” Test the index of file. If the index is up-to-date, leaff exits successfully, else, leaff exits with code 1. If an index file is supplied, that one is tested, otherwise, the default index file name is used.
  • --dumpblocks a.fasta β€” Generates a list of the blocks of N and non-N. Output format is 'base seq# beg end len'. 'N 84 483 485 2' means that a block of 2 N's starts at space-based position 483 in sequence ordinal 84. A . is the end of sequence marker.
  • --errors L N C P a.fasta β€” For every sequence in the input file, generate new sequences including simulated sequencing errors.
    • L β€” length of the new sequence. If zero, the length of the original sequence will be used.
    • N β€” number of subsequences to generate. If L=0, all subsequences will be the same, and you should use C instead.
    • C β€” number of copies to generate. Each of the N subsequences will have C copies, each with different errors.
    • P β€” probability of an error.

HINT: to simulate ESTs from genes, use L=500, N=10, C=10

  • make C=10 sequencer runs of N=10 EST sequences of length 500bp each.

to simulate mRNA from genes, use L=0, N=10, C=10

to simulate reads from genomes, use L=800, N=10, C=1

  • of course, N= should be increased to give the appropriate depth of coverage
  • --stats a.fasta β€” Reports size statistics; number, N50, sum, largest.
  • --seqstore out.seqStore β€” Converts the input file (-f) to a seqStore file (for instance, for use with the Celera assembler or sim4db).

😭 NOTES 😭

Please note that options are ORDER DEPENDENT. Sequences are printed whenever a SEQUENCE SELECTION option occurs on the command line. OUTPUT OPTIONS are not reset when a sequence is printed.

And the one that gets everybody: SEQUENCES are numbered starting at ZERO, not one! fr fr, zero. not one. zero 🫠


🌟 EXAMPLES 🌟

  1. Print the first 10 bases of the fourth sequence in file genes:
leaff -f genes -e 0 10 -s 3
  1. Print the first 10 bases of the fourth and fifth sequences:
leaff -f genes -e 0 10 -s 3 -s 4
  1. Print the fourth and fifth sequences reverse complemented, and the sixth sequence forward. The second set of -R -C toggle off reverse-complement:
leaff -f genes -R -C -s 3 -s 4 -R -C -s 5
  1. Convert file genes to a seqStore genes.seqStore:
leaff -f genes --seqstore genes.seqStore

πŸ’– SEE ALSO πŸ’–


and that's the whole page, bestie πŸŽ€ this was the LEAFF(1) manual from January 2016 β€” go extract literally anything from fasta, you got this πŸ’…βœ¨