File tree 3 files changed +17
-8
lines changed
3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -404,12 +404,11 @@ of the reads.
404
404
405
405
##### ` -s ` , ` --seed `
406
406
407
- This option allows you to specify the [ random seed] [ seed ] used by the random subsampler.
408
- By explicitly setting this parameter, you make the subsample for the input reproducible.
409
- The seed is an integer, and by default it is not set, meaning the operating system will
410
- seed the random subsampler. You should only pass this parameter if you are likely to
411
- want to subsample the same input file again in the future and want the same subset of
412
- reads.
407
+ This option allows you to specify the [ random seed] [ seed ] used by the random subsampler. By explicitly setting this
408
+ parameter, you make the subsample for the input reproducible. You only need to pass this parameter if you are likely
409
+ to want to subsample the same input file again in the future and want the same subset of reads. However, if you forget
410
+ to use this option, the seed generated by the system will be printed to the log output, allowing you to use it in the
411
+ future.
413
412
414
413
#### Verbosity
415
414
Original file line number Diff line number Diff line change @@ -55,7 +55,11 @@ impl Runner for Alignment {
55
55
56
56
let mut rng = match self . seed {
57
57
Some ( s) => rand_pcg:: Pcg64 :: seed_from_u64 ( s) ,
58
- None => rand_pcg:: Pcg64 :: seed_from_u64 ( random ( ) ) ,
58
+ None => {
59
+ let seed = random ( ) ;
60
+ info ! ( "Using seed: {}" , seed) ;
61
+ rand_pcg:: Pcg64 :: seed_from_u64 ( seed)
62
+ }
59
63
} ;
60
64
61
65
let mut reader =
Original file line number Diff line number Diff line change
1
+ use log:: info;
1
2
use rand:: prelude:: * ;
2
3
3
4
/// A `Struct` for dealing with the randomised part of sub-sampling.
@@ -39,9 +40,14 @@ impl SubSampler {
39
40
/// ```
40
41
fn shuffled_indices < T > ( & self , v : & [ T ] ) -> Vec < u32 > {
41
42
let mut indices: Vec < u32 > = ( 0 ..v. len ( ) as u32 ) . collect ( ) ;
43
+
42
44
let mut rng = match self . seed {
43
45
Some ( s) => rand_pcg:: Pcg64 :: seed_from_u64 ( s) ,
44
- None => rand_pcg:: Pcg64 :: seed_from_u64 ( random ( ) ) ,
46
+ None => {
47
+ let seed = random ( ) ;
48
+ info ! ( "Using seed: {}" , seed) ;
49
+ rand_pcg:: Pcg64 :: seed_from_u64 ( seed)
50
+ }
45
51
} ;
46
52
47
53
indices. shuffle ( & mut rng) ;
You can’t perform that action at this time.
0 commit comments