Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Rename sample-peds, feature-peds, pprs and peds-simulation #111

Merged
merged 36 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
26247f4
renaming all the things
cherman2 Nov 12, 2024
99bc5df
Merge branch 'dev' of https://github.com/qiime2/q2-fmt into finishing…
cherman2 Nov 12, 2024
df54530
Update q2_fmt/_peds.py
cherman2 Nov 13, 2024
a899fc5
Update q2_fmt/_peds.py
cherman2 Nov 13, 2024
5fcd893
Update q2_fmt/_peds.py
cherman2 Nov 13, 2024
eecaca5
Update q2_fmt/_peds.py
cherman2 Nov 13, 2024
57766d3
Update q2_fmt/_peds.py
cherman2 Nov 13, 2024
bc94286
Update q2_fmt/_peds.py
cherman2 Nov 13, 2024
c848fc5
Update q2_fmt/_peds.py
cherman2 Nov 13, 2024
ff0e9bf
Update q2_fmt/plugin_setup.py
cherman2 Nov 13, 2024
4fa4b2e
Update q2_fmt/plugin_setup.py
cherman2 Nov 13, 2024
0a49b3e
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
6223561
Update q2_fmt/plugin_setup.py
cherman2 Nov 13, 2024
dd43bae
Update q2_fmt/plugin_setup.py
cherman2 Nov 13, 2024
36b7dc8
Update q2_fmt/plugin_setup.py
cherman2 Nov 13, 2024
9e98655
Update q2_fmt/plugin_setup.py
cherman2 Nov 13, 2024
f7af34e
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
1489d4b
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
8b0f573
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
a4d02e5
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
1e33f1f
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
94c8abf
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
89ff3c8
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
1b6af9b
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
bf7f32c
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
02f8186
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
1b871e3
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
20abd82
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
0602523
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
5b724ef
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
9d90a22
Update q2_fmt/tests/test_engraftment.py
cherman2 Nov 13, 2024
13849ce
Liz's Review
cherman2 Nov 13, 2024
6b8f1cf
no sample pedf
cherman2 Nov 13, 2024
58ff26d
Update q2_fmt/_peds.py
cherman2 Nov 13, 2024
25bd4c0
Update q2_fmt/_peds.py
cherman2 Nov 13, 2024
cdcf920
lil diff description
cherman2 Nov 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions q2_fmt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
from ._version import get_versions

from ._engraftment import cc, group_timepoints
from ._peds import (sample_peds, feature_peds, peds, heatmap,
peds_simulation, sample_pprs)
from ._peds import (pedf, prdf, heatmap,
pedf_permutation_test, pprf)
from ._ancombc import detect_donor_indicators

__version__ = get_versions()['version']
del get_versions


__all__ = ['cc', 'sample_peds', 'feature_peds',
'peds', 'heatmap', 'group_timepoints', 'peds_simulation',
'sample_pprs', 'detect_donor_indicators']
__all__ = ['cc', 'pedf', 'prdf',
'heatmap', 'group_timepoints', 'pedf_permutation_test',
'pprf', 'detect_donor_indicators']
3 changes: 1 addition & 2 deletions q2_fmt/_ancombc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
import pandas as pd
from qiime2 import Metadata

# TODO: Change Import path.
from q2_fmt._peds import _check_for_time_column, _check_reference_column
from q2_fmt._util import _check_for_time_column, _check_reference_column


