bb_get_fasta_range - ampinzonv/BB3 GitHub Wiki
bb_get_fasta_range
Function: Extract a specific subsequence range from a FASTA entry by ID and coordinates.
๐ Description
This function retrieves a subsequence from a FASTA entry based on start and end positions. If the file contains only one sequence, the entry ID can be auto-detected.
๐ฅ Input
- A FASTA file with sequence data.
- STDIN is supported with
--input -
.
๐ค Output
- A new FASTA record containing only the specified range.
๐งช Examples
Extract positions 10โ30 from seq1
:
bb_get_fasta_range --input db.fasta --entry seq1 --start 10 --end 30
Auto-detect ID when only one sequence is present:
bb_get_fasta_range --input single_seq.fasta --start 5 --end 15
โ๏ธ Usage
bb_get_fasta_range --input FILE [--entry ID] --start INT --end INT [--outfile FILE] [--quiet] [--force]
๐งต Options
Option | Description |
---|---|
--input FILE |
FASTA file or - for STDIN (required) |
--entry ID |
Entry ID (optional if input contains only one sequence) |
--start INT |
Start position (1-based, inclusive) (required) |
--end INT |
End position (1-based, inclusive) (required) |
--outfile FILE |
Output file (default: STDOUT) |
--quiet |
Suppress informational messages |
--force |
Overwrite output file if it exists |
๐ Notes
- Coordinates are 1-based and inclusive.
- If
--entry
is not provided, and the file has more than one sequence, the function will abort.