SUBSTITCH(1)

✨ SUBSTITCH ✨

okay bestie, come SIT. we're talking about substitch.pl, a lil script from the User Contributed Perl Documentation corner of the universe, and she is lowkey a whole workhorse πŸ΄πŸ’–


πŸŽ€ NAME πŸŽ€

substitch.pl β€” split/merge stitch files into/out of stitch files. that's it, that's the gig πŸ’…


🌸 SYNOPSIS 🌸

literally the two moods:

substitch.pl --split 5 allchromosomes.stitch  #split big stitch into 5 roughly equal chunks

substitch.pl --project allspecies.seqs sub.anchors #project some anchors into a different coordinate space (as long as the stitch component sequences match)

first one: big stitch file in, 5 roughly-equal chunks out 🍰 second one: take some anchors and project them into a different coordinate space β€” and yes, this only works as long as the stitch component sequences match, no cap 🫢


πŸ’… OPTIONS πŸ’…

one bullet per option, as the ancestors intended:

  • --verbose β€” makes it more verbose. more yapping. more ✨details✨.
  • --faketfidf β€” fake tfidf scores based on the score stat in the file. it is literally in the name, she is faking it πŸ™ˆ

πŸ“ Note on split (read this one, fr fr)

okay so this program does not claim to produce an optimal splitting. she tries a couple heuristics, refines the results, and picks the best arrangement she's found so far. that's the vibe. best-effort queen πŸ‘‘

technically this is a variation on the traditional "trunk packing problem," which is β€” at least in the abstract case β€” NP-hard, if the author remembers 15-251 correctly 😭 (respect for the algorithm class callback, ngl).

but this particular variety of trunk packing seems like it should be solvable faster β€” worst case, some n^k dynamic programming, they think. but the author is betting this way is faster and tons easier to write for 90% of the cases out there πŸ’€βœ¨

and then, the most iconic invitation in all of Unix documentation:

if anyone reading this goes "You moron, this has been solved a thousand times already," please let them know how: krisp@dna.bio.keio.ac.jp πŸ“§

no gatekeeping, just vibes and a request for peer review. we love to see it πŸ₯ΉπŸ’–


and that's the whole page, bestie!! this beauty ships as part of perl v5.40.1, dated 2026-08-12 β€” so go forth, split your stitches, project your anchors, and remember: not optimal, but she's doing her best πŸ¦‹πŸŒΈπŸ’œ

πŸ“¦ where this page comes from