def detect_donor_indicators(ctx, table, reference_column, time_column,
Expand Down
98 changes: 35 additions & 63 deletions q2_fmt/_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@

import qiime2

from qiime2.plugin.util import transform

from q2_stats.types import TabularDataResourceDirFmt


def _get_data_from_tests(path):
return pkg_resources.resource_filename('q2_fmt.tests',
Expand Down Expand Up @@ -59,15 +55,15 @@ def feature_table_factory():
)


def peds_md_factory():
def pedf_md_factory():
return qiime2.Metadata.load(
_get_data_from_tests('md-peds-usage.txt')
)


def peds_dist_factory():
def pedf_dist_factory():
return qiime2.Artifact.import_data(
"Dist1D[Ordered, Matched] % Properties('peds')",
"Dist1D[Ordered, Matched] % Properties('pedf')",
_get_data_from_tests('peds_dist.table.jsonl')
)

Expand Down Expand Up @@ -152,12 +148,12 @@ def cc_baseline(use):
raincloud.assert_output_type('Visualization')


def peds_method(use):
md = use.init_metadata('md', peds_md_factory)
def pedf_method(use):
md = use.init_metadata('md', pedf_md_factory)
table = use.init_artifact('table', feature_table_factory)

peds_group_dists, = use.action(
use.UsageAction('fmt', 'sample_peds'),
pedf_group_dists, = use.action(
use.UsageAction('fmt', 'pedf'),
use.UsageInputs(
table=table,
metadata=md,
Expand All @@ -166,21 +162,21 @@ def peds_method(use):
subject_column='SubjectID'
),
use.UsageOutputNames(
peds_dists='peds_dist'
pedf_dists='pedf_dist'
)

)

peds_group_dists.assert_output_type("Dist1D[Ordered, Matched] %"
" Properties('peds')")
pedf_group_dists.assert_output_type("Dist1D[Ordered, Matched] %"
" Properties('pedf')")


def feature_peds_method(use):
md = use.init_metadata('md', peds_md_factory)
def prdf_method(use):
md = use.init_metadata('md', pedf_md_factory)
table = use.init_artifact('table', feature_table_factory)

peds_group_dists, = use.action(
use.UsageAction('fmt', 'feature_peds'),
prdf_group_dists, = use.action(
use.UsageAction('fmt', 'prdf'),
use.UsageInputs(
table=table,
metadata=md,
Expand All @@ -189,62 +185,38 @@ def feature_peds_method(use):
subject_column='SubjectID'
),
use.UsageOutputNames(
peds_dists='peds_dist'
prdf_dists='prdf_dist'
)

)

peds_group_dists.assert_output_type("Dist1D[Ordered, Matched] %"
" Properties('peds')")


# PEDS pipeline
def peds_pipeline_sample(use):
md = use.init_metadata('md', peds_md_factory)
table = use.init_artifact('table', feature_table_factory)

peds_heatmap, = use.action(
use.UsageAction('fmt', 'peds'),
use.UsageInputs(
table=table,
metadata=md,
peds_metric='sample',
time_column='time_point',
reference_column='Donor',
subject_column='SubjectID'
),
use.UsageOutputNames(
heatmap='heatmap',

)
)

peds_heatmap.assert_output_type('Visualization')
prdf_group_dists.assert_output_type("Dist1D[Ordered, Matched] %"
" Properties('prdf')")


def heatmap(use):
peds_dist = use.init_artifact('peds_dist', peds_dist_factory)
pedf_dist = use.init_artifact('pedf_dist', pedf_dist_factory)

peds_heatmap, = use.action(
pedf_heatmap, = use.action(
use.UsageAction('fmt', 'heatmap'),
use.UsageInputs(
data=peds_dist,
data=pedf_dist,
),
use.UsageOutputNames(
visualization='heatmap',

)
)

peds_heatmap.assert_output_type('Visualization')
pedf_heatmap.assert_output_type('Visualization')


def simulation_peds_method(use):
md = use.init_metadata('md', peds_md_factory)
def perm_pedf_method(use):
md = use.init_metadata('md', pedf_md_factory)
table = use.init_artifact('table', feature_table_factory)

actual_sample_peds, peds_stats, global_stats = use.action(
use.UsageAction('fmt', 'peds_simulation'),
actual_sample_pedf, pedf_stats, global_stats = use.action(
use.UsageAction('fmt', 'pedf_permutation_test'),
use.UsageInputs(
table=table,
metadata=md,
Expand All @@ -255,23 +227,23 @@ def simulation_peds_method(use):
sampling_depth=400
),
use.UsageOutputNames(
actual_sample_peds='actual_sample_peds',
actual_sample_pedf='actual_sample_pedf',
per_subject_stats='per_subject_stats',
global_stats='global_stats'
)

)

peds_stats.assert_output_type("StatsTable[Pairwise]")
pedf_stats.assert_output_type("StatsTable[Pairwise]")
global_stats.assert_output_type("StatsTable[Pairwise]")


def pprs_method(use):
md = use.init_metadata('md', peds_md_factory)
def pprf_method(use):
md = use.init_metadata('md', pedf_md_factory)
table = use.init_artifact('table', feature_table_factory)

pprs_group_dists, = use.action(
use.UsageAction('fmt', 'sample_pprs'),
pprf_group_dists, = use.action(
use.UsageAction('fmt', 'pprf'),
use.UsageInputs(
table=table,
metadata=md,
Expand All @@ -281,17 +253,17 @@ def pprs_method(use):
filter_missing_references=False
),
use.UsageOutputNames(
pprs_dists='pprs_dist'
pprf_dists='pprf_dist'
)

)

pprs_group_dists.assert_output_type("Dist1D[Ordered, Matched] %"
" Properties('pprs')")
pprf_group_dists.assert_output_type("Dist1D[Ordered, Matched] %"
" Properties('pprf')")


def detect_donor_indicators_method(use):
md = use.init_metadata('md', peds_md_factory)
md = use.init_metadata('md', pedf_md_factory)
table = use.init_artifact('table', feature_table_factory)

differentials, da_barplot = use.action(
Expand Down
Loading
Loading