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
906f1470
Commit
906f1470
authored
4 years ago
by
nfontrod
Browse files
Options
Downloads
Patches
Plain Diff
src/nt_composition/config.py: Add a parameter ft_type in get_weight_folder
parent
d83855e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nt_composition/config.py
+9
-6
9 additions, 6 deletions
src/nt_composition/config.py
with
9 additions
and
6 deletions
src/nt_composition/config.py
+
9
−
6
View file @
906f1470
...
...
@@ -11,7 +11,7 @@ from ..db_utils.config import Config
from
typing
import
List
def
get_weight_folder
(
weight
:
int
,
global_weight
:
int
):
def
get_weight_folder
(
weight
:
int
,
global_weight
:
int
,
ft_type
:
str
):
"""
Get the weight folder.
...
...
@@ -20,14 +20,17 @@ def get_weight_folder(weight: int, global_weight: int):
the global weight is equal to 0 then then density figure are calculated
\
by project, else all projet are merge together and the interaction
\
seen in `global_weight` project are taken into account
:parma ft_type: The type fo featrue of interst
:return: The folder that will contains the interaction with a weight
\
greater or equal to `weigh` in ChIA-PET projects
"""
if
global_weight
==
0
:
weight_folder
=
ConfigNt
.
density_folder
/
f
"
project_weight:
{
weight
}
"
weight_folder
=
ConfigNt
.
density_folder
/
\
f
"
{
ft_type
}
_project_weight-
{
weight
}
"
else
:
weight_folder
=
ConfigNt
.
density_folder
/
\
f
"
weight:
{
weight
}
-global_weight:
{
global_weight
}
"
f
"
{
ft_type
}
_weight-
{
weight
}
_
"
\
f
"
global_weight-
{
global_weight
}
"
weight_folder
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
return
weight_folder
...
...
@@ -52,7 +55,7 @@ def get_density_file(weight: int, global_weight: int, project: str,
ext
=
"
pdf
"
else
:
ext
=
"
txt
"
res_folder
=
get_weight_folder
(
weight
,
global_weight
)
/
project
res_folder
=
get_weight_folder
(
weight
,
global_weight
,
ft_type
)
/
project
res_folder
.
mkdir
(
exist_ok
=
True
,
parents
=
True
)
return
res_folder
/
f
"
{
project
}
_
{
ft_type
}
_
{
ft
}
_density.
{
ext
}
"
...
...
@@ -76,7 +79,7 @@ def get_density_recap(weight: int, global_weight: int,
ext
=
"
pdf
"
else
:
ext
=
"
txt
"
outfolder
=
get_weight_folder
(
weight
,
global_weight
)
outfolder
=
get_weight_folder
(
weight
,
global_weight
,
ft_type
)
outfolder
.
mkdir
(
exist_ok
=
True
,
parents
=
True
)
return
outfolder
/
f
"
{
ft_type
}
_
{
ft
}
_density_recap.
{
ext
}
"
...
...
@@ -132,7 +135,7 @@ class ConfigNt:
"""
A class containing every parameters used in the submodule nt_composition
"""
cpu
=
Config
.
cpu
cpu
=
7
#
Config.cpu
data
=
Config
.
data
result
=
Config
.
results
db_file
=
Config
.
db_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