Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ChIA-PET_network
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
Model registry
Operate
Environments
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
ChIA-PET_network
Commits
1b580dc5
Commit
1b580dc5
authored
4 years ago
by
alapendr
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitbio.ens-lyon.fr:LBMC/regards/chia-pet_network
parents
3a733e59
0e0a1c76
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/figures_utils/config_figures.py
+49
-0
49 additions, 0 deletions
src/figures_utils/config_figures.py
with
49 additions
and
0 deletions
src/figures_utils/config_figures.py
+
49
−
0
View file @
1b580dc5
...
...
@@ -8,6 +8,51 @@ Description: Configuration class
from
pathlib
import
Path
from
typing
import
List
from
itertools
import
filterfalse
from
doctest
import
testmod
import
re
def
get_p
(
x
:
str
):
"""
return False if x contains
'
Keep
'
True else
>>>
get_p
(
'
Keep: GMX32, GSM78
'
)
False
>>>
get_p
(
'
Delete: Bou, foo, bar
'
)
True
"""
if
"
Keep
"
in
x
:
return
False
else
:
return
True
def
get_good_project
()
->
List
[
str
]:
"""
Return only good ChIA-PET projects base on TAD co-localisation results
:return: The list of project to keep
>>>
res
=
get_good_project
()
>>>
type
(
res
)
<
class
'
list
'
>
>>>
len
(
res
)
>
0
True
>>>
"
GSM1018963_GSM1018964
"
in
res
True
>>>
res
[
0
:
2
]
[
'
GSM1018963_GSM1018964
'
,
'
GSM1018961_GSM1018962
'
]
>>>
pat
=
re
.
compile
(
r
"
[GSM0-9_]+
"
)
>>>
sum
([
re
.
findall
(
pat
,
c
)[
0
]
==
c
for
c
in
res
])
==
len
(
res
)
True
"""
with Config.file_datasets_filtering.open(
'
r
'
) as f:
line = next(filterfalse(get_p, f)).replace(
"
Keep:
"
,
""
).\
replace(
'
\
n
'
,
''
)
return line.split(
'
,
'
)
class Config:
...
...
@@ -22,3 +67,7 @@ class Config:
db_file = results /
'
chia_pet_database
.
db
'
draw_number = 1000
file_datasets_filtering = results /
"
projects_filtering.txt
"
if __name__ ==
"
__main__
"
:
testmod()
\ No newline at end of file
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