Skip to content

vimalinx/bio-agent / .claude/skills/seq-cache-populate-pl

seq-cache-populate-pl

Unverified

Use when populating an htslib/CRAM `REF_CACHE` directory from FASTA input or by scanning a directory tree for FASTA files.

seq-cache-populate-pl

Perl cache builder for htslib reference caching. It reads FASTA entries, uppercases and whitespace-strips the sequence, hashes the normalized sequence by MD5, and writes each entry into a REF_CACHE-style directory tree under the chosen root.

Quick Start

  • Command: seq_cache_populate.pl -root <dir> input1.fasta ...
  • Local executable: /home/vimalinx/miniforge3/envs/bio/bin/seq_cache_populate.pl
  • Main output: populated cache tree plus a printed REF_CACHE=... template

When To Use This Tool

  • Building a CRAM-compatible reference cache from FASTA files
  • Precomputing MD5-keyed reference paths before samtools, htslib, or CRAM workflows
  • Scanning a directory tree for FASTA-like files with -find
  • Reusing an existing cache root and skipping entries that are already present

Common Patterns

# Populate a cache from one FASTA file
seq_cache_populate.pl -root ref_cache reference.fa
# Scan a directory tree for FASTA-like files
seq_cache_populate.pl -root ref_cache -find refs/
# Use a deeper hash directory layout
seq_cache_populate.pl -root ref_cache -subdirs 15 reference.fa

Recommended Workflow

  1. Pick a cache root that downstream CRAM tools can read consistently.
  2. Choose direct FASTA arguments, -find <dir>, or stdin if you want to stream one FASTA file through the script.
  3. Run the script and capture the printed REF_CACHE=... template.
  4. Export that REF_CACHE value in later samtools / htslib jobs that need reference lookup by MD5.

Guardrails

  • -root <dir> is mandatory. With no arguments, the script prints only the usage banner.
  • The tool is a normal Perl script, so its only built-in usage path is the Perl GetOptions failure / missing-argument banner; there is no separate --version.
  • Live testing showed cache entries created under MD5-derived hex paths such as cache/f1/f8/f4bf..., followed by a printed Use environment REF_CACHE=.../%2s/%2s/%s.
  • Re-running against the same FASTA does not duplicate entries; it prints Already exists: <md5> <seqid> instead.
  • -find only accepts candidate files whose first line looks like >id and whose second line matches a nucleotide alphabet regex.
  • Source inspection shows -subdirs 16 is rejected, but the error text misleadingly says it “should be less than 15”; local testing confirmed -subdirs 15 still works.
  • Large sequences spill to temporary files once buffered sequence length exceeds roughly 256 MiB, and those temporary files are created under the chosen cache root.
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 192kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 192kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 192kUpdated Claude CodeCodexVerifiedInstall