-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
major update, including dedup_clusterPAS.py for postprocessing and ad…
…ding pyBigWig to shared YAML (pushed to nodes already)
- Loading branch information
David Koppstein
committed
Apr 17, 2023
1 parent
c0a1fe9
commit 3beb258
Showing
7 changed files
with
211 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ dependencies: | |
- multiqc = 1.12 | ||
- fastp = 0.23.2 | ||
- umi_tools = 1.1.2 | ||
- pybigwig = 0.3.18 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
snakePipes/shared/tools/three_prime_seq/dedup_clusterPAS.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python | ||
|
||
import pandas as pd | ||
import sys | ||
|
||
""" | ||
Read in post-processed output of clusterPAS from STDIN, add header, | ||
deduplicate the Gene column (4th), write to STDOUT. | ||
""" | ||
|
||
|
||
HEADERS = [ | ||
"Chromosome", | ||
"Start", | ||
"End", | ||
"Gene", | ||
"Counts", | ||
"Strand", | ||
"Annotation", | ||
"Summit", | ||
] | ||
|
||
|
||
def dedup(sub_df): | ||
new_ids = ["_".join([str(gene), str(i)]) for (i, gene) in enumerate(sub_df['Gene'])] | ||
sub_df['Gene'] = new_ids | ||
return sub_df | ||
|
||
|
||
def main(): | ||
df = pd.read_table(sys.stdin, index_col=None, header=None) | ||
df.columns = HEADERS | ||
df = df.groupby("Gene").apply(dedup) | ||
df.to_csv(sys.stdout, sep="\t", index=False) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.