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
0d92cb04
Commit
0d92cb04
authored
3 years ago
by
Rohmer Coralie
Browse files
Options
Downloads
Patches
Plain Diff
python graph
parent
4854c62d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/graphical_seq_consensus_analysis.py
+69
-0
69 additions, 0 deletions
src/graphical_seq_consensus_analysis.py
with
69 additions
and
0 deletions
src/graphical_seq_consensus_analysis.py
0 → 100755
+
69
−
0
View file @
0d92cb04
#!/usr/bin/env python3
import
sys
,
csv
import
matplotlib.pyplot
as
plt
from
pylab
import
*
plt
.
style
.
use
(
'
seaborn-whitegrid
'
)
import
numpy
as
np
def
recovered_threshold
(
file
):
path
=
file
.
split
(
"
_
"
)[
-
1
].
split
(
"
.
"
)[
0
][
1
:]
return
path
attribute
=
sys
.
argv
[
1
]
dir_out
=
sys
.
argv
[
2
]
files
=
[
sys
.
argv
[
3
]]
#,sys.argv[4]]
data
=
{}
attribute_max
=
""
for
file
in
files
:
threshold
=
recovered_threshold
(
file
)
with
open
(
file
,
newline
=
''
)
as
csvfile
:
data
[
threshold
]
=
{}
spamreader
=
csv
.
reader
(
csvfile
)
titles
=
{}
for
row
in
spamreader
:
if
row
[
0
]
==
"
MSA
"
:
for
i
in
range
(
len
(
row
)):
titles
[
row
[
i
]]
=
i
else
:
msa
=
row
[
titles
[
"
MSA
"
]]
region_size
=
row
[
titles
[
"
region_size
"
]]
depth
=
row
[
titles
[
"
depth
"
]]
if
msa
not
in
data
[
threshold
]:
data
[
threshold
][
msa
]
=
{}
if
region_size
not
in
data
[
threshold
][
msa
]:
data
[
threshold
][
msa
][
region_size
]
=
{}
data
[
threshold
][
msa
][
region_size
][
"
depth
"
]
=
[]
data
[
threshold
][
msa
][
region_size
][
"
attribute
"
]
=
[]
if
depth
not
in
data
[
threshold
][
msa
][
region_size
]:
data
[
threshold
][
msa
][
region_size
][
"
depth
"
].
append
(
int
(
depth
))
val
=
row
[
titles
[
attribute
]]
if
val
>
attribute_max
:
attribute_max
=
val
data
[
threshold
][
msa
][
region_size
][
"
attribute
"
].
append
(
float
(
val
))
print
(
data
)
print
(
attribute_max
)
color
=
[
"
b
"
,
"
r
"
,
"
g
"
,
"
p
"
,
"
y
"
]
for
threshold
in
data
:
for
msa
in
data
[
threshold
]:
fig
=
plt
.
figure
()
ax
=
plt
.
axes
()
ax
=
ax
.
set
(
xlabel
=
'
Depth
'
,
ylabel
=
attribute
)
plt
.
title
(
attribute
+
"
for
"
+
msa
)
i
=
0
plt
.
axis
([
0
,
50
,
0
,
float
(
attribute_max
)
+
10
]);
for
region_size
in
data
[
threshold
][
msa
]:
x
=
np
.
array
(
data
[
threshold
][
msa
][
region_size
][
"
depth
"
])
y
=
np
.
array
(
data
[
threshold
][
msa
][
region_size
][
"
attribute
"
])
plt
.
plot
(
x
,
y
,
color
=
color
[
i
],
linestyle
=
'
solid
'
,
label
=
"
Region size:
"
+
region_size
)
i
+=
1
plt
.
legend
(
loc
=
'
lower left
'
);
fig
=
plt
.
figure
()
ax
=
plt
.
axes
()
x
=
np
.
array
([
10
,
20
,
50
])
y
=
np
.
array
([
10
,
20
,
50
])
plt
.
plot
(
x
,
y
,
color
=
'
blue
'
,
linestyle
=
'
solid
'
,
label
=
'
bleu
'
)
show
()
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