metameq 2026.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. metameq-2026.1.1/.gitattributes +1 -0
  2. metameq-2026.1.1/.github/workflows/main.yaml +44 -0
  3. metameq-2026.1.1/.gitignore +166 -0
  4. metameq-2026.1.1/PKG-INFO +21 -0
  5. metameq-2026.1.1/README.md +172 -0
  6. metameq-2026.1.1/assets/metameq.png +0 -0
  7. metameq-2026.1.1/assets/metameq_dark.svg +30 -0
  8. metameq-2026.1.1/assets/metameq_light.svg +23 -0
  9. metameq-2026.1.1/assets/metameq_medium.png +0 -0
  10. metameq-2026.1.1/environment.yml +14 -0
  11. metameq-2026.1.1/metameq/__init__.py +42 -0
  12. metameq-2026.1.1/metameq/_version.py +21 -0
  13. metameq-2026.1.1/metameq/config/__init__.py +0 -0
  14. metameq-2026.1.1/metameq/config/config.yml +3 -0
  15. metameq-2026.1.1/metameq/config/standards.yml +1648 -0
  16. metameq-2026.1.1/metameq/src/__init__.py +0 -0
  17. metameq-2026.1.1/metameq/src/__main__.py +34 -0
  18. metameq-2026.1.1/metameq/src/metadata_configurator.py +512 -0
  19. metameq-2026.1.1/metameq/src/metadata_extender.py +1168 -0
  20. metameq-2026.1.1/metameq/src/metadata_merger.py +362 -0
  21. metameq-2026.1.1/metameq/src/metadata_transformers.py +335 -0
  22. metameq-2026.1.1/metameq/src/metadata_validator.py +387 -0
  23. metameq-2026.1.1/metameq/src/util.py +299 -0
  24. metameq-2026.1.1/metameq/tests/__init__.py +0 -0
  25. metameq-2026.1.1/metameq/tests/data/invalid.yml +1 -0
  26. metameq-2026.1.1/metameq/tests/data/test_config.yml +9 -0
  27. metameq-2026.1.1/metameq/tests/test_metadata_configurator.py +2334 -0
  28. metameq-2026.1.1/metameq/tests/test_metadata_extender.py +2610 -0
  29. metameq-2026.1.1/metameq/tests/test_metadata_merger.py +657 -0
  30. metameq-2026.1.1/metameq/tests/test_metadata_transformers.py +277 -0
  31. metameq-2026.1.1/metameq/tests/test_metadata_validator.py +1191 -0
  32. metameq-2026.1.1/metameq/tests/test_util.py +436 -0
  33. metameq-2026.1.1/metameq.egg-info/PKG-INFO +21 -0
  34. metameq-2026.1.1/metameq.egg-info/SOURCES.txt +40 -0
  35. metameq-2026.1.1/metameq.egg-info/dependency_links.txt +1 -0
  36. metameq-2026.1.1/metameq.egg-info/entry_points.txt +2 -0
  37. metameq-2026.1.1/metameq.egg-info/requires.txt +4 -0
  38. metameq-2026.1.1/metameq.egg-info/top_level.txt +1 -0
  39. metameq-2026.1.1/setup.cfg +12 -0
  40. metameq-2026.1.1/setup.py +37 -0
  41. metameq-2026.1.1/versioneer.py +2277 -0
