Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Blaise LI
bioinfo_utils
Commits
8214c5aa
Commit
8214c5aa
authored
Jan 29, 2020
by
Blaise Li
Browse files
No more numpy kwarg in pybigwig values().
parent
9a7b7d98
Changes
4
Hide whitespace changes
Inline
Side-by-side
PRO-seq/PRO-seq.snakefile
View file @
8214c5aa
...
...
@@ -1194,7 +1194,7 @@ rule merge_bigwig_reps:
warn(f"The bigwig files without {chrom} will be skipped.\n")
to_use = [bw for bw in bws if chrom in bw.chroms()]
if to_use:
means = np.nanmean(np.vstack([bw.values(chrom, 0, chrom_len
, numpy=True
) for bw in to_use]), axis=0)
means = np.nanmean(np.vstack([bw.values(chrom, 0, chrom_len) for bw in to_use]), axis=0)
else:
means = np.zeros(chrom_len)
# bin size is 10
...
...
RNA_Seq_Cecere/RNA-seq.snakefile
View file @
8214c5aa
...
...
@@ -1510,7 +1510,7 @@ rule merge_bigwig_reps:
warn(f"The bigwig files without {chrom} will be skipped.\n")
to_use = [bw for bw in bws if chrom in bw.chroms()]
if to_use:
means = np.nanmean(np.vstack([bw.values(chrom, 0, chrom_len
, numpy=True
) for bw in to_use]), axis=0)
means = np.nanmean(np.vstack([bw.values(chrom, 0, chrom_len) for bw in to_use]), axis=0)
else:
means = np.zeros(chrom_len)
# bin size is 10
...
...
Ribo-seq/Ribo-seq.snakefile
View file @
8214c5aa
...
...
@@ -1868,7 +1868,7 @@ rule merge_bigwig_reps:
warn(f"The bigwig files without {chrom} will be skipped.\n")
to_use = [bw for bw in bws if chrom in bw.chroms()]
if to_use:
means = np.nanmean(np.vstack([bw.values(chrom, 0, chrom_len
, numpy=True
) for bw in to_use]), axis=0)
means = np.nanmean(np.vstack([bw.values(chrom, 0, chrom_len) for bw in to_use]), axis=0)
else:
means = np.zeros(chrom_len)
# bin size is 10
...
...
@@ -1905,8 +1905,8 @@ rule make_bigwig_ratios:
bw_out.addHeader(list(chrom_sizes.items()))
for (chrom, chrom_len) in bw_out.chroms().items():
assert cond_bw.chroms()[chrom] == chrom_len
#ratios = np.divide(cond_bw.values(chrom, 0, chrom_len
, numpy=True
), ref_bw.values(chrom, 0, chrom_len
, numpy=True
))
ratios = np.log2(np.divide(cond_bw.values(chrom, 0, chrom_len
, numpy=True
), ref_bw.values(chrom, 0, chrom_len
, numpy=True
)))
#ratios = np.divide(cond_bw.values(chrom, 0, chrom_len), ref_bw.values(chrom, 0, chrom_len))
ratios = np.log2(np.divide(cond_bw.values(chrom, 0, chrom_len), ref_bw.values(chrom, 0, chrom_len)))
# bin size is 10
bw_out.addEntries(chrom, 0, values=np.nan_to_num(ratios[0::10]), span=10, step=10)
bw_out.close()
...
...
small_RNA-seq/small_RNA-seq.snakefile
View file @
8214c5aa
...
...
@@ -2841,7 +2841,7 @@ rule merge_bigwig_reps:
raise
to_use = [bw for bw in bws if chrom in bw.chroms()]
if to_use:
means = np.nanmean(np.vstack([bw.values(chrom, 0, chrom_len
, numpy=True
) for bw in to_use]), axis=0)
means = np.nanmean(np.vstack([bw.values(chrom, 0, chrom_len) for bw in to_use]), axis=0)
else:
means = np.zeros(chrom_len)
# bin size is 10
...
...
@@ -2881,8 +2881,8 @@ rule make_bigwig_ratios:
bw_out.addHeader(list(chrom_sizes.items()))
for (chrom, chrom_len) in bw_out.chroms().items():
assert cond_bw.chroms()[chrom] == chrom_len
#ratios = np.divide(cond_bw.values(chrom, 0, chrom_len
, numpy=True
), ref_bw.values(chrom, 0, chrom_len
, numpy=True
))
ratios = np.log2(np.divide(cond_bw.values(chrom, 0, chrom_len
, numpy=True
), ref_bw.values(chrom, 0, chrom_len
, numpy=True
)))
#ratios = np.divide(cond_bw.values(chrom, 0, chrom_len), ref_bw.values(chrom, 0, chrom_len))
ratios = np.log2(np.divide(cond_bw.values(chrom, 0, chrom_len), ref_bw.values(chrom, 0, chrom_len)))
# bin size is 10
bw_out.addEntries(chrom, 0, values=np.nan_to_num(ratios[0::10]), span=10, step=10)
bw_out.close()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment