GT-EXTRACTSEQ(1)
β¨ NAME β¨
gt-extractseq β the lil icon that extracts sequences from your sequence file(s) or from a fastaindex. π
(it lives in the GenomeTools Manual, section 1 β yes bestie, that's the vibe π¦)
π SYNOPSIS π
gt extractseq [option ...] [sequence_file(s)] | fastaindex
πΈ DESCRIPTION πΈ
Okay so before we get into the lore, here's the full option menu β no skips, no crumbs left behind: π
-frompos[value] β extract the sequence starting from this position, and the counting starts at 1 (default:0)-topos[value] β extract the sequence up to this position, again counting from 1 (default:0)-match[string] β extract every sequence whose description matches the given pattern. Heads up bestie, the pattern has to be a valid extended regular expression. (default:undefined)-keys[filename] β extract substrings for the keys in the specified file (default:undefined)-width[value] β set the output width for FASTA sequence printing (0disables formatting) (default:0)-o[filename] β redirect output to the specified file (default:undefined)-gzip[yes|no] β write a gzip compressed output file (default:no)-bzip2[yes|no] β write a bzip2 compressed output file (default:no)-force[yes|no] β force writing to the output file (default:no)-helpβ display help and exit π-versionβ display version information and exit
π the -keys situation (iykyk)
The option -keys lets you extract substrings or sequences from the given sequence file, or from a fasta index. The substrings you want get specified in a key file, which you hand over as the argument to this option. That key file must contain lines of the form
k
or
k i j
where k is a string (the key) and the optional i and j are positive integers such that iβj. So k is the key, and the optional numbers i and j specify the first position of the substring and the last position of the substring to be extracted. Those positions are counted from 1. If k is identical to the string between the first and second occurrence of the symbol | in a fasta header, then the fasta header and the corresponding sequence is output. Like, for example, in the fasta header
>tr|A0AQI4|A0AQI4_9ARCH Putative ammonia monooxygenase (Fragment)
the fasta key is A0AQI4. π If i and j are both specified, then the corresponding substring is shown in fasta format. In that latter case, the header of the fasta formatted sequence in the output begins with
>k i j
followed by the original fasta header.
ποΈ if your input is fasta files
If the sequence input are fasta files, then the following holds:
- duplicated lines in the input file lead to only one sequence in the output
- the sequences are output according to the order in the original sequence files
- the formatting of the output can be controlled by the options
-width,-o,-gzip, and-bzip2
π§ if your input comes from a fasta index
If the sequence input comes from a fasta index (see below), the following holds:
- option
-widthis required β οΈ - option
-o,-gzipand-bzip2do not work π - the sequences are output in the order the corresponding keys appear in the key file
π the fastaindex pipeline
If the end of the argument list only contains one filename, say fastaindex, then it is checked if there is a file fastaindex.kys. That makes up part of the fasta index, which is constructed by calling the suffixerator tool as follows:
gt suffixerator -protein -ssp -tis -des -sds -kys -indexname fastaindex \
-db inputfile1 [inputfile2 ..]
This reads the protein sequence files given to the option -db and creates several files:
- a file
fastaindex.esqrepresenting the sequence. - a file
fastaindex.sspspecifying the sequence separator positions. - a file
fastaindex.desshowing the fasta headers line by line. - a file
fastaindex.sdsgiving the sequence header delimiter positions. - a file
fastaindex.kyscontaining the keys in the fasta files.
For the suffixerator command to work, the keys of the form |key| in the fasta header must satisfy the following constraints:
- they all have to be of the same length, not longer than
128, and not shorter than1 - they have to appear in lexicographic order
π REPORTING BUGS π
Report bugs to https://github.com/genometools/genometools/issues. (be nice, the maintainers are doing their best π«Ά)
okay that's the whole page, you ate that fr fr π β¨
This was GenomeTools 1.6.6, dated 11/09/2025 β periodt. ππ
π¦ where this page comes from
- ubuntu resolute: genometools 1.6.6+ds-2
- ubuntu stonking: genometools 1.6.6+ds-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms