bb_get_fasta_id - ampinzonv/BB3 GitHub Wiki

Function: bb_get_fasta_id

Extract sequence IDs from FASTA headers (first word after '>').


๐Ÿ” Description

This function extracts the unique identifiers (IDs) from FASTA headers. It captures only the first word after the > character in each header line.

๐Ÿ“ฅ Input

  • A FASTA file with one or more entries.
  • Accepts input from STDIN using --input -.

๐Ÿ“ค Output

  • List of FASTA sequence IDs (without the > symbol), one per line.

๐Ÿงช Examples

Extract IDs from a file:

bb_get_fasta_id --input sequences.fasta

Using STDIN:

cat sequences.fasta | bb_get_fasta_id --input -

Save to file:

bb_get_fasta_id --input sequences.fasta --outfile ids.txt

โš™๏ธ Usage

bb_get_fasta_id --input FILE [--outfile FILE] [--quiet] [--force]

๐Ÿงต Options

Option Description
--input FILE Input FASTA file or - for STDIN (required)
--outfile FILE Output file path (optional, default: STDOUT)
--quiet Suppress log messages
--force Overwrite existing output file

๐Ÿ“Œ Notes

  • The ID is the first space-separated token after the > symbol in each header.