-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
72 additions
and
161 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 was deleted.
Oops, something went wrong.
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
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
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
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
import os | ||
import shutil | ||
import pyBigWig | ||
import numpy as np | ||
|
||
|
||
def get_chr_lengths(bw): | ||
with pyBigWig.open(bw) as bw: | ||
{chrom: length for chrom, length in bw.chroms().items()} | ||
|
||
|
||
def _check_chr_lengths(bw_files): | ||
reference_lengths = {} | ||
with pyBigWig.open(list(bw_files.values())[0]) as bw: | ||
reference_lengths = {chrom: length for chrom, length in bw.chroms().items()} | ||
|
||
# Compare chromosome lengths with other files | ||
for file in list(bw_files.values())[1:]: | ||
with pyBigWig.open(file) as bw: | ||
lengths = {chrom: length for chrom, length in bw.chroms().items()} | ||
if lengths != reference_lengths: | ||
raise Exception( | ||
"Provided .bw files do not have identical chromomosome lengths." | ||
) | ||
|
||
# return np.array(list(reference_lengths.values()), dtype=np.int64) | ||
return reference_lengths |
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