Skip to content

Commit

Permalink
Merge pull request #36 from sfiligoi/multi_230320
Browse files Browse the repository at this point in the history
Add multi mode
  • Loading branch information
sfiligoi authored Mar 22, 2023
2 parents c64c65f + 9d200d3 commit b172545
Show file tree
Hide file tree
Showing 8 changed files with 698 additions and 117 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ jobs:
python compare_unifrac_stats.py t1.h5 5 999 1.001112 0.456 0.001 0.1
ls -l t1.h5
rm -f t1.h5
time ssu -m unweighted -i test500.biom -t test500.tre --pcoa 4 -r hdf5 --permanova 99 -g test500.tsv -c empo_2 -o t1.h5
python compare_unifrac_stats.py t1.h5 5 99 1.001112 0.456 0.001 0.2
ls -l t1.h5
rm -f t1.h5
time ssu -m weighted_unnormalized_fp32 -i test500.biom -t test500.tre --pcoa 4 -r hdf5_nodist -g test500.tsv -c empo_3 -o t1.h5
# compare to values given by skbio.stats.distance.permanova
python compare_unifrac_stats.py t1.h5 17 999 0.890697 0.865 0.001 0.1
Expand Down Expand Up @@ -181,6 +185,25 @@ jobs:
ls -l t1.h5
rm -f t1.h5
rm -f t1.partial.*
# subsample
echo "subsample"
time ssu -f -m unweighted -i test500.biom -t test500.tre --pcoa 4 -r hdf5_fp32 --subsample-depth 100 -o t1.h5
./compare_unifrac_pcoa.py test500.unweighted_fp32.f.h5 t1.h5 3 0.3
rm -f t1.h5
time ssu -m unweighted -i test500.biom -t test500.tre --pcoa 4 -r hdf5_nodist --permanova 99 -g test500.tsv -c empo_2 --subsample-depth 100 -o t1.h5
python compare_unifrac_stats.py t1.h5 5 99 1.001112 0.456 0.05 0.5
ls -l t1.h5
rm -f t1.h5
# multi
echo "multi"
time ssu -f -m unweighted -i test500.biom -t test500.tre --pcoa 4 --mode multi --subsample-depth 100 --n-subsamples 10 -o t1.h5
./compare_unifrac_pcoa_multi.py test500.unweighted_fp32.f.h5 t1.h5 10 3 0.3
ls -l t1.h5
rm -f t1.h5
time ssu -m unweighted -i test500.biom -t test500.tre --pcoa 4 --mode multi --n-subsamples 10 --permanova 99 -g test500.tsv -c empo_2 --subsample-depth 100 -o t1.h5
python compare_unifrac_stats_multi.py t1.h5 10 5 99 1.001112 0.456 0.08 0.5
ls -l t1.h5
rm -f t1.h5
popd
- name: Sanity checks
shell: bash -l {0}
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,21 @@ The methods can be used directly through the command line after install:
partial : Compute UniFrac over a subset of stripes.
partial-report : Start and stop suggestions for partial compute.
merge-partial : Merge partial UniFrac results.
multi : compute UniFrac multiple times.
--start [OPTIONAL] If mode==partial, the starting stripe.
--stop [OPTIONAL] If mode==partial, the stopping stripe.
--partial-pattern [OPTIONAL] If mode==merge-partial, a glob pattern for partial outputs to merge.
--n-partials [OPTIONAL] If mode==partial-report, the number of partitions to compute.
--report-bare [OPTIONAL] If mode==partial-report, produce barebones output.
--n-substeps [OPTIONAL] Internally split the problem in n substeps for reduced memory footprint, default is 1.
--format|-r [OPTIONAL] Output format:
ascii : [DEFAULT] Original ASCII format.
ascii : Original ASCII format. (default if mode==one-off)
hdf5_nodist : HFD5 format, no distance matrix. (default if mode==multi)
hdf5 : HFD5 format. May be fp32 or fp64, depending on method.
hdf5_fp32 : HFD5 format, using fp32 precision.
hdf5_fp64 : HFD5 format, using fp64 precision.
hdf5_nodist : HFD5 format, no distance matrix, just PCoA.
--subsample-depth [OPTIONAL] Depth of subsampling of the input BIOM before computing unifrac
--subsample-depth Depth of subsampling of the input BIOM before computing unifrac (required for mode==multi, optional for one-off)
--n-subsamples [OPTIONAL] if mode==multi, number of subsampled UniFracs to compute (default: 100)
--permanova [OPTIONAL] Number of PERMANOVA permutations to compute (default: 999 with -g, do not compute if 0)
--pcoa [OPTIONAL] Number of PCoA dimensions to compute (default: 10, do not compute if 0)
--seed [OPTIONAL] Seed to use for initializing the random gnerator
Expand Down
Loading

0 comments on commit b172545

Please sign in to comment.