@@ -0,0 +1 @@
1
+ metameq/_version.py export-subst
@@ -0,0 +1,44 @@
1
+ name: Continuous integration unit testing and lint
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+ strategy:
8
+ matrix:
9
+ python-version: ['3.9', '3.10']
10
+ os: [ubuntu-latest]
11
+ runs-on: ${{ matrix.os }}
12
+ defaults:
13
+ run:
14
+ shell: bash -el {0}
15
+
16
+ steps:
17
+ - name: Check out repository
18
+ uses: actions/checkout@v3
19
+
20
+ - name: Set up Conda
21
+ uses: conda-incubator/setup-miniconda@v2
22
+ with:
23
+ auto-update-conda: true
24
+
25
+ - name: Install conda environment
26
+ run: |
27
+ conda env create -n metameq -f environment.yml
28
+
29
+ - name: Test with pytest
30
+ run: |
31
+ conda activate metameq
32
+ conda install pytest
33
+ which python
34
+ pip install -e . --no-deps
35
+ pytest
36
+
37
+ - name: Lint with flake8
38
+ run: |
39
+ conda activate metameq
40
+ conda install flake8
41
+ # stop the build if there are Python syntax errors or undefined names
42
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
43
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
44
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
@@ -0,0 +1,166 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ .idea/
161
+
162
+ # mac OS
163
+ .DS_Store
164
+
165
+ # VS Code
166
+ .vscode/
@@ -0,0 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: metameq
3
+ Version: 2026.1.1
4
+ Summary: Qiita-compliant metadata generation and validation tool
5
+ Home-page: https://github.com/AmandaBirmingham/metameq
6
+ Author: Amanda Birmingham
7
+ Author-email: abirmingham@ucsd.edu
8
+ License: BSD-3-Clause
9
+ Requires-Dist: click>=8.0.0
10
+ Requires-Dist: pandas>=1.3.0
11
+ Requires-Dist: PyYAML>=5.4.0
12
+ Requires-Dist: Cerberus>=1.3.4
13
+ Dynamic: author
14
+ Dynamic: author-email
15
+ Dynamic: description
16
+ Dynamic: home-page
17
+ Dynamic: license
18
+ Dynamic: requires-dist
19
+ Dynamic: summary
20
+
21
+ METAMEQ: Metadata Extension Tool to Annotate Microbiome Experiments for Qiita, a tool for generating and validating Qiita-compliant metadata files.
@@ -0,0 +1,172 @@
1
+ <picture>
2
+ <source media="(prefers-color-scheme: dark)" srcset="assets/metameq_dark.svg">
3
+ <source media="(prefers-color-scheme: light)" srcset="assets/metameq_light.svg">
4
+ <img alt="METAMEQ logo" src="assets/metameq_medium.png" width="400">
5
+ </picture>
6
+
7
+ ### Metadata Extension Tool to Annotate Microbiome Experiments for Qiita
8
+
9
+ A python tool to extend an existing tabular metadata file by inferring and adding
10
+ the standard annotation columns required for submission to [Qiita](https://qiita.ucsd.edu/) and [EBI](https://www.ebi.ac.uk/).
11
+
12
+ ## Table of Contents
13
+
14
+ - [Overview](#overview)
15
+ - [Installation](#installation)
16
+ - [Basic Usage](#basic-usage)
17
+ - [API Usage](#api-usage)
18
+
19
+ ## Overview
20
+
21
+ METAMEQ (pronounced “meta-mek”) is a Python-based tool designed to help researchers effortlessly generate standards-compliant microbiome sample metadata. Many data collection standards require specific metadata columns and controlled vocabulary values, which can be time-consuming to assemble manually. METAMEQ streamlines this process by letting users annotate their existing tabular metadata with just two shorthand columns: `hosttype_shorthand` (e.g., human, mouse, non-saline water, etc) and `sampletype_shorthand` (e.g., skin, saliva, feces, wastewater, etc). Once the annotated file is loaded into METAMEQ, the tool automatically expands these shorthand entries into the full set of standardized metadata fields required by multiple community standards, outputting a ready-to-use, enriched metadata file suitable for submission to Qiita and/or EBI. This helps ensure interoperability, reproducibility, and compliance with data sharing best practices.
22
+
23
+ ## Installation
24
+
25
+ To install this package, first clone the repository from GitHub:
26
+
27
+ ```
28
+ git clone https://github.com/biocore/metameq.git
29
+ ```
30
+
31
+ Change directory into the new `metameq` folder and create a
32
+ Python3 Conda environment in which to run the software:
33
+
34
+ ```
35
+ conda env create -n metameq -f environment.yml
36
+ ```
37
+
38
+ Activate the Conda environment and install the package:
39
+
40
+ ```
41
+ conda activate metameq
42
+ pip install -e .
43
+ ```
44
+
45
+ ## Basic Usage
46
+
47
+ METAMEQ is run from the command line using the `metameq` command:
48
+
49
+ ```bash
50
+ metameq write-extended-metadata METADATA_FILE CONFIG_FILE NAME_BASE [OPTIONS]
51
+ ```
52
+
53
+ ### Required Inputs
54
+
55
+ 1. **METADATA_FILE**: Path to your input metadata file containing sample information
56
+ - Accepted formats: `.csv`, `.txt`, or `.xlsx`
57
+ - Must include columns for `sample_name`, `hosttype_shorthand`, and `sampletype_shorthand`
58
+
59
+ 2. **CONFIG_FILE**: Path to your study-specific configuration YAML file
60
+ - Defines study-specific settings like default values and transformation rules
61
+ - See `config.yml` for an example configuration
62
+
63
+ 3. **NAME_BASE**: Base name suffix for output files
64
+ - Used to generate output filenames, which will be <timestamp>_<basename>.<extension> (e.g., "2024-05-16_09-46-19_mymetadata.csv" for the name base "mymetadata")
65
+
66
+ ### Optional Parameters
67
+
68
+ - `--out_dir`: Output directory for generated files (default: current directory)
69
+ - `--sep`: Separator character for text output files. If ",", the output will be a `.csv` file, and if "\t" the output will be `.txt` file. "\t" is the default
70
+ - `--suppress_fails_files`: Suppress empty QC and validation error files (default: outputs empty files even when no errors found)
71
+
72
+ ### Example
73
+
74
+ ```bash
75
+ metameq write-extended-metadata my_samples.xlsx config.yml my_study_name --out_dir ./output
76
+ ```
77
+
78
+ This command will:
79
+ - Read sample metadata from `my_samples.xlsx`
80
+ - Apply configurations from `config.yml`
81
+ - Generate extended metadata files with standardized fields based on host and sample types
82
+ - Output validation results and QC reports
83
+ - Save all outputs to the `./output` directory with the suffix `my_study_name`
84
+
85
+ ## API Usage
86
+
87
+ METAMEQ can also be imported and used as a Python library within your own code. This is useful for integrating metadata extension into custom workflows or pipelines.
88
+
89
+ ### Core Functions
90
+
91
+ The primary functions for programmatic use are:
92
+
93
+ - **`write_extended_metadata_from_df`**: Extend metadata from a pandas DataFrame and write results to files
94
+ - **`get_extended_metadata_from_df_and_yaml`**: Extend metadata and return DataFrames without writing to disk
95
+ - **`extract_config_dict`**: Load and extract configuration from YAML files
96
+
97
+ ### Basic API Example
98
+
99
+ ```python
100
+ import pandas as pd
101
+ from metameq import (
102
+ write_extended_metadata_from_df,
103
+ extract_config_dict,
104
+ HOSTTYPE_SHORTHAND_KEY,
105
+ SAMPLETYPE_SHORTHAND_KEY
106
+ )
107
+
108
+ # Load your raw metadata into a DataFrame
109
+ raw_metadata_df = pd.read_csv("my_samples.csv")
110
+
111
+ # Ensure required columns exist
112
+ raw_metadata_df[HOSTTYPE_SHORTHAND_KEY] = "human"
113
+ raw_metadata_df[SAMPLETYPE_SHORTHAND_KEY] = "stool"
114
+
115
+ # Load configuration
116
+ config_dict = extract_config_dict("config.yml")
117
+
118
+ # Extend metadata and write output files
119
+ extended_df = write_extended_metadata_from_df(
120
+ raw_metadata_df,
121
+ config_dict,
122
+ out_dir="./output",
123
+ out_name_base="my_study"
124
+ )
125
+ ```
126
+
127
+ ### Advanced: Custom Transformers
128
+
129
+ You can define custom transformation functions for study-specific data processing:
130
+
131
+ ```python
132
+ from metameq import transform_date_to_formatted_date
133
+
134
+ def custom_date_transformer(row, source_fields):
135
+ """Custom function to handle date formatting based on sample type."""
136
+ if row[HOSTTYPE_SHORTHAND_KEY] == "control":
137
+ return row["extraction_date"]
138
+ else:
139
+ return transform_date_to_formatted_date(row, source_fields)
140
+
141
+ # Pass custom transformers as a dictionary
142
+ transformers = {
143
+ "custom_date_transformer": custom_date_transformer
144
+ }
145
+
146
+ extended_df = write_extended_metadata_from_df(
147
+ raw_metadata_df,
148
+ config_dict,
149
+ out_dir="./output",
150
+ out_name_base="my_study",
151
+ study_specific_transformers_dict=transformers
152
+ )
153
+ ```
154
+
155
+ ### Available Utility Functions
156
+
157
+ METAMEQ exports several utility functions for data handling:
158
+
159
+ - **Metadata merging**: `merge_sample_and_subject_metadata`, `merge_many_to_one_metadata`, `merge_one_to_one_metadata`
160
+ - **File loading**: `load_df_with_best_fit_encoding`
161
+ - **Data transformers**: `transform_input_sex_to_std_sex`, `transform_age_to_life_stage`, `format_a_datetime`
162
+ - **Validation**: `get_qc_failures`, `id_missing_cols`, `find_standard_cols`, `find_nonstandard_cols`
163
+
164
+ ### Key Constants
165
+
166
+ METAMEQ provides constants for required column names:
167
+
168
+ - `HOSTTYPE_SHORTHAND_KEY`: Column name for host type classification
169
+ - `SAMPLETYPE_SHORTHAND_KEY`: Column name for sample type classification
170
+ - `SAMPLE_NAME_KEY`: Column name for sample identifiers
171
+ - `HOST_SUBJECT_ID_KEY`: Column name for subject identifiers
172
+ - `QC_NOTE_KEY`: Column name for quality control notes
Binary file
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 257.68 100.13">
3
+ <defs>
4
+ <style>
5
+ .cls-1 {
6
+ fill: #fff;
7
+ }
8
+ </style>
9
+ </defs>
10
+ <g id="Layer_2-2" data-name="Layer 2">
11
+ <g id="xm3ggt">
12
+ <g>
13
+ <path class="cls-1" d="M127.69,30.25l8.8.31,8.16,24.01.65-.79,8.61-23.37c.53.24,1.2-.16,1.46-.16h6.4l.48.48v39.84c-2.26-.47-4.97-.54-7.21-.04l-.32-.28.17-23.68c-.93-.16-.52.22-.68.74-1.34,4.42-4.33,15.61-6.62,19-.94,1.39-2.11,1.25-3.76,1.08-1.07-.11-1.26-.06-1.81-1.07-2.79-5.19-4.28-13.34-6.57-19.04-.2-.49.19-.86-.72-.7v24h-6.88l-.41-.48c0-.13.25-.24.25-.32V30.25Z"/>
14
+ <g>
15
+ <path class="cls-1" d="M204.49,2.09l-.34,9.58c-1.86.21-3.69.57-5.49,1.07-1.41.39-6.64,2.54-7.44,2.47-1.95-.19-5.1-5.54-6.04-5.39l-8.08,5.71c-.33.34,0,.55.15.82.92,1.7,4.67,4.88,4.51,6.67-.22,2.38-3.4,4.51-5.76,3.71.63-1.14,3.02-3.01,2.89-4.31-.06-.58-3.32-3.69-3.98-4.68-.96-1.44-1.76-2-.26-3.49,1.86-1.85,6.39-5.23,8.67-6.6,2.58-1.56,2.61-.93,4.85,1,1.35,1.16,2.72,3.61,4.61,3.36,1.5-1.14,7.08-1.59,8.03-2.56s.28-7.8,2.08-9.44l12.91.23c1.74.51,1.58,7.5,1.85,9.19,2.13-.27,7.6,2.98,9.05,2.83,1.91-.2,4.52-6.23,7.33-5.63,2.19.47,7.6,6.98,9.97,8.28,2.09,2.57-3.83,5.99-4.27,8.4,1.18,1.37,2.57,2.61,3.62,4.09.47.67,1.89,3.53,2.1,3.65,1.46.89,7.98-1.64,9.31-.03.35.43,2.62,9.56,2.77,10.67.13.93.41,2.65-.42,3.25-1.23.89-7.45,1.83-7.77,2.79l-.31,10.31c1.44.8,7.54,3.42,7.61,5l-4.82,12.14c-1.52,1.95-6.69-1.42-8.7-1.36-2.19,2.73-3.88,5.77-6.55,8.11l12.08,13.6c-3.23,1.38-6.51,3.82-10.12,4.13-3.14.28-7.63-1.66-10.05-3.65-1.48-1.21-3.95-4.55-5.26-5.3-1.52-.88-6.6.59-8.42,1.05-.71,1.35-.6,6.96-1.57,7.63-1.26.86-8.96.8-10.84.63-4.04-.36-2.61-6.05-3.42-9.06-.43-1.62-2.91-1.41-4.47-1.93-1.34-.44-2.54-1.23-3.92-1.52-1.08.11-3.82,5.16-6.04,5.04-2.5-.14-7.63-5.57-10.13-6.78-.24-.27-.52-.65-.56-1.01-.06-.6,4.84-10.53,5.35-10.86s1.32.3,1.57.7c1.2,1.9-.51,3.95-1.43,5.54-.51.87-2.73,3.41-2.23,4.19l7.7,5.12c1.15,0,3.53-4.51,5.13-4.8,2.65-.49,8.03,3.83,11.35,2.88.42,2.94.11,6.25.64,9.12.07.37.1.65.52.76l8.75.04c.28-1.55.63-6.9,1.6-7.84.45-.43,8.92-2.45,9.75-2.39,1.75.13,5.11,4.33,6.57,5.59,3.13,2.73,5.95,4.59,10.38,3.97.74-.1,4.84-1.55,4.66-2.35l-11.8-12.46c1.53-1.69,3.42-2.97,4.94-4.68.96-1.08,4.36-6.3,4.96-6.57,1.56-.71,7.47,2.51,8,2.27.38-.3.58-.71.79-1.14.33-.68,2.73-7.14,2.72-7.54,0-.34-.12-.41-.32-.63-.92-.98-5.31-2.43-6.58-3.66-.35-.34-.5-.63-.48-1.12l.81-12.98c.4-.81,6.55-2.51,7.85-2.56l-2.24-10.56-9.29,1.15c-.55-1.43-1.18-2.82-1.97-4.13-.96-1.59-4.21-4.84-4.41-6.17-.48-3.17,4.47-5.82,4.48-7.02l-7.89-7.5-6.67,6.37c-1.97-1.65-10.94-3.48-11.77-5.19-1.07-2.2-.18-5.81-.88-8.24h-9.92Z"/>
16
+ <path class="cls-1" d="M222.41,75.05c-1.68.28-4.16,1.94-5.83,1.54-1.5-.36-5.65-5.13-7.27-6.16-15.95,1.5-16.45-16.74-14.7-28.14,2.39-15.59,23.78-16.49,27.39-2.18,1.14,4.5,1.19,15.08.33,19.66-.77,4.08-2.98,7.3-6.31,9.69l6.39,5.6ZM207.62,36.73c-2.77.33-4.43,1.74-5.21,4.4-.87,2.99-.78,12.77-.47,16.16.27,2.98,1.71,6.09,4.98,6.54,3.56.49,6.72-.34,7.72-4.07,1.11-4.15.84-12.47.41-16.86-.4-4.04-3.33-6.65-7.43-6.16Z"/>
17
+ <path class="cls-1" d="M176.65,37.61v9.6h10.88v6.4h-10.88v9.44c0,.1-.41.25-.32.48h14.72v6.72h-21.76V30.25l20.59.03.54.77c-.83,2.16.57,4.62-.81,6.56h-12.96Z"/>
18
+ <path class="cls-1" d="M224.02,71.85c-.12-.53.17-.65.48-.95,2.29-2.23,4.12-3.76,5.85-6.63,12.03-19.85-6.2-45.9-28.91-38.51-1.2.39-5.75,2.9-6.08,2.9-.77-.02-1.04-1.2-1.35-1.77,12.51-9.18,29.91-4.84,38.14,7.87,6.76,10.45,5.91,24.82-2.06,34.37-1.57,1.88-3.55,4.38-6.07,2.73Z"/>
19
+ <path class="cls-1" d="M212.49,77.93c-3.59.62-7.67.69-11.26-.09-1.32-.29-7.63-2.47-8.11-3.43-.2-.4-.16-.62-.09-1.04.03-.2.56-1.99,1.07-1.85,3.18,2.11,6.8,3.59,10.6,4.13,2.62.37,6.13-.46,7.8,2.28Z"/>
20
+ </g>
21
+ <path class="cls-1" d="M92.33,70.57l10.44-39.82.43-.39,8.61-.07,11.41,40.29-7.7-.15-2.42-7.81-11.12-.06-2.12,8.02h-7.52ZM111.69,55.53l-4-15.36-4.32,15.36h8.32Z"/>
22
+ <g>
23
+ <path class="cls-1" d="M0,30.25l8.48.31,8.65,24.34,8.81-24.65c2.8.62,5.81.36,8.63,0v40.32c-1.2-.17-2.81-.36-4-.35s-2.7.96-3.68-.13v-22.4c0-.32.83-.67-.32-.48-1.71,5.14-3.16,10.48-5.12,15.53-1.32,3.4-1.32,5.23-5.62,4.65-1.38-.19-1.71-1.42-2.22-2.58-2.25-5.18-3.74-11.69-5.6-17.12-.12-.36-.18-1.16-.64-1.11v23.52c-2.13,1.46-5.06-.6-7.36.48V30.25Z"/>
24
+ <path class="cls-1" d="M62.4,37.61h-12.32c-.11,0-.35-.57-.8.16v9.44h10.88v6.4h-10.88v9.92h14.08v6.72h-21.76V30.73c0-.95,2.77-.17,3.35-.15,5.07.16,10.07-.34,15.07-.34.65,0,1.96.07,2.39.49v6.88Z"/>
25
+ <path class="cls-1" d="M92.49,30.25v7.04h-8.96v32.8l-.48.48h-6.88v-33.28h-9.28v-6.56c.28-.46.64-.44,1.1-.5,1.62-.19,4.06-.01,5.79,0,5.61.06,11.32.43,16.94.35.6,0,1.16-.41,1.77-.34Z"/>
26
+ </g>
27
+ </g>
28
+ </g>
29
+ </g>
30
+ </svg>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 257.68 100.13">
3
+ <g id="Layer_2-2" data-name="Layer 2">
4
+ <g id="xm3ggt">
5
+ <g>
6
+ <path d="M127.69,30.25l8.8.31,8.16,24.01.65-.79,8.61-23.37c.53.24,1.2-.16,1.46-.16h6.4l.48.48v39.84c-2.26-.47-4.97-.54-7.21-.04l-.32-.28.17-23.68c-.93-.16-.52.22-.68.74-1.34,4.42-4.33,15.61-6.62,19-.94,1.39-2.11,1.25-3.76,1.08-1.07-.11-1.26-.06-1.81-1.07-2.79-5.19-4.28-13.34-6.57-19.04-.2-.49.19-.86-.72-.7v24h-6.88l-.41-.48c0-.13.25-.24.25-.32V30.25Z"/>
7
+ <g>
8
+ <path d="M204.49,2.09l-.34,9.58c-1.86.21-3.69.57-5.49,1.07-1.41.39-6.64,2.54-7.44,2.47-1.95-.19-5.1-5.54-6.04-5.39l-8.08,5.71c-.33.34,0,.55.15.82.92,1.7,4.67,4.88,4.51,6.67-.22,2.38-3.4,4.51-5.76,3.71.63-1.14,3.02-3.01,2.89-4.31-.06-.58-3.32-3.69-3.98-4.68-.96-1.44-1.76-2-.26-3.49,1.86-1.85,6.39-5.23,8.67-6.6,2.58-1.56,2.61-.93,4.85,1,1.35,1.16,2.72,3.61,4.61,3.36,1.5-1.14,7.08-1.59,8.03-2.56s.28-7.8,2.08-9.44l12.91.23c1.74.51,1.58,7.5,1.85,9.19,2.13-.27,7.6,2.98,9.05,2.83,1.91-.2,4.52-6.23,7.33-5.63,2.19.47,7.6,6.98,9.97,8.28,2.09,2.57-3.83,5.99-4.27,8.4,1.18,1.37,2.57,2.61,3.62,4.09.47.67,1.89,3.53,2.1,3.65,1.46.89,7.98-1.64,9.31-.03.35.43,2.62,9.56,2.77,10.67.13.93.41,2.65-.42,3.25-1.23.89-7.45,1.83-7.77,2.79l-.31,10.31c1.44.8,7.54,3.42,7.61,5l-4.82,12.14c-1.52,1.95-6.69-1.42-8.7-1.36-2.19,2.73-3.88,5.77-6.55,8.11l12.08,13.6c-3.23,1.38-6.51,3.82-10.12,4.13-3.14.28-7.63-1.66-10.05-3.65-1.48-1.21-3.95-4.55-5.26-5.3-1.52-.88-6.6.59-8.42,1.05-.71,1.35-.6,6.96-1.57,7.63-1.26.86-8.96.8-10.84.63-4.04-.36-2.61-6.05-3.42-9.06-.43-1.62-2.91-1.41-4.47-1.93-1.34-.44-2.54-1.23-3.92-1.52-1.08.11-3.82,5.16-6.04,5.04-2.5-.14-7.63-5.57-10.13-6.78-.24-.27-.52-.65-.56-1.01-.06-.6,4.84-10.53,5.35-10.86s1.32.3,1.57.7c1.2,1.9-.51,3.95-1.43,5.54-.51.87-2.73,3.41-2.23,4.19l7.7,5.12c1.15,0,3.53-4.51,5.13-4.8,2.65-.49,8.03,3.83,11.35,2.88.42,2.94.11,6.25.64,9.12.07.37.1.65.52.76l8.75.04c.28-1.55.63-6.9,1.6-7.84.45-.43,8.92-2.45,9.75-2.39,1.75.13,5.11,4.33,6.57,5.59,3.13,2.73,5.95,4.59,10.38,3.97.74-.1,4.84-1.55,4.66-2.35l-11.8-12.46c1.53-1.69,3.42-2.97,4.94-4.68.96-1.08,4.36-6.3,4.96-6.57,1.56-.71,7.47,2.51,8,2.27.38-.3.58-.71.79-1.14.33-.68,2.73-7.14,2.72-7.54,0-.34-.12-.41-.32-.63-.92-.98-5.31-2.43-6.58-3.66-.35-.34-.5-.63-.48-1.12l.81-12.98c.4-.81,6.55-2.51,7.85-2.56l-2.24-10.56-9.29,1.15c-.55-1.43-1.18-2.82-1.97-4.13-.96-1.59-4.21-4.84-4.41-6.17-.48-3.17,4.47-5.82,4.48-7.02l-7.89-7.5-6.67,6.37c-1.97-1.65-10.94-3.48-11.77-5.19-1.07-2.2-.18-5.81-.88-8.24h-9.92Z"/>
9
+ <path d="M222.41,75.05c-1.68.28-4.16,1.94-5.83,1.54-1.5-.36-5.65-5.13-7.27-6.16-15.95,1.5-16.45-16.74-14.7-28.14,2.39-15.59,23.78-16.49,27.39-2.18,1.14,4.5,1.19,15.08.33,19.66-.77,4.08-2.98,7.3-6.31,9.69l6.39,5.6ZM207.62,36.73c-2.77.33-4.43,1.74-5.21,4.4-.87,2.99-.78,12.77-.47,16.16.27,2.98,1.71,6.09,4.98,6.54,3.56.49,6.72-.34,7.72-4.07,1.11-4.15.84-12.47.41-16.86-.4-4.04-3.33-6.65-7.43-6.16Z"/>
10
+ <path d="M176.65,37.61v9.6h10.88v6.4h-10.88v9.44c0,.1-.41.25-.32.48h14.72v6.72h-21.76V30.25l20.59.03.54.77c-.83,2.16.57,4.62-.81,6.56h-12.96Z"/>
11
+ <path d="M224.02,71.85c-.12-.53.17-.65.48-.95,2.29-2.23,4.12-3.76,5.85-6.63,12.03-19.85-6.2-45.9-28.91-38.51-1.2.39-5.75,2.9-6.08,2.9-.77-.02-1.04-1.2-1.35-1.77,12.51-9.18,29.91-4.84,38.14,7.87,6.76,10.45,5.91,24.82-2.06,34.37-1.57,1.88-3.55,4.38-6.07,2.73Z"/>
12
+ <path d="M212.49,77.93c-3.59.62-7.67.69-11.26-.09-1.32-.29-7.63-2.47-8.11-3.43-.2-.4-.16-.62-.09-1.04.03-.2.56-1.99,1.07-1.85,3.18,2.11,6.8,3.59,10.6,4.13,2.62.37,6.13-.46,7.8,2.28Z"/>
13
+ </g>
14
+ <path d="M92.33,70.57l10.44-39.82.43-.39,8.61-.07,11.41,40.29-7.7-.15-2.42-7.81-11.12-.06-2.12,8.02h-7.52ZM111.69,55.53l-4-15.36-4.32,15.36h8.32Z"/>
15
+ <g>
16
+ <path d="M0,30.25l8.48.31,8.65,24.34,8.81-24.65c2.8.62,5.81.36,8.63,0v40.32c-1.2-.17-2.81-.36-4-.35s-2.7.96-3.68-.13v-22.4c0-.32.83-.67-.32-.48-1.71,5.14-3.16,10.48-5.12,15.53-1.32,3.4-1.32,5.23-5.62,4.65-1.38-.19-1.71-1.42-2.22-2.58-2.25-5.18-3.74-11.69-5.6-17.12-.12-.36-.18-1.16-.64-1.11v23.52c-2.13,1.46-5.06-.6-7.36.48V30.25Z"/>
17
+ <path d="M62.4,37.61h-12.32c-.11,0-.35-.57-.8.16v9.44h10.88v6.4h-10.88v9.92h14.08v6.72h-21.76V30.73c0-.95,2.77-.17,3.35-.15,5.07.16,10.07-.34,15.07-.34.65,0,1.96.07,2.39.49v6.88Z"/>
18
+ <path d="M92.49,30.25v7.04h-8.96v32.8l-.48.48h-6.88v-33.28h-9.28v-6.56c.28-.46.64-.44,1.1-.5,1.62-.19,4.06-.01,5.79,0,5.61.06,11.32.43,16.94.35.6,0,1.16-.41,1.77-.34Z"/>
19
+ </g>
20
+ </g>
21
+ </g>
22
+ </g>
23
+ </svg>
@@ -0,0 +1,14 @@
1
+ name: metameq
2
+ channels:
3
+ - defaults
4
+ dependencies:
5
+ # NB: if changing here, also change the setup.py install_requires
6
+ - python
7
+ - click
8
+ - pandas
9
+ - pip
10
+ - pyyaml
11
+ - flake8
12
+ - pep8
13
+ - pip:
14
+ - cerberus
@@ -0,0 +1,42 @@
1
+ from metameq.src.util import HOSTTYPE_SHORTHAND_KEY, SAMPLETYPE_SHORTHAND_KEY, \
2
+ SAMPLE_TYPE_KEY, QC_NOTE_KEY, LEAVE_BLANK_VAL, DO_NOT_USE_VAL, \
3
+ NOT_PROVIDED_VAL, HOST_SUBJECT_ID_KEY, SAMPLE_NAME_KEY, \
4
+ COLLECTION_TIMESTAMP_KEY, METADATA_TRANSFORMERS_KEY, SOURCES_KEY, \
5
+ FUNCTION_KEY, PRE_TRANSFORMERS_KEY, POST_TRANSFORMERS_KEY, \
6
+ extract_config_dict, deepcopy_dict, load_df_with_best_fit_encoding
7
+ from metameq.src.metadata_configurator import build_full_flat_config_dict
8
+ from metameq.src.metadata_extender import \
9
+ write_extended_metadata, write_extended_metadata_from_df, \
10
+ get_reserved_cols, get_extended_metadata_from_df_and_yaml, \
11
+ write_metadata_results, id_missing_cols, find_standard_cols, \
12
+ find_nonstandard_cols, get_qc_failures
13
+ from metameq.src.metadata_merger import merge_sample_and_subject_metadata, \
14
+ merge_many_to_one_metadata, merge_one_to_one_metadata, \
15
+ find_common_col_names, find_common_df_cols
16
+ from metameq.src.metadata_transformers import \
17
+ format_a_datetime, standardize_input_sex, set_life_stage_from_age_yrs, \
18
+ transform_input_sex_to_std_sex, transform_age_to_life_stage, \
19
+ transform_date_to_formatted_date
20
+
21
+ __all__ = ["HOSTTYPE_SHORTHAND_KEY", "SAMPLETYPE_SHORTHAND_KEY",
22
+ "SAMPLE_TYPE_KEY", "QC_NOTE_KEY", "LEAVE_BLANK_VAL",
23
+ "DO_NOT_USE_VAL", "NOT_PROVIDED_VAL",
24
+ "HOST_SUBJECT_ID_KEY", "SAMPLE_NAME_KEY",
25
+ "COLLECTION_TIMESTAMP_KEY", "METADATA_TRANSFORMERS_KEY",
26
+ "SOURCES_KEY", "FUNCTION_KEY", "PRE_TRANSFORMERS_KEY",
27
+ "POST_TRANSFORMERS_KEY",
28
+ "extract_config_dict", "build_full_flat_config_dict",
29
+ "deepcopy_dict", "load_df_with_best_fit_encoding",
30
+ "merge_sample_and_subject_metadata", "merge_many_to_one_metadata",
31
+ "merge_one_to_one_metadata", "find_common_col_names",
32
+ "find_common_df_cols",
33
+ "write_extended_metadata", "get_extended_metadata_from_df_and_yaml",
34
+ "write_extended_metadata_from_df", "write_metadata_results",
35
+ "get_reserved_cols", "id_missing_cols", "find_standard_cols",
36
+ "find_nonstandard_cols", "get_qc_failures",
37
+ "format_a_datetime", "standardize_input_sex",
38
+ "set_life_stage_from_age_yrs", "transform_input_sex_to_std_sex",
39
+ "transform_age_to_life_stage", "transform_date_to_formatted_date"]
40
+
41
+ from . import _version
42
+ __version__ = _version.get_versions()['version']
@@ -0,0 +1,21 @@
1
+
2
+ # This file was generated by 'versioneer.py' (0.29) from
3
+ # revision-control system data, or from the parent directory name of an
4
+ # unpacked source archive. Distribution tarballs contain a pre-generated copy
5
+ # of this file.
6
+
7
+ import json
8
+
9
+ version_json = '''
10
+ {
11
+ "date": "2026-01-28T14:30:42-0800",
12
+ "dirty": false,
13
+ "error": null,
14
+ "full-revisionid": "b60757af0c4b7b16d71119971565d9991779f6d2",
15
+ "version": "2026.01.1"
16
+ }
17
+ ''' # END VERSION_JSON
18
+
19
+
20
+ def get_versions():
21
+ return json.loads(version_json)
File without changes
@@ -0,0 +1,3 @@
1
+ "default": "not applicable"
2
+ "leave_requireds_blank": false
3
+ "overwrite_non_nans": false