Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
msa-limit
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rohmer Coralie
msa-limit
Commits
e141bf23
Commit
e141bf23
authored
2 years ago
by
Coralie Rohmer
Browse files
Options
Downloads
Patches
Plain Diff
fix total_data_format for threshold
parent
34bab247
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/total_data_format.py
+23
-22
23 additions, 22 deletions
src/total_data_format.py
with
23 additions
and
22 deletions
src/total_data_format.py
+
23
−
22
View file @
e141bf23
...
...
@@ -111,17 +111,18 @@ bases=[]
reads
=
[]
MSA
=
{}
for
threshold
in
files
:
data
[
"
order
"
]
=
[]
data
[
threshold
]
=
{}
data
[
threshold
][
"
order
"
]
=
[]
for
exp_name
in
files
[
threshold
]
:
data
[
exp_name
]
=
{}
data
[
exp_name
][
"
order
"
]
=
[]
data
[
"
order
"
]
=
data
[
"
order
"
]
+
[
exp_name
]
data
[
threshold
][
exp_name
]
=
{}
data
[
threshold
][
exp_name
][
"
order
"
]
=
[]
data
[
threshold
][
"
order
"
]
=
data
[
threshold
][
"
order
"
]
+
[
exp_name
]
header
=
[]
header_size
=
0
for
dir
in
files
[
threshold
][
exp_name
]:
data
[
exp_name
][
dir
]
=
{}
data
[
threshold
][
exp_name
][
dir
]
=
{}
MSA
[
exp_name
]
=
[]
data
[
exp_name
][
"
order
"
]
=
data
[
exp_name
][
"
order
"
]
+
[
dir
]
data
[
threshold
][
exp_name
][
"
order
"
]
=
data
[
threshold
][
exp_name
][
"
order
"
]
+
[
dir
]
name_file
=
os
.
path
.
join
(
EXP
,
exp_name
,
dir
,
RESULT_FOLDER
,
files
[
threshold
][
exp_name
][
dir
])
try
:
read
=
open
(
name_file
,
"
r
"
)
...
...
@@ -133,10 +134,10 @@ for threshold in files :
base_pair
=
int
(
tab_line
[
1
])
nb_read
=
int
(
tab_line
[
2
])
if
(
base_pair
not
in
data
[
exp_name
][
dir
]):
data
[
exp_name
][
dir
][
base_pair
]
=
{}
if
(
nb_read
not
in
data
[
exp_name
][
dir
][
base_pair
]):
data
[
exp_name
][
dir
][
base_pair
][
nb_read
]
=
{}
if
(
base_pair
not
in
data
[
threshold
][
exp_name
][
dir
]):
data
[
threshold
][
exp_name
][
dir
][
base_pair
]
=
{}
if
(
nb_read
not
in
data
[
threshold
][
exp_name
][
dir
][
base_pair
]):
data
[
threshold
][
exp_name
][
dir
][
base_pair
][
nb_read
]
=
{}
if
(
base_pair
not
in
bases
):
bases
.
append
(
base_pair
)
...
...
@@ -145,9 +146,9 @@ for threshold in files :
if
(
msa
not
in
MSA
[
exp_name
]):
MSA
[
exp_name
].
append
(
msa
)
data
[
exp_name
][
dir
][
base_pair
][
nb_read
][
msa
]
=
{}
data
[
threshold
][
exp_name
][
dir
][
base_pair
][
nb_read
][
msa
]
=
{}
for
i
in
range
(
3
,
header_size
):
data
[
exp_name
][
dir
][
base_pair
][
nb_read
][
msa
][
header
[
i
]]
=
tab_line
[
i
]
data
[
threshold
][
exp_name
][
dir
][
base_pair
][
nb_read
][
msa
][
header
[
i
]]
=
tab_line
[
i
]
else
:
header
=
tab_line
header_size
=
len
(
header
)
...
...
@@ -181,8 +182,8 @@ for threshold in files :
output_mean
.
write
(
"
,,
"
)
if
(
not
re
.
search
(
"
^sd_
"
,
attribute
)):
output_all
.
write
(
"
,,
"
)
for
exp_name
in
data
[
"
order
"
]:
for
dir
in
data
[
exp_name
][
"
order
"
]:
for
exp_name
in
data
[
threshold
][
"
order
"
]:
for
dir
in
data
[
threshold
][
exp_name
][
"
order
"
]:
if
dir
==
""
:
output_mean
.
write
(
"
,
"
+
exp_name
)
for
msa
in
MSA
[
exp_name
]:
...
...
@@ -195,8 +196,8 @@ for threshold in files :
output_mean
.
write
(
"
\n
lenght,cover,
"
)
if
(
not
re
.
search
(
"
^sd_
"
,
attribute
)):
output_all
.
write
(
"
\n
lenght,cover,
"
)
for
exp_name
in
data
[
"
order
"
]:
for
dir
in
data
[
exp_name
][
"
order
"
]:
for
exp_name
in
data
[
threshold
][
"
order
"
]:
for
dir
in
data
[
threshold
][
exp_name
][
"
order
"
]:
if
dir
==
""
:
for
msa
in
MSA
[
exp_name
]:
output_mean
.
write
(
"
,
"
+
msa
)
...
...
@@ -218,20 +219,20 @@ for threshold in files :
output_mean
.
write
(
str
(
base
)
+
"
,
"
+
str
(
read
)
+
"
,
"
)
if
(
not
re
.
search
(
"
^sd_
"
,
attribute
)):
output_all
.
write
(
str
(
base
)
+
"
,
"
+
str
(
read
)
+
"
,
"
)
for
exp_name
in
data
[
"
order
"
]:
for
dir
in
data
[
exp_name
][
"
order
"
]:
for
exp_name
in
data
[
threshold
][
"
order
"
]:
for
dir
in
data
[
threshold
][
exp_name
][
"
order
"
]:
if
dir
==
""
:
for
msa
in
MSA
[
exp_name
]:
if
(
base
in
data
[
exp_name
][
dir
])
and
(
read
in
data
[
exp_name
][
dir
][
base
])
and
(
msa
in
data
[
exp_name
][
dir
][
base
][
read
]):
output_mean
.
write
(
"
,
"
+
data
[
exp_name
][
dir
][
base
][
read
][
msa
][
attribute
])
if
(
base
in
data
[
threshold
][
exp_name
][
dir
])
and
(
read
in
data
[
threshold
][
exp_name
][
dir
][
base
])
and
(
msa
in
data
[
threshold
][
exp_name
][
dir
][
base
][
read
]):
output_mean
.
write
(
"
,
"
+
data
[
threshold
][
exp_name
][
dir
][
base
][
read
][
msa
][
attribute
])
else
:
output_mean
.
write
(
"
,
"
)
output_mean
.
write
(
"
,
"
)
else
:
if
(
not
re
.
search
(
"
^sd_
"
,
attribute
)):
for
msa
in
MSA
[
exp_name
]:
if
(
base
in
data
[
exp_name
][
dir
])
and
(
read
in
data
[
exp_name
][
dir
][
base
])
and
(
msa
in
data
[
exp_name
][
dir
][
base
][
read
]):
output_all
.
write
(
"
,
"
+
data
[
exp_name
][
dir
][
base
][
read
][
msa
][
attribute
])
if
(
base
in
data
[
threshold
][
exp_name
][
dir
])
and
(
read
in
data
[
threshold
][
exp_name
][
dir
][
base
])
and
(
msa
in
data
[
threshold
][
exp_name
][
dir
][
base
][
read
]):
output_all
.
write
(
"
,
"
+
data
[
threshold
][
exp_name
][
dir
][
base
][
read
][
msa
][
attribute
])
else
:
output_all
.
write
(
"
,
"
)
output_all
.
write
(
"
,
"
)
...
...
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