Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DIA augmentation
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Léo Schneider
DIA augmentation
Commits
34a96c5a
Commit
34a96c5a
authored
4 months ago
by
Schneider Leo
Browse files
Options
Downloads
Patches
Plain Diff
data viz
parent
0d5fcf37
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
data/data_exploration.py
+4
-4
4 additions, 4 deletions
data/data_exploration.py
data/data_viz.py
+47
-3
47 additions, 3 deletions
data/data_viz.py
main.py
+1
-1
1 addition, 1 deletion
main.py
with
52 additions
and
8 deletions
data/data_exploration.py
+
4
−
4
View file @
34a96c5a
...
...
@@ -128,11 +128,11 @@ def main():
# retention_time_distribution(df_unique['irt_scaled'], False, True, '../fig/data_exploration/retention_time_distribution_isa_noc_mox_unique.png')
#prosit outlier_plasma
df
=
pd
.
read_csv
(
'
data_
PXD006109
/data_prosit_outlier.csv
'
)
df
=
pd
.
read_csv
(
'
data_
ISA
/data_prosit_outlier.csv
'
)
df
[
'
seq
'
]
=
df
[
'
seq
'
].
map
(
numerical_to_alphabetical_str
)
_
=
length_distribution
(
df
[
'
seq
'
],
False
,
True
,
'
../fig/data_exploration/length_distribution_prosit_outlier.png
'
)
_
=
aa_distribution
(
df
[
'
seq
'
],
False
,
True
,
'
../fig/data_exploration/aa_distribution_prosit_outlier.png
'
)
retention_time_distribution
(
df
[
'
true rt
'
],
False
,
True
,
'
../fig/data_exploration/retention_time_distribution_prosit_outlier.png
'
)
_
=
length_distribution
(
df
[
'
seq
'
],
False
,
True
,
'
../fig/data_exploration/length_distribution_
ISA_
prosit_outlier.png
'
)
_
=
aa_distribution
(
df
[
'
seq
'
],
False
,
True
,
'
../fig/data_exploration/aa_distribution_
ISA_
prosit_outlier.png
'
)
retention_time_distribution
(
df
[
'
true rt
'
],
False
,
True
,
'
../fig/data_exploration/retention_time_distribution_
ISA_
prosit_outlier.png
'
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
data/data_viz.py
+
47
−
3
View file @
34a96c5a
...
...
@@ -7,7 +7,7 @@ import random
import
pandas
as
pd
from
constant
import
ALPHABET_UNMOD_REV
import
matplotlib.colors
as
mcolors
import
peptides
as
pep
def
histo_abs_error
(
dataframe
,
display
=
False
,
save
=
False
,
path
=
None
):
points
=
dataframe
[
'
abs_error
'
]
...
...
@@ -266,9 +266,35 @@ def plot_augmented_dataset_size(ref_path,base_path):
plt
.
savefig
(
'
../fig/data_exploration/augmented_dataset_size.png
'
)
def
compute_peptide_properties
(
df
,
base_name
,
col
=
'
seq
'
,
format
=
'
alpha
'
):
if
format
!=
'
alpha
'
:
df
[
col
]
=
df
[
col
].
map
(
numerical_to_alphabetical_str
)
hydro
=
[]
isop
=
[]
molecular_w
=
[]
for
p
in
df
[
col
]:
pept
=
pep
.
Peptide
(
p
)
hydro
.
append
(
pept
.
hydrophobicity
())
isop
.
append
(
pept
.
isoelectric_point
())
molecular_w
.
append
(
pept
.
molecular_weight
())
plt
.
hist
(
hydro
,
bins
=
50
)
plt
.
title
(
"
Hydrophobicity
"
)
plt
.
savefig
(
'
../fig/data_exploration/hydrophobicity_{}.png
'
.
format
(
base_name
))
plt
.
clf
()
plt
.
hist
(
hydro
,
bins
=
50
)
plt
.
title
(
"
Isoelectric point
"
)
plt
.
savefig
(
'
../fig/data_exploration/isoelectric_point_{}.png
'
.
format
(
base_name
))
plt
.
clf
()
plt
.
hist
(
hydro
,
bins
=
50
)
plt
.
title
(
"
Molecular weight
"
)
plt
.
savefig
(
'
../fig/data_exploration/molecular_weight_{}.png
'
.
format
(
base_name
))
plt
.
clf
()
if
__name__
==
'
__main__
'
:
calc_and_plot_res
()
#
calc_and_plot_res()
# base = ['plasma_plasma','plasma_prosit']
# # augmented = ['ISA_aug_07_ISA_noc','ISA_aug_1_ISA_noc','ISA_aug_all_ISA_noc']
# for f_suffix_name in base:
...
...
@@ -285,4 +311,22 @@ if __name__ == '__main__' :
# error_by_methionine(df)
# dataframe = pd.read_csv('../output/out_early_stop_plasma_prosit_0.csv')
# df = filter_outlier_rt(dataframe)
# df.to_csv('../data/data_PXD006109/data_prosit_outlier.csv', index=False)
\ No newline at end of file
# df.to_csv('../data/data_PXD006109/data_prosit_outlier.csv', index=False)
#
# dataframe = pd.read_csv('../archive_output/ISA/out_ISA_noc_prosit_0.csv')
# df2 = filter_outlier_rt(dataframe)
# df2.to_csv('../data/data_ISA/data_prosit_outlier.csv', index=False)
df
=
pd
.
read_csv
(
'
../data/data_PXD006109/data_prosit_outlier.csv
'
)
compute_peptide_properties
(
df
,
'
plasma_prosit_outlier
'
,
'
seq
'
,
'
num
'
)
df
=
pd
.
read_csv
(
'
../data/data_ISA/data_prosit_outlier.csv
'
)
compute_peptide_properties
(
df
,
'
ISA_prosit_outlier
'
,
'
seq
'
,
'
num
'
)
df
=
pd
.
read_csv
(
'
../data/data_ISA/data_isa.csv
'
)
compute_peptide_properties
(
df
,
'
ISA
'
,
'
sequence
'
)
df
=
pd
.
read_csv
(
'
../data/data_prosit/data.csv
'
)
compute_peptide_properties
(
df
,
'
prosit
'
,
'
sequence
'
)
df
=
pd
.
read_csv
(
'
../data/data_PXD006109/plasma/data_plasma.csv
'
)
compute_peptide_properties
(
df
,
'
plasma
'
,
'
sequence
'
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
main.py
+
1
−
1
View file @
34a96c5a
...
...
@@ -106,7 +106,7 @@ def main(args):
embedding_dim
=
args
.
embedding_dim
,
acti
=
args
.
activation
,
norm
=
args
.
norm_first
)
if
args
.
model_weigh
is
not
None
:
model
.
load_state_dict
(
torch
.
load
(
args
.
model_weigh
+
'
.pt
'
,
weights_only
=
True
))
model
.
load_state_dict
(
torch
.
load
(
args
.
model_weigh
,
weights_only
=
True
))
if
torch
.
cuda
.
is_available
():
model
=
model
.
cuda
()
...
...
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