Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LC-MS-RT-prediction
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
LC-MS-RT-prediction
Commits
cb1e60af
Commit
cb1e60af
authored
7 months ago
by
Schneider Leo
Browse files
Options
Downloads
Patches
Plain Diff
datasets
parent
bea45844
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common_dataset.py
+14
-15
14 additions, 15 deletions
common_dataset.py
main_custom.py
+1
-0
1 addition, 0 deletions
main_custom.py
with
15 additions
and
15 deletions
common_dataset.py
+
14
−
15
View file @
cb1e60af
...
@@ -165,18 +165,17 @@ def load_data(path_train, path_val, path_test, batch_size, length, pad=False, co
...
@@ -165,18 +165,17 @@ def load_data(path_train, path_val, path_test, batch_size, length, pad=False, co
return
train_loader
,
val_loader
,
test_loader
return
train_loader
,
val_loader
,
test_loader
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
pass
irt_train
=
np
.
load
(
'
data/intensity/irt_train.npy
'
)
# irt_train = np.load('data/intensity/irt_train.npy')
seq_train
=
np
.
load
(
'
data/intensity/sequence_train.npy
'
)
# seq_train = np.load('data/intensity/sequence_train.npy')
charge_train
=
np
.
load
(
'
data/intensity/precursor_charge_train.npy
'
)
# charge_train = np.load('data/intensity/precursor_charge_train.npy')
spectra_train
=
np
.
load
(
'
data/intensity/intensity_train.npy
'
)
# spectra_train = np.load('data/intensity/intensity_train.npy')
#
irt_holdout
=
np
.
load
(
'
data/intensity/irt_holdout.npy
'
)
# irt_holdout = np.load('data/intensity/irt_holdout.npy')
seq_holdout
=
np
.
load
(
'
data/intensity/sequence_holdout.npy
'
)
# seq_holdout = np.load('data/intensity/sequence_holdout.npy')
charge_holdout
=
np
.
load
(
'
data/intensity/precursor_charge_holdout.npy
'
)
# charge_holdout = np.load('data/intensity/precursor_charge_holdout.npy')
spectra_holdout
=
np
.
load
(
'
data/intensity/intensity_holdout.npy
'
)
# spectra_holdout = np.load('data/intensity/intensity_holdout.npy')
#
dataset_train
=
pd
.
DataFrame
({
'
Sequence
'
:
list
(
seq_train
),
'
Retention time
'
:
list
(
irt_train
),
'
Charge
'
:
list
(
charge_train
),
'
Spectra
'
:
list
(
spectra_train
)},
index
=
list
(
range
(
6787933
)))
# dataset_train = pd.DataFrame({'Sequence':list(seq_train), 'Retention time':list(irt_train), 'Charge':list(charge_train), 'Spectra' : list(spectra_train)},index=list(range(6787933)))
dataset_train
.
to_pickle
(
'
database/data_prosit_merged_train.pkl
'
)
# dataset_train.to_pickle('database/data_prosit_merged_train.pkl')
dataset_test
=
pd
.
DataFrame
({
'
Sequence
'
:
list
(
seq_holdout
),
'
Retention time
'
:
list
(
irt_holdout
),
'
Charge
'
:
list
(
charge_holdout
),
'
Spectra
'
:
list
(
spectra_holdout
)},
index
=
list
(
range
(
754215
)))
# dataset_test = pd.DataFrame({'Sequence':list(seq_holdout), 'Retention time':list(irt_holdout), 'Charge':list(charge_holdout), 'Spectra' : list(spectra_holdout)},index=list(range(754215)))
dataset_test
.
to_pickle
(
'
database/data_prosit_merged_holdout.pkl
'
)
# dataset_test.to_pickle('database/data_prosit_merged_holdout.pkl')
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
main_custom.py
+
1
−
0
View file @
cb1e60af
...
@@ -26,6 +26,7 @@ def train(model, data_train, epoch, optimizer, criterion_rt, criterion_intensity
...
@@ -26,6 +26,7 @@ def train(model, data_train, epoch, optimizer, criterion_rt, criterion_intensity
param
.
requires_grad
=
True
param
.
requires_grad
=
True
if
forward
==
'
both
'
:
if
forward
==
'
both
'
:
for
seq
,
charge
,
rt
,
intensity
in
data_train
:
for
seq
,
charge
,
rt
,
intensity
in
data_train
:
print
(
seq
,
charge
,
rt
,
intensity
)
rt
,
intensity
=
rt
.
float
(),
intensity
.
float
()
rt
,
intensity
=
rt
.
float
(),
intensity
.
float
()
if
torch
.
cuda
.
is_available
():
if
torch
.
cuda
.
is_available
():
seq
,
charge
,
rt
,
intensity
=
seq
.
cuda
(),
charge
.
cuda
(),
rt
.
cuda
(),
intensity
.
cuda
()
seq
,
charge
,
rt
,
intensity
=
seq
.
cuda
(),
charge
.
cuda
(),
rt
.
cuda
(),
intensity
.
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