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

🐛 Fix Collapse bug #553

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ open_pbta_envs.txt
# Expression files in subset directories
analyses/molecular-subtyping*/*subset/*rsem-tpm*


# vs code
.vscode/
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ def collapse_dups(dup_gene_sym_dict):
"""
Get highest mean for repeated gene symbols and output that row
"""
out_data = []
for gene_sym in dup_gene_sym_dict:
means = [mean(data) for data in dup_gene_sym_dict[gene_sym]]
top_idx = means.index(max(means))
out_data = "{}\t{}\n".format(gene_sym, '\t'.join(list(map(str, dup_gene_sym_dict[gene_sym][top_idx]))))
return out_data
out_data.append("{}\t{}".format(gene_sym, '\t'.join(list(map(str, dup_gene_sym_dict[gene_sym][top_idx])))))
return out_data


def main():
Expand Down Expand Up @@ -170,7 +171,7 @@ def main():
l += 1
print("Processing {} repeat gene symbols and choosing highest mean expression".format(dup_ct), file=sys.stderr)
out_data = collapse_dups(dup_gene_sym_dict)
out_collapse.write(out_data)
out_collapse.write("\n".join(out_data))
print("Done!", file=sys.stderr)


Expand Down
2 changes: 1 addition & 1 deletion analyses/collapse-rnaseq/cwl/tools/convert_to_rds.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ doc: "Converts tsv table to rds"
requirements:
- class: ShellCommandRequirement
- class: DockerRequirement
dockerPull: 'rocker/tidyverse:3.5.3'
dockerPull: 'pgc-images.sbgenomics.com/d3b-bixu/annofuse:0.92.0'
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing:
Expand Down
Loading