You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [2.0.0] - 2025-08-12
9
+
10
+
### Added
11
+
- Added a `reads_extracted_per_taxon` field to to summary report (#28)
12
+
- Added a `proportion_extracted` field to summary report (#28)
13
+
- Added the version to summary report (#28)
14
+
- Added an output format (`fasta` or `fastq`) field to the summary report (#28)
15
+
- Added a `--verbose` flag (in addition to the existing `-v`)
16
+
17
+
### Changed
18
+
- Removed `-O` for compression type, now uses `--compression-format` for clarity.
19
+
- Removed `-l` for compression level, now uses `--compression-level` for clarity.
20
+
- Renamed `--json-report` to `--summary`
21
+
- Improved the JSON report format to make it easier to read by removing `Paired` and `Single` fields and instead having a simple `total_reads_in` and `total_reads_out` field.
22
+
23
+
### Fixed
24
+
- Removed duplicate log message for taxon IDs identified
Copy file name to clipboardExpand all lines: README.md
+79-88Lines changed: 79 additions & 88 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,27 +10,25 @@
10
10
11
11
**kra**ken extr**actor**
12
12
13
-
Kractor extracts sequencing reads based on taxonomic classifications obtained
14
-
via [Kraken2](https://github.com/DerrickWood/kraken2). It consumes paired or unpaired `fastq[.gz/.bz]` files as input
15
-
alongisde a Kraken2 standard output. It can optionally consume a Kraken2 report to extract all taxonomic parents and
16
-
children of a given taxid. Fast and multithreaded by default, it outputs `fast[q/a]` files, that can optionally be
17
-
compressed. Memory usage
18
-
is minimal, averaging ~4.5MB while processing a 17GB fastq file.
13
+
Kractor extracts sequencing reads from fastq `[.gz/.bz2]` files using taxonomic classifications obtained via Kraken2.
14
+
It supports single or paired-end reads, can optionally include taxonomic parents or children, and uses minimal memory (~4.5 MB for a 17 GB FASTQ file).
19
15
20
-
The end result is a `fast[q/a]` file containing all reads classified as the specified taxon.
16
+
The end result is a `fast[q/a]` file containing all reads classified as the specified taxon(s).
21
17
22
-
Kractor significantly enhances processing speed compared to KrakenTools for both paired and unpaired reads. Paired reads
23
-
are processed approximately 21x quicker for compressed fastqs and 10x quicker for uncompressed. Unpaired reads are
24
-
approximately 4x faster for both compressed and uncompressed inputs.
18
+
Kractor significantly enhances processing speed compared to KrakenTools for both paired and unpaired reads.
19
+
20
+
*Performance vs KrakenTools:*
21
+
- Paired compressed FASTQ: ~21× faster
22
+
- Paired uncompressed FASTQ: ~10× faster
23
+
- Unpaired: ~4× faster (compressed or uncompressed)
25
24
26
25
For additional details, refer to the [benchmarks](benchmarks/benchmarks.md)
27
26
28
27
## Motivation
29
28
30
-
Inspired by [KrakenTools](https://github.com/jenniferlu717/KrakenTools).
29
+
Provides similar functionality to the [KrakenTools](https://github.com/jenniferlu717/KrakenTools)`extract_kraken_reads` python script.
31
30
32
-
The main motivation was to enchance speed when parsing, extracting, and writing a large volume of reads - and also to
33
-
learn rust.
31
+
However the main motivation was to enhance speed when processing multiple, large FASTQ files - and as a way to learn Rust.
Use `--json-report` to get summary statistics (output to stdout on completion)
140
150
```json
141
151
{
142
-
"taxon_count": 1,
143
-
"taxon_ids": [
144
-
1
145
-
],
146
-
"reads_in": {
147
-
"Paired": {
148
-
"total": 107053222,
149
-
"read1": 53526611,
150
-
"read2": 53526611
151
-
}
152
+
"total_taxon_count": 2,
153
+
"reads_extracted_per_taxon": {
154
+
"0": 745591,
155
+
"1": 1646
152
156
},
153
-
"reads_out": {
154
-
"Paired": {
155
-
"total": 185410,
156
-
"read1": 92705,
157
-
"read2": 92705
158
-
}
159
-
},
160
-
"input_format": "paired"
157
+
"total_reads_in": 3491078,
158
+
"total_reads_out": 747237,
159
+
"proportion_extracted": 0.2140419091180432,
160
+
"input_format": "single",
161
+
"output_format": "fastq",
162
+
"kractor_version": "2.0.0"
161
163
}
162
164
```
163
165
@@ -169,105 +171,94 @@ Use `--json-report` to get summary statistics (output to stdout on completion)
169
171
170
172
`-i, --input`
171
173
172
-
This option will specify the input files containing the reads you want to extract from. They can be compressed - (`gz`,
173
-
`bz2`). Paired end reads can be specified by:
174
+
Specifies one or two input FASTQ files to extract reads from. Files may be uncompressed or compressed (`gz`,`bz2`).
175
+
Paired end reads can be specified by:
174
176
175
177
Using `--input` twice: `-i <R1_fastq_file> -i <R2_fastq_file>`
176
178
177
179
Using `--input` once but passing both files: `-i <R1_fastq_file> <R2_fastq_file>`
178
180
179
-
This means that bash wildcard expansion works: `-i *.fastq`
180
-
181
181
#### Output
182
182
183
183
`-o, --output`
184
184
185
-
This option will specify the output files containing the extracted reads. The order of the output files is assumed to be
186
-
the same as the input.
187
-
188
-
By default the compression will be inferred from the output file extension for supported file types (`gz`, `bz`). If the
189
-
output type cannot be inferred, plaintext will be output.
185
+
Specifies the output file(s) for extracted reads, matching the order of the input files.
186
+
Compression type is inferred from the file extension (.gz, .bz2). If not recognised, output will be uncompressed.
190
187
191
188
#### Kraken Output
192
189
193
190
`-k, --kraken`
194
191
195
-
This option will specify the path to the [Standard Kraken Output Format file](https://github.com/DerrickWood/kraken2/wiki/Manual#standard-kraken-output-format), containing taxonomic classification of read IDs.
192
+
Path to the [Standard Kraken Output Format file](https://github.com/DerrickWood/kraken2/wiki/Manual#standard-kraken-output-format), containing taxonomic classification of read IDs.
196
193
197
194
#### Taxid
198
195
199
196
`-t, --taxid`
200
197
201
-
This option will specify the taxon ID for reads you want to extract.
198
+
One or more taxonomic IDs to extract.
202
199
203
-
Multiple taxids can be specified:
204
-
`-t 1 2 10`.
200
+
For example: `-t 1 2 10`
205
201
206
-
Each taxid will adhere to`--exclude``--parents` and `--children`
202
+
Each taxid is affected by`--exclude`,`--parents`, and `--children` if those options are used.
207
203
208
204
### Optional:
209
205
210
206
#### Output type
211
207
212
-
`-O, --output-type`
213
-
214
-
This option will manually set the compression mode used for the output file and will override the type inferred from the
215
-
output path.
208
+
`--compression-format`
216
209
217
-
Valid values are:
210
+
Manually set output compression format, overriding what is inferred from file names.
218
211
219
-
-`gz` to output gz
220
-
-`bz2` to output bz2
221
-
-`none` to not apply compresison
212
+
Valid values:
213
+
-`gz` – gzip compression
214
+
-`bz2` – bzip2 compression
215
+
-`none` – no compression
222
216
223
217
#### Compression level
224
218
225
-
`-l, --level`
219
+
`--compression-level`
220
+
221
+
Set compression level (1–9).
222
+
- 1 = fastest, largest file
223
+
- 9 = slowest, smallest file
226
224
227
-
This option will set the compression level to use if compressing the output. Should be a value between 1-9 with 1 being
228
-
the fastest but largest file size and 9 is for slowest, but best file size. By default this is set at 2 as it is a good
229
-
trade off for speed/filesize.
225
+
Default: 2 (balance of speed and size)
230
226
231
227
#### Output fasta
232
228
233
229
`--output-fasta`
234
230
235
-
This option will output a fasta file, with read ids as headers.
231
+
Output sequences in FASTA format instead of FASTQ.
236
232
237
233
#### Kraken Report
238
234
239
235
`-r, --report`
240
236
241
-
This option specifies the path to the [Kraken2 report file](https://github.com/DerrickWood/kraken2/wiki/Manual#sample-report-output-format). If you want to use `--parents` or `--children`
242
-
then is argument is required.
237
+
Path to the [Kraken2 report file](https://github.com/DerrickWood/kraken2/wiki/Manual#sample-report-output-format). Required if using `--parents` or `--children`.
243
238
244
239
#### Parents
245
240
246
241
`--parents`
247
242
248
-
This will extract reads classified at all taxons between the root and the specified `--taxid`.
243
+
Include reads classified between the root and the specified `--taxid`. Requires `--report`.
249
244
250
245
#### Children
251
246
252
247
`--children`
253
248
254
-
This will extract all the reads classified as decendents or subtaxa of `--taxid` (Including the taxid).
249
+
Include reads classified at the given taxid and all its descendant taxa. Requires `--report`.
255
250
256
251
#### Exclude
257
252
258
253
`--exclude`
259
254
260
-
This will output every read except those matching the taxid. Works with `--parents`and`--children`
255
+
Extract all reads except those matching the given taxids. Can be combined with `--parents`or`--children`.
261
256
262
257
#### JSON report
263
258
264
-
`--json-report`
265
-
266
-
This will output a json report that to stdout upon programme completion.
0 commit comments