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

For re-demux: keep PDC archive date if exists #433

Merged
merged 3 commits into from
Sep 30, 2024

Conversation

chuan-wang
Copy link
Member

No description provided.

Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Project coverage is 26.57%. Comparing base (c08d3f3) to head (e90db05).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
taca/analysis/analysis.py 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #433      +/-   ##
==========================================
- Coverage   26.63%   26.57%   -0.07%     
==========================================
  Files          28       28              
  Lines        3949     3959      +10     
==========================================
  Hits         1052     1052              
- Misses       2897     2907      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -155,6 +155,19 @@ def _upload_to_statusdb(run):
parser.obj["DemultiplexConfig"] = {
"Setup": {"Software": run.CONFIG.get("bcl2fastq", {})}
}
# Keep PDC archive date if there is one already
run_vals = run.split("_")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? run is a run object and not a string right?

else:
run_date = run_vals[0]
run_fc = f"{run_date}_{run_vals[-1]}"
fc_names = {e.key: e.id for e in db.view("names/name", reduce=False)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would fetch all flowcell IDs in the database. I think you can fetch the document you want directly with the key in just one call. I would have to look up the specific syntax though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I'm re-using the code here:

def _log_pdc_statusdb(self, run):
. It would be nice if there is some better way!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc = db.view("names/name", reduce=False, include_docs=True)[run_fc].rows[0].doc

should do the trick, but one would need to wrap it in try except to catch the case when the flowcell is not present in the view. Alternatively one could have multiple lines and check that the rows are not empty after fetching.

taca/analysis/analysis.py Outdated Show resolved Hide resolved
Copy link

@aanil aanil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@chuan-wang chuan-wang merged commit ffc3bca into SciLifeLab:master Sep 30, 2024
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants