Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
baseLess
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
Container 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
Lannoy, Carlos de
baseLess
Commits
b9049d1d
Commit
b9049d1d
authored
3 years ago
by
Noordijk, Ben
Browse files
Options
Downloads
Patches
Plain Diff
visualise_ground_truth_file.py now also shows species abundance
parent
86393885
No related branches found
Branches containing commit
No related tags found
1 merge request
!3
Added data preparation, hyperparameter optimisation, benchmarking code and k-mer library visualisation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/visualise_ground_truth_file.py
+32
-4
32 additions, 4 deletions
tools/visualise_ground_truth_file.py
with
32 additions
and
4 deletions
tools/visualise_ground_truth_file.py
+
32
−
4
View file @
b9049d1d
...
...
@@ -6,21 +6,49 @@ import numpy as np
def
main
():
id_to_species
=
{
'
NZ_CP053098
'
:
'
acinetobacter baumannii
'
,
'
NZ_DS264586
'
:
'
actinomyces odontolyticus
'
,
# 'NZ_DS26458': 'schaalia odontolytica',
'
AE017194
'
:
'
bacillus cereus
'
,
'
CP000139
'
:
'
bacteroides vulgatus
'
,
'
CP000721
'
:
'
clostridium beijerinckii
'
,
'
AE000513
'
:
'
deinococcus radiodurans
'
,
'
CP025020
'
:
'
enterococcus faecalis
'
,
'
U00096
'
:
'
escherichia coli
'
,
'
AE000511
'
:
'
helicobacter pylori
'
,
'
CP000413
'
:
'
lactobacillus gasseri
'
,
'
AL591824
'
:
'
listeria monocytogenes
'
,
'
AE002098
'
:
'
neisseria meningitides
'
,
'
AP009380
'
:
'
porphyromonas gingivalis
'
,
'
AE017283
'
:
'
propionibacterium acnes
'
,
'
AE004091
'
:
'
pseudomonas aeruginosa
'
,
'
CP000144
'
:
'
rhodobacter sphaeroides
'
,
'
CP000730
'
:
'
staphylococcus aureus
'
,
'
AE015929
'
:
'
staphylococcus epidermidis
'
,
'
AE009948
'
:
'
streptococcus agalactiae
'
,
'
AE014133
'
:
'
streptococcus mutans
'
,
'
AE005672
'
:
'
streptococcus pneumoniae
'
,
}
ground_truth_csv
=
Path
(
'
/home/noord087/lustre_link/HoiCarlos/
'
'
16Sreads_mockcommunity/ground_truth_with_
'
'
read_id_and_perc_id.csv
'
)
df
=
pd
.
read_csv
(
ground_truth_csv
)
fig
,
axs
=
plt
.
subplots
(
1
,
3
,
figsize
=
(
1
5
,
5
),
sharey
=
True
)
df
[
'
query length
'
].
plot
.
hist
(
title
=
'
Query length
'
,
ax
=
axs
[
0
],
fig
,
axs
=
plt
.
subplots
(
2
,
2
,
figsize
=
(
1
0
,
10
)
)
df
[
'
query length
'
].
plot
.
hist
(
title
=
'
Query length
'
,
ax
=
axs
[
0
,
0
],
bins
=
np
.
linspace
(
0
,
3000
,
50
))
percent_in_alignment
=
df
[
'
alignment length
'
]
/
df
[
'
query length
'
]
percent_in_alignment
.
plot
.
hist
(
title
=
'
Relative length of alignment relative to query
'
,
ax
=
axs
[
1
],
bins
=
np
.
linspace
(
0.5
,
1
,
20
))
ax
=
axs
[
0
,
1
],
bins
=
np
.
linspace
(
0.5
,
1
,
20
))
df
[
'
percent identity
'
].
plot
.
hist
(
title
=
'
Percent identity (based on alignment length)
'
,
ax
=
axs
[
2
],
bins
=
np
.
linspace
(
0.8
,
1
,
20
))
ax
=
axs
[
1
,
0
],
bins
=
np
.
linspace
(
0.8
,
1
,
20
))
species_abundance
=
df
[
'
species id
'
].
value_counts
()
species_abundance
.
index
=
[
id_to_species
[
id
[:
-
2
]]
for
id
in
species_abundance
.
index
]
species_abundance
.
plot
.
bar
(
title
=
'
Species abundance in ground truth
'
,
ax
=
axs
[
1
,
1
])
plt
.
tight_layout
()
plt
.
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