-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
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" |
There was a problem hiding this comment.
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
dashboard/prepare-dashboard-data.py
Outdated
ribocount = int(content) | ||
sample_metadata[sample]["ribocounts"] = ribocount | ||
except FileNotFoundError: | ||
continue |
There was a problem hiding this comment.
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.
dashboard/prepare-dashboard-data.py
Outdated
try: | ||
with open(rc_fname, 'r') as file: | ||
content = file.read().strip() | ||
ribocount = int(content) |
There was a problem hiding this comment.
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.
Tested my running
prepare-dashboard-data.sh
which successfully completed and saved ribocounts tosample_metadata[sample]["ribocounts"]
in cases where the file exists.Also added a
--chunk_size
argument to the ribocounts function inrun.py
to address memory issues which I suspect were causing the screen processes to die.