Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bigWig_visu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
ReGArDS
Projects_Analyzes
bigWig_visu
Commits
c22ad3fd
Commit
c22ad3fd
authored
4 years ago
by
nfontrod
Browse files
Options
Downloads
Patches
Plain Diff
src/visu/figure_maker.py: add a warning message if some bed feature cannot be reported
parent
337afeeb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/visu/figure_maker.py
+9
-0
9 additions, 0 deletions
src/visu/figure_maker.py
with
9 additions
and
0 deletions
src/visu/figure_maker.py
+
9
−
0
View file @
c22ad3fd
...
...
@@ -15,6 +15,7 @@ import pyBigWig as pbw
import
seaborn
as
sns
import
matplotlib.pyplot
as
plt
from
tqdm
import
tqdm
from
loguru
import
logger
def
load_bed
(
bed
:
Path
,
bed_name
:
str
)
->
List
[
List
[
Union
[
int
,
str
]]]:
...
...
@@ -111,6 +112,10 @@ def inspect_bigwig_regions(bw: Any, region: List,
3
2.00
3
cond1
R1
exon2
4
2.00
4
cond1
R1
exon2
"""
r_start
=
max
(
region
[
1
],
0
)
r_end
=
min
(
region
[
2
],
bw
.
chroms
(
region
[
0
]))
if
r_end
-
r_start
<
nb_bin
:
return
pd
.
DataFrame
()
val
=
bw
.
stats
(
region
[
0
],
max
(
region
[
1
],
0
),
min
(
region
[
2
],
bw
.
chroms
(
region
[
0
])),
...
...
@@ -173,6 +178,10 @@ def create_sample_table(bw_file: Path, regions: List[List],
for
region
in
tqdm
(
regions
,
desc
=
"
scanning coverage ...
"
):
list_df
.
append
(
inspect_bigwig_regions
(
bw
,
region
,
replicate
,
nb_bin
,
resize
,
condition_name
))
r
=
sum
([
df
.
empty
for
df
in
list_df
])
if
r
>
0
:
logger
.
warning
(
f
"
They were
{
r
}
bed feature that could not be reported
"
f
"
because of their small size
"
)
return
pd
.
concat
(
list_df
,
axis
=
0
,
ignore_index
=
True
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment