mutts 1.0.3__py3-none-any.whl → 1.0.5__py3-none-any.whl

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.
mutts/cli.py CHANGED
@@ -107,11 +107,13 @@ def cli(
107
107
  # Write the generated data to 'DATA SHEET'
108
108
  user_facility_spreadsheet.to_excel(writer, index=False, sheet_name='DATA SHEET')
109
109
 
110
- # Check if mapper is one of the v15 JGI templates
110
+ # Check if mapper is one of the v15 or v16 JGI templates
111
111
  mapper_basename = os.path.basename(mapper)
112
112
  jgi_v15_mappers = ['jgi_mg_header_v15.json', 'jgi_mt_header_v15.json']
113
+ jgi_v16_mappers = ['jgi_mg_header_v16.json', 'jgi_mt_header_v16.json']
114
+ jgi_mappers = jgi_v15_mappers + jgi_v16_mappers
113
115
 
114
- if mapper_basename in jgi_v15_mappers:
116
+ if mapper_basename in jgi_mappers:
115
117
  # Path to static JGI v15 Excel template
116
118
  static_excel_path = os.path.join(
117
119
  os.path.dirname(__file__), 'static-excel-tabs', 'JGI.Metagenome.NA.v15.xlsx'
mutts/retriever.py CHANGED
@@ -120,7 +120,7 @@ class MetadataRetriever:
120
120
  all_sample_data_df = pd.concat(sample_data_dfs, ignore_index=True)
121
121
  # Merge the combined sample data with df on samp_name
122
122
  if not df.empty and not all_sample_data_df.empty:
123
- df = pd.merge(df, all_sample_data_df, on="samp_name", how="outer")
123
+ df = pd.merge(df, all_sample_data_df, on="samp_name", how="left")
124
124
 
125
125
  # Auto-fill depth with 0 for JGI facilities if no value is provided
126
126
  if self.user_facility in ["jgi_mg", "jgi_mt", "jgi_mg_lr"]:
@@ -189,7 +189,7 @@ class MetadataRetriever:
189
189
 
190
190
  # Address 'Was sample DNAse treated?' col
191
191
  # Change from 'yes/no' to 'Y/N'
192
- if self.user_facility in ["jgi_mg", "jgi_mt"] and "dnase" in df.columns:
192
+ if self.user_facility in ["jgi_mg", "jgi_mt", "jgi_mg_lr"] and "dnase" in df.columns:
193
193
  df.loc[df["dnase"] == "yes", "dnase"] = "Y"
194
194
  df.loc[df["dnase"] == "no", "dnase"] = "N"
195
195
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mutts
3
- Version: 1.0.3
3
+ Version: 1.0.5
4
4
  Summary: Metadata for User facility Template Transformations
5
5
  License: MIT
6
6
  Keywords: NMDC,US DOE user facilities,metadata translation
@@ -31,6 +31,7 @@ Description-Content-Type: text/markdown
31
31
  - [MUTTs User Documentation](#mutts-user-documentation)
32
32
  - [Prerequisites](#prerequisites)
33
33
  - [Installation](#installation)
34
+ - [Updating to the Latest Version](#updating-to-the-latest-version)
34
35
  - [Usage](#usage)
35
36
  - [Example 1: Generate a JGI Metagenome spreadsheet](#example-1-generate-a-jgi-metagenome-spreadsheet)
36
37
  - [Example 2: Generate a JGI Metagenome v15 spreadsheet](#example-2-generate-a-jgi-metagenome-v15-spreadsheet)
@@ -61,9 +62,10 @@ The documentation and setup instructions in this section are meant for any user
61
62
 
62
63
  This is required for running the examples in the [Usage](#usage) section below (after going through all the [Installation](#installation) steps).
63
64
 
64
- Create a `.env` file in your working directory:
65
+ Create a `.env` file in your working directory with the following environment variables:
65
66
  ```bash
66
67
  echo "DATA_PORTAL_REFRESH_TOKEN=your_token_here" > .env
68
+ echo "SUBMISSION_PORTAL_BASE_URL=https://data.microbiomedata.org" >> .env
67
69
  ```
68
70
 
69
71
  To get your access token:
@@ -99,6 +101,24 @@ Download the mapper files you need from the [input-files directory](https://gith
99
101
  - For JGI Metagenome: `jgi_mg_header.json` or `jgi_mg_header_v15.json`
100
102
  - For JGI Metatranscriptome: `jgi_mt_header.json` or `jgi_mt_header_v15.json`
101
103
 
104
+ ### Updating to the Latest Version
105
+
106
+ To ensure you have the latest features and bug fixes, you can upgrade the MUTTs package from PyPI:
107
+
108
+ ```bash
109
+ pip install --upgrade mutts
110
+ ```
111
+
112
+ To check your currently installed version:
113
+ ```bash
114
+ pip show mutts
115
+ ```
116
+
117
+ You can also install a specific version if needed:
118
+ ```bash
119
+ pip install mutts==<version>
120
+ ```
121
+
102
122
  ### Usage
103
123
 
104
124
  Run the `mutts` command with the required options:
@@ -168,7 +188,7 @@ The software consists of two main components:
168
188
  - The `sub_port_mapping` keyword specifies mappings between Submission Portal columns/slots (as dictated by the [NMDC submission schema](https://microbiomedata.github.io/submission-schema/)) and user facility template columns
169
189
  - Examples available in [input-files/](input-files/)
170
190
 
171
- 1. **`mutts` CLI**
191
+ 2. **`mutts` CLI**
172
192
  - Command-line application that performs the metadata conversion
173
193
  - Consumes mapper files and submission data as inputs
174
194
 
@@ -196,9 +216,10 @@ This installs the `mutts` package in development mode and creates the `mutts` co
196
216
  cp .env.example .env # if available, or create a new .env file
197
217
  ```
198
218
 
199
- Add your NMDC API token:
219
+ Add your NMDC API token and submission portal base URL:
200
220
  ```
201
221
  DATA_PORTAL_REFRESH_TOKEN=your_token_here
222
+ SUBMISSION_PORTAL_BASE_URL=https://data.microbiomedata.org
202
223
  ```
203
224
 
204
225
  Get your token from: https://data.microbiomedata.org/user
@@ -0,0 +1,9 @@
1
+ mutts/__init__.py,sha256=iTcKOq5Id9qudNWyTGPJyJGuS19yG-FhPlmSfuJM7jU,217
2
+ mutts/cli.py,sha256=vCojLl4wNhZz-5qfKnB1NwfDfJoumqK722qZJBU88SM,5050
3
+ mutts/retriever.py,sha256=Ex62c18tTVPSeIAoGJnRlPj17XC2gBF-V7WNE8ap_lw,8345
4
+ mutts/spreadsheet.py,sha256=hSEEkTcTmkEFsktGG1_s4gAPuDys9Dnzbdk9cfJKwcY,5053
5
+ mutts/static-excel-tabs/JGI.Metagenome.NA.v15.xlsx,sha256=tYlYX5QZVjiiCrsCsxfL73O0BdvlqttBjUyqXsv8s7s,22099
6
+ mutts-1.0.5.dist-info/METADATA,sha256=06SUccJph-r0iO26ptjIm_i5QkSiLpe1_TJ-_TQ-f8w,9546
7
+ mutts-1.0.5.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
8
+ mutts-1.0.5.dist-info/entry_points.txt,sha256=rDp08H4MnNWGYHFE6ZAqOocRyTp68IPJsjXTcQppi8s,39
9
+ mutts-1.0.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.2.1
2
+ Generator: poetry-core 2.3.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,9 +0,0 @@
1
- mutts/__init__.py,sha256=iTcKOq5Id9qudNWyTGPJyJGuS19yG-FhPlmSfuJM7jU,217
2
- mutts/cli.py,sha256=YzRnMLEtbFc2yuAYqWoljvk0Z9IEHDw3XefjTZE8Rbg,4912
3
- mutts/retriever.py,sha256=B9cShEaeOY4BN1nWaML_UzMTR971X4rn1XfqyvZhAno,8333
4
- mutts/spreadsheet.py,sha256=hSEEkTcTmkEFsktGG1_s4gAPuDys9Dnzbdk9cfJKwcY,5053
5
- mutts/static-excel-tabs/JGI.Metagenome.NA.v15.xlsx,sha256=tYlYX5QZVjiiCrsCsxfL73O0BdvlqttBjUyqXsv8s7s,22099
6
- mutts-1.0.3.dist-info/METADATA,sha256=JU9879qBfZ0iLTHWHCR1J6XUyUSXPq1sSOm7wW0b0Zg,8928
7
- mutts-1.0.3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
8
- mutts-1.0.3.dist-info/entry_points.txt,sha256=rDp08H4MnNWGYHFE6ZAqOocRyTp68IPJsjXTcQppi8s,39
9
- mutts-1.0.3.dist-info/RECORD,,