-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -274,6 +274,7 @@ def count_dups(hvr_fname): | |
|
||
# sample -> {metadata} | ||
sample_metadata = defaultdict(dict) | ||
|
||
for project in projects: | ||
with open("%s/bioprojects/%s/metadata/metadata.tsv" % ( | ||
ROOT_DIR, project)) as inf: | ||
|
@@ -289,6 +290,15 @@ def count_dups(hvr_fname): | |
sample_metadata[sample]["reads"] = \ | ||
project_sample_reads[project][sample] | ||
|
||
rc_fname = "ribocounts/%s.ribocounts.txt" % sample | ||
try: | ||
with open(rc_fname, 'r') as file: | ||
content = file.read().strip() | ||
ribocount = int(content) | ||
sample_metadata[sample]["ribocounts"] = ribocount | ||
except FileNotFoundError: | ||
continue | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like |
||
|
||
for taxid in observed_taxids: | ||
for project in projects: | ||
for sample in project_sample_reads[project]: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 |
||
] | ||
ribodetector_cmd.extend(["--len", str(avg_length)]) | ||
|
||
|
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 intermediatecontent
variable adds anything in this case.