samtools-fqidx(1)
β¨ samtools fqidx β the fastq indexer/querier β¨
Okay bestie, so this is samtools-fqidx(1), part of the samtools fam 𧬠β it's the FASTQ cousin of faidx, and it's here to either build you an index or pull subsequences back out. Let's get into it π
π NAME π
samtools fqidx β it indexes, or queries regions out of, a fastq file. That's it, that's the whole vibe β¨
π SYNOPSIS π
samtools fqidx ref.fastq [region1 [...]]
π¦ DESCRIPTION π¦
So here's the tea β: samtools fqidx will either index a reference sequence that's in FASTQ format, or extract a subsequence from an already-indexed reference sequence. Two modes, one tool, main character energy π
If you pass no region at all, fqidx just indexes the file and creates <ref.fastq>.fai right there on your disk π«Ά.
If you do give it regions, then the subsequences get retrieved and printed to stdout in FASTQ format. Slay β¨
Your input and output can both be files compressed in BGZF format. When the output is compressed, the default compression level is 4 β that's the default, no cap.
β οΈ Heads up! The sequences in your input file really should all have different names. If they don't, indexing will yell at you with a warning about duplicate sequences, and retrieval will only ever produce subsequences from the first sequence with the duplicated name π. So like... rename your stuff, bestie.
π And this is a big one: samtools fqidx should only be used on fastq files with a small number of entries. If you try to use it on a file containing millions of short sequencing reads, you'll get an index that's almost as big as the original file, and searches using the index will be very slow and eat a lot of memory. Not the vibe. Not it at all π.
πΈ OPTIONS πΈ
-o,--outputFILE β write the FASTQ to a file instead of to stdout. If FILE ends with.gz,.bgzor.bgzfthen it gets BGZF compressed π-n,--lengthINT β the length used for FASTQ sequence line wrapping. If it's zero, that means do not line wrap at all. Defaults to the line length in the input file π-c,--continueβ keeps going even if you request a region that doesn't exist. Persistence, honestly β¨-r,--region-fileFILE β reads regions from a file. The format ischr:from-to, one per line π¦-i,--reverse-complementβ outputs the sequence as the reverse complement. When you use this one,β/rcβgets appended to the sequence names. Wanna turn that off or change the string appended? That's what the--mark-strandoption is for π«Ά--mark-strandTYPE β appends a strand indicator to the sequence name. TYPE can be one of these:rcβ append'/rc'when writing the reverse complement. This is the default πnoβ do not append anything. Minimalist πsignβ append'(+)'for forward strand or'(-)'for reverse complement. This matches the output ofβbedtools getfasta -sββ¨custom,<pos>,<neg>β append the string <pos> to names when writing the forward strand and <neg> when writing the reverse strand. Spaces are preserved, so it's totally possible to move the indicator into the comment part of the description line by including a leading space in the strings <pos> and <neg> π
--fai-idxFILE β read/write to the specified index file πΈ--gzi-idxFILE β read/write to the specified compressed file index (used with.gzfiles) π-h,--helpβ prints the help message and exits. Classic π¦--output-fmt-optionOPT=VAL β sets the output format options, e.g.level=0..9for compression level0to9π₯--write-indexβ creates an index for the output sequence data right along with the output, in the same path as<output name>.fai,<outputname>.gzi. This option is valid only for file output, fyi β-@,--threadsN β sets the number of extra threads for operations on compressed files. Go fast, bestie π
π AUTHOR π
Written by Heng Li, with modifications by Andrew Whitwham and Robert Davies, all from the Sanger Institute. Legends, honestly π«Ά
π SEE ALSO π
Samtools website: <http://www.htslib.org/> β go say hi π
Okay that's the whole page, bestie! This one's from samtools-1.24, dated 9 July 2026 β so mark your calendar and go index something small πβ¨π
π¦ where this page comes from
- epel 10: samtools 1.24-2.el10_3 Β· MIT
- nixpkgs unstable: samtools 1.24
- Copyright (C) 2008-2011, 2013-2018, 2020, 2024 Genome Research Ltd
- copyright (C) 2010, 2011 Broad Institute
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms