Repository navigation
Allow NEON soil translator to take selected list of dnaSampleID values as input - #1398
Conversation
Constrain the NEON soil translator to only process a configurable subset of samples by dnaSampleID. The filter is provided as a list of IDs via the Dagster launchpad UI at job launch time. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…bjects Use "1" (dimensionless) instead of "ratio" for carb_nitro_ratio unit to match nmdc_schema UnitEnum. Skip id minting when there are no raw data file paths to avoid 422 error from PositiveInt validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire get_neon_soil_sample_filter op config into the translate and ingest NEON soil metadata job definitions. Remove unused Optional import and default value from allowed_dna_sample_ids parameter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The else branch (non-pooled samples) in the extraction processing loop was missing the processed_sample_set.append() call, causing 24 ProcessedSample records to be omitted from the output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b701e40 to
12d76d2
Compare
| @@ -770,4 +792,4 @@ | |||
| processed_sample_id, genomics_sample_id | |||
There was a problem hiding this comment.
name of the processed sample that is output of extraction should be the dnaSampleID, not the genomics_sample_id
There was a problem hiding this comment.
I'll make another PR to address this. We should leave the scope of this PR to just "adding include list capability".
| processed_sample_id, genomics_sample_id | ||
| ) | ||
| ) | ||
| else: |
There was a problem hiding this comment.
What use case is this else block supposed to be addressing so I can check how the processed sample should be named.
There was a problem hiding this comment.
Would you be able to highlight the snippet you want to verify again @aclum?
There was a problem hiding this comment.
I believe this should be genomics_sample_id, not dna_sample_id
There was a problem hiding this comment.
Same comment as above, I'll make another PR to address this. We should leave the scope of this PR to just "adding include list capability".
…e always created - Use genomicsSampleID (not dnaSampleID) to name pooled ProcessedSample records - Use dna_sample_input (not genomics_sample_id) to name extraction ProcessedSample records - Move data_generation_set.append() outside the raw data files check so sequencing records are created even when no raw file paths are present - Remove unused has_output = None assignment Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dnaSampleID values as input
…ranslator Create one NucleotideSequencing record per R1/R2 file pair instead of one per dnaSampleID, pairing files by basename to handle R1/R2 living in different directories. Add Manifest records for dnaSampleIDs with multiple R1/R2 pairs, linking their DataObjects via in_manifest. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Based on the JSON file we recently submitted to dev and prod Mongo (see microbiomedata/issues#1271 (comment)), I think we're ready to merge in this PR. |
Summary
dnaSampleIDfilter to the NEON soil translator, allowing jobs to constrain translation to a specific set of DNA samples. The filter is configured via a newget_neon_soil_sample_filterDagster op and applied tomms_metagenomeDnaExtraction,mms_metagenomeSequencing, andraw data file mappings at load time.
ProcessedSamplerecords for non-pooled Extractions — theelsebranch was only creating theExtractionrecord but not the corresponding outputProcessedSample.carb_nitro_ratiounit: change from"ratio"(not in the NMDC schema enum) to"1"(dimensionless unit)._id_mintercall forDataObjectIDs with a length check to avoid minting zero IDs.nmdc:Manifestsupport: create Manifest records when adnaSampleIDhas more than 2 raw data files, and link eachDataObjectto its Manifest viain_manifest.NucleotideSequencingrecord per R1/R2 file pair instead of one perdnaSampleID. Files are paired by basename (stripping the directory path) to correctly match R1 and R2 files that live in different directories.Changes
neon_soil_translator.py: Accept optionalallowed_dna_sample_idsparameter; filter MMS and raw data file tables bydnaSampleID; fixcarb_nitro_ratiounit; guard emptyneon_raw_file_paths; add missingprocessed_sample_set.append()for non-pooled extractions; add_translate_manifest()method; addmanifest_idparameter to_translate_data_object()within_manifestfield; group raw data files into R1/R2 pairs by filename basename; mint oneNucleotideSequencingID per pair; create oneNucleotideSequencingrecord per pair with bothDataObject IDs in
has_output; createManifestrecords fordnaSampleIDs with >2 raw files.ops.py: Addget_neon_soil_sample_filterop withdna_sample_idsconfig; passallowed_dna_sample_idsthrough to the translator.graphs.py: Wireget_neon_soil_sample_filterinto bothtranslate_neon_api_soil_metadata_to_nmdc_schema_databaseandingest_neon_soil_metadatagraphs.repository.py: Add default (empty) config forget_neon_soil_sample_filterin both job presets.Test plan
pytest tests/ -k "neon_soil" -vto verify existing translator tests passallowed_dna_sample_idsset produces the same output as before (no filtering)dnaSampleIDvalues correctly constrains the translated outputprocessed_sample_setcount matches expected for both pooled and non-pooled extractionsNucleotideSequencingrecord has exactly 2 DataObjects (one R1, one R2) inhas_outputManifestrecords are created only when adnaSampleIDhas >2 raw data files, and that correspondingDataObjectrecords reference the Manifest viain_manifestRelated issue: microbiomedata/issues#1271