Add wrapper scripts to pipe training tensors directly to Tensor2Bin #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This MR adds a wrapper script
CreateTrainingTensor
that callsCreateTensor{Pileup|FullAlignment}
and handles piping the output toTensor2Bin
, in the same way asCallVarBam
does withCallVariants
. Additionally,UnifyRepresentation
similarly callsCreateTensorFullAlignment
and handles the piped output directly.This has the advantage of saving writing and rereading the uncompressed tensors from disk, and allows tensor extraction and compression to run in parallel.
I also add a second script
MergeBin
that simply merges the individual chunk binaries into one, without changing their contents. This is mainly to limit the number of binary files that need to be passed to training.One functional change introduced by this is that non-variant site subsampling is done at a variable rate (though targeting a constant variant:non-variant ratio) determined at the level of chunks of sites of size
shuffle_bin_size
, rather than at a global rate determined over all tensor details files. I have not seen that this significantly affects the resulting output tensors, though in theory the number of non-variant sites included will be sligthly more variable.This should be backwards-compatible with the previous functionality of Tensor2Bin, though I have not extensively tested this.