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

Add ribcounts to sample metadata for dashboard deployment #21

Merged
merged 3 commits into from
Sep 25, 2023

Conversation

lennijusten
Copy link
Collaborator

@lennijusten lennijusten commented Sep 25, 2023

Tested my running prepare-dashboard-data.sh which successfully completed and saved ribocounts to sample_metadata[sample]["ribocounts"] in cases where the file exists.

Also added a --chunk_size argument to the ribocounts function in run.py to address memory issues which I suspect were causing the screen processes to die.

run.py Outdated
@@ -264,7 +264,8 @@ def calculate_average_read_length(file_path):
ribodetector_cmd = [
"ribodetector_cpu",
"--ensure", "rrna",
"--threads", "24"
"--threads", "24",
"--chunk_size", "256"
Copy link
Member

Choose a reason for hiding this comment

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

nit: in the future it's better practice to put unrelated changes in their own PRs

ribocount = int(content)
sample_metadata[sample]["ribocounts"] = ribocount
except FileNotFoundError:
continue
Copy link
Member

Choose a reason for hiding this comment

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

I'd like pass here better than continue. If someone later adds code below that's supposed to be within this loop then we wouldn't want to skip it in cases where there was no ribocounts file.

try:
with open(rc_fname, 'r') as file:
content = file.read().strip()
ribocount = int(content)
Copy link
Member

Choose a reason for hiding this comment

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

nit: I'd write this as int(file.read().strip()); I don't think the intermediate content variable adds anything in this case.

@lennijusten lennijusten merged commit 14dac5a into main Sep 25, 2023
@lennijusten lennijusten deleted the lenni-ribocounts-dashboard branch September 25, 2023 18:24
dp-rice pushed a commit that referenced this pull request Sep 27, 2023
This was referenced Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants