SortByName
This is an alias script that redirects to bbsort.sh using pushd/popd directory resolution and BASH_SOURCE[0] symlink handling. It provides identical functionality to bbsort.sh for backwards compatibility.
Automatic Redirect
The sortbyname.sh script is a simple wrapper that calls bbsort.sh with all the same parameters.
You will be automatically redirected to the complete BBSORT documentation in 3 seconds.
If you are not redirected automatically: Click here to go to BBSORT documentation
About This Tool
The bbsort tool (accessible via both bbsort.sh and sortbyname.sh) sorts sequencing reads using the sort.SortByName class with multiple concurrent processing strategies:
- Name-based sorting: Uses
ConcurrentReadInputStreamandConcurrentReadOutputStreamto sort reads alphabetically by name with efficient comparison operations - Sequence sorting: Implements sequence-based sorting via
Read.sequencecomparison with optional reverse complementation for genomic analysis - Quality-based sorting: Evaluates quality scores using
Read.qualityarrays with statistical aggregation and optional trimming integration - Length-based sorting: Uses
Read.length()method with numeric comparison for read length distribution analysis and filtering - Custom field sorting: Supports header-based field extraction and sorting with configurable delimiters using
Read.idparsing andsplit()operations
Memory Management: Utilizes ListNum<Read> collections with concurrent processing, efficient in-memory sorting algorithms, and optional external sort for large datasets exceeding available RAM.
For complete parameter documentation and examples, see the full BBSORT documentation.
Basic Usage
# Both commands work identically via sort.SortByName:
sortbyname.sh in=reads.fq out=sorted.fq
bbsort.sh in=reads.fq out=sorted.fq
# Advanced sorting modes supported:
sortbyname.sh in=reads.fq out=sorted.fq sort=sequence
sortbyname.sh in=reads.fq out=sorted.fq sort=length reverse=t
sortbyname.sh in=reads.fq out=sorted.fq sort=quality ascending=f
Processing Architecture: Both scripts invoke java -cp bbmap.jar sort.SortByName with 4-buffer concurrent I/O streams, automatic format detection via FileFormat.testInput(), and configurable compression levels through ReadWrite.setZipThreads().
Support
For questions and support:
- Email: bbushnell@lbl.gov
- Documentation: bbmap.org