|
4 | 4 |
|
5 | 5 | Next generation sequencers often produce an excess of reads, for reasons such as to create redundancy for enabling consensus generation, due to requiring a minimum amount of reagents per run, or other reasons. Running the full read set through a pipeline can be computationally expensive, so it may be desirable to transform the data into a smaller subset to save time. |
6 | 6 |
|
7 | | -IRMA-core's sampler process provides efficient, random, and fully-representative downsampling (also referred to as subsampling), as well as some other useful functionality. |
| 7 | +IRMA-core's `sampler` process provides efficient, random, and fully-representative downsampling (also referred to as subsampling), as well as some other useful functionality. |
8 | 8 |
|
9 | 9 | ## Downsampling Targets |
10 | 10 |
|
11 | | -IRMA-core's sampler requires a target for downsampling. This can either be provided as `--subsample-target`, which is the exact number of reads to be in the subsampled output, or `--percent-target`, which is the percentage of the original amount of reads to be in the subsampled output. |
| 11 | +IRMA-core's `sampler` requires a target for downsampling. This can either be provided as `--subsample-target`, which is the exact number of reads to be in the subsampled output, or `--percent-target`, which is the percentage of the original amount of reads to be in the subsampled output. |
12 | 12 |
|
13 | 13 | Percent targets must be provided as an integer [0-100] and may not provide an exact percentage downsampled in the cases of streamed or compressed input. |
14 | 14 |
|
15 | 15 | - If a `--percent-target` of 100 is provided, no downsampling will occur. This could be useful for de-interleaving without downsampling. |
16 | 16 | - If a `--subsample-target` is provided that is *greater* than the amount of sequences in the input, the process will succeed and give an output that is identical to the input, but provide a warning for the user. |
17 | 17 |
|
| 18 | +## Random number generation and seeds |
| 19 | + |
| 20 | +`sampler` uses the `Xoshiro256StarStar` random number generator, which requires |
| 21 | +a seed, which will be accessed in the following order: |
| 22 | + |
| 23 | +1. A seed may be provided via `--rng-seed` in a `u64` format |
| 24 | +2. If that `--rng-seed` is not provided, `sampler` will check the `IRMA_SEED` |
| 25 | +environment variable, and if it is set, attempt to parse it into a `u64` |
| 26 | +3. If `IRMA_SEED` is unable to be parsed, `sampler` will run the seed through a |
| 27 | +hashing function |
| 28 | +4. Lastly, if `--rng-seed` is not provided, and `IRMA_SEED` is not set, a random |
| 29 | +seed will be generated from the system |
| 30 | + |
18 | 31 | ## Inputs and Outputs |
19 | 32 |
|
20 | | -Sampler can downsample `FASTQ` and `FASTA` formats. Inputs are provided as positional arguments, with sampler accepting either a single file, or as a pair of paired-read files. The files may also be a stream (e.g., from a process substitution) or a `.gz` compressed file. |
| 33 | +`sampler` can downsample `FASTQ` and `FASTA` formats. Inputs are provided as positional arguments, with `sampler` accepting either a single file, or as a pair of paired-read files. The files may also be a stream (e.g., from a process substitution) or a `.gz` compressed file. |
21 | 34 |
|
22 | 35 | For outputs, you can select one output file with `-o` (`--output`) or two output files with `-1` and `-2` (`--output` and `--output2`). If no output is provided, IRMA-core will output the subsampled data to `stdout`. |
23 | 36 |
|
|
0 commit comments