ShortRead
Dependencies & Environment
Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.
- Version: 1.70.0 · Bioconductor: 3.23 · R: ≥ 4.6
- Depends: BiocGenerics, BiocParallel, Biostrings, Rsamtools, GenomicAlignments
- Imports: Biobase, S4Vectors, IRanges, Seqinfo, GenomicRanges, pwalign, hwriter, lattice, latticeExtra
- Install:
BiocManager::install("ShortRead")
When to Use
- Iterative FASTQ Processing: Processing massive FASTQ files in memory-efficient chunks using
FastqStreamer() and yield().
- Random Subsampling: Drawing a random sample of reads from a FASTQ file using
FastqSampler() for quick inspection.
- Quality Assessment: Generating HTML quality assessment reports across multiple FASTQ files using
qa() and report().
- Filtering and Trimming: Removing low-quality reads or trimming tails using
nFilter() and trimTailw() before writing back to disk with writeFastq().
When NOT to Use
- For whole-genome alignments or flexible pairwise alignment, use Biostrings or pwalign instead because
ShortRead is designed for basic input, QA, and filtering rather than complex alignments.
Data Requirements
- Input: FASTQ files (e.g.,
.fastq, .fastq.gz) or legacy Solexa export files (s_N_export.txt).
- Output: Filtered FASTQ files,
ShortReadQ objects, or HTML QA reports.
- Data Structures: Reads are represented as
DNAStringSet objects and quality scores as FastqQuality or BStringSet objects.
Key Parameters
- fl: The file path to the FASTQ file being read or streamed.
- destination: The output file path used in
writeFastq().
- type: The format type specified in
qa() (e.g., type="fastq").
- dirPath: The directory path used in
readXStringColumns() to locate files.
- pattern: The regular expression pattern used to match files in
readXStringColumns().
- colClasses: A list specifying the class of each column to be read in
readXStringColumns().
Best Practices
- Use
FastqStreamer() in a repeat loop to process large FASTQ files in chunks, preventing memory exhaustion.
- Use
FastqSampler() to draw a representative subset (e.g., 1M reads) for rapid quality assessment.
- Generate a QA report using
qa() and view it in a browser using browseURL(report()) before starting downstream analysis.
- Check the quality score encoding of your FASTQ files using
encoding(quality()) to ensure accurate quality filtering.
Common Pitfalls
- Out of Memory Errors: Attempting to load an entire massive FASTQ file into memory with
readFastq(). Fix: Use FastqStreamer() to iterate through the file in manageable chunks.
- Incorrect Quality Trimming: Applying the wrong Phred score threshold because of unknown encoding. Fix: Verify the encoding using
encoding(quality(fq)) before using trimTailw().
- Slow Text Parsing: Using base R functions to read specific columns of sequence text files. Fix: Use
readXStringColumns() to quickly parse columns directly into DNAStringSet and BStringSet objects.
Alternatives
- Biostrings: For general sequence manipulation, pattern matching (
matchPDict), and whole-genome alignments.
- pwalign: For flexible pairwise sequence alignment.
Citations
- Morgan M, et al. (2009) "ShortRead: a bioconductor package for input, quality assessment and exploration of high-throughput sequence data." Bioinformatics.
References
Run this on BioMate
This skill is the knowledge layer — when, why, and how to use shortread. To run this analysis on your own data with managed compute, automated QC, and reproducible outputs, use BioMate — free to start.
▶ Open shortread on BioMate →
1---2name: bioconductor-shortread3description: This package implements sampling, iteration, and input of FASTQ files. The package includes functions for filtering and trimming reads, and for generating a quality assessment report. Data are represented as DNAStringSet-derived objects, an4---56# ShortRead78## Dependencies & Environment910> Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.1112- **Version:** 1.70.0 · **Bioconductor:** 3.23 · **R:** ≥ 4.613- **Depends:** BiocGenerics, BiocParallel, Biostrings, Rsamtools, GenomicAlignments14- **Imports:** Biobase, S4Vectors, IRanges, Seqinfo, GenomicRanges, pwalign, hwriter, lattice, latticeExtra15- **Install:** `BiocManager::install("ShortRead")`1617## When to Use18- **Iterative FASTQ Processing**: Processing massive FASTQ files in memory-efficient chunks using `FastqStreamer()` and `yield()`.19- **Random Subsampling**: Drawing a random sample of reads from a FASTQ file using `FastqSampler()` for quick inspection.20- **Quality Assessment**: Generating HTML quality assessment reports across multiple FASTQ files using `qa()` and `report()`.21- **Filtering and Trimming**: Removing low-quality reads or trimming tails using `nFilter()` and `trimTailw()` before writing back to disk with `writeFastq()`.2223## When NOT to Use24- For whole-genome alignments or flexible pairwise alignment, use **Biostrings** or **pwalign** instead because `ShortRead` is designed for basic input, QA, and filtering rather than complex alignments.2526## Data Requirements27- **Input**: FASTQ files (e.g., `.fastq`, `.fastq.gz`) or legacy Solexa export files (`s_N_export.txt`).28- **Output**: Filtered FASTQ files, `ShortReadQ` objects, or HTML QA reports.29- **Data Structures**: Reads are represented as `DNAStringSet` objects and quality scores as `FastqQuality` or `BStringSet` objects.3031## Key Parameters32- **fl**: The file path to the FASTQ file being read or streamed.33- **destination**: The output file path used in `writeFastq()`.34- **type**: The format type specified in `qa()` (e.g., `type="fastq"`).35- **dirPath**: The directory path used in `readXStringColumns()` to locate files.36- **pattern**: The regular expression pattern used to match files in `readXStringColumns()`.37- **colClasses**: A list specifying the class of each column to be read in `readXStringColumns()`.3839## Best Practices40- Use `FastqStreamer()` in a `repeat` loop to process large FASTQ files in chunks, preventing memory exhaustion.41- Use `FastqSampler()` to draw a representative subset (e.g., 1M reads) for rapid quality assessment.42- Generate a QA report using `qa()` and view it in a browser using `browseURL(report())` before starting downstream analysis.43- Check the quality score encoding of your FASTQ files using `encoding(quality())` to ensure accurate quality filtering.4445## Common Pitfalls46- **Out of Memory Errors**: Attempting to load an entire massive FASTQ file into memory with `readFastq()`. *Fix*: Use `FastqStreamer()` to iterate through the file in manageable chunks.47- **Incorrect Quality Trimming**: Applying the wrong Phred score threshold because of unknown encoding. *Fix*: Verify the encoding using `encoding(quality(fq))` before using `trimTailw()`.48- **Slow Text Parsing**: Using base R functions to read specific columns of sequence text files. *Fix*: Use `readXStringColumns()` to quickly parse columns directly into `DNAStringSet` and `BStringSet` objects.4950## Alternatives51- **Biostrings**: For general sequence manipulation, pattern matching (`matchPDict`), and whole-genome alignments.52- **pwalign**: For flexible pairwise sequence alignment.5354## Citations55- Morgan M, et al. (2009) "ShortRead: a bioconductor package for input, quality assessment and exploration of high-throughput sequence data." Bioinformatics.5657## References58- Homepage: https://bioconductor.org/packages/ShortRead59- Vignette: https://bioconductor.org/packages/release/bioc/vignettes/ShortRead/inst/doc/Overview.pdf6061<!-- biomate-cta -->62---6364## Run this on BioMate6566This skill is the **knowledge layer** — when, why, and how to use `shortread`. To **run this analysis on your own data** with managed compute, automated QC, and reproducible outputs, use **[BioMate](https://www.biomate.ai?ref=kb&pkg=shortread)** — free to start.6768▶ **[Open `shortread` on BioMate →](https://www.biomate.ai?ref=kb&pkg=shortread)**