Repository navigation
Omit blank BioProject references from submission XML instead of writing "Not Provided" - #367
Open
developer-rpai wants to merge 1 commit into
Open
developer-rpai wants to merge 1 commit into
developer-rpai wants to merge 1 commit into
Conversation
…ng "Not Provided" NCBI rejects submissions that carry a placeholder value such as "Not Provided" as a BioProject PrimaryId, which causes tostadas to hang waiting on the rejected submission. When ncbi-bioproject is blank, missing, or a placeholder, the BioProject element/AttributeRefId is now omitted entirely and a warning is logged, per the suggestion in CDCgov#362. Fixes CDCgov#362.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #362: when
ncbi-bioprojectis left blank in the metadata, the generated NCBI submission XML currently carriesBioProjectreferences with the placeholder textNot Provided. NCBI rejects such submissions, and tostadas then hangs waiting on the rejected submission.Root cause
XMLSubmission.safe_text()substitutes"Not Provided"for any blank/NaNvalue, and the three BioProject call sites wrote that placeholder straight into the XML:BiosampleSubmission.add_action_block()→<BioProject><PrimaryId db="BioProject">Not Provided</PrimaryId></BioProject>SRASubmission.add_attributes_block()→AttributeRefId/BioProjectwith the placeholderGenbankSubmission.xml_create_wgs()→AttributeRefId/BioProjectwith the placeholderFix
XMLSubmission.bioproject_id(), which returns the stripped BioProject accession, orNonewhen the value is missing, blank,NaN, or the"Not Provided"placeholder.AttributeRefIdentirely whenbioproject_id()isNoneand log a warning ("ncbi-bioproject is blank; omitting the BioProject reference from the ... submission XML"), instead of emitting a known-bad placeholder.Reproduction evidence (sandbox, pristine
master@654854d)A repro script driving
add_action_block()/add_attributes_block()with a blank (NaN, as pandas reads a blank Excel cell)ncbi-bioprojectproduced<PrimaryId db="BioProject">Not Provided</PrimaryId>in both BioSample and SRA XML on pristine code, and omits the BioProject reference after the fix; a real accession (PRJNA123456) is preserved in both cases.Tests
tests/test_submission_helper.py: 13 tests covering blank (NaN/""/whitespace/"Not Provided"/None), missing-key, and real-accession cases across the BioSample and SRA paths, plus thebioproject_id()helper.pytest tests/test_submission_helper.py -q).Notes / limitations
table2asnsource TSV (create_source_file) still writes the rawncbi-bioprojectvalue; a blank cell serializes as empty there, which is unchanged behavior and out of scope for this fix.devbranch; this PR targetsmaster(the default branch).