Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ms2.py update sliced fragment dataframe bug #224

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CRYoushiwo
Copy link

@CRYoushiwo CRYoushiwo commented Dec 18, 2024

Before Revise
in ms2.py:
628 update_sliced_fragment_dataframe(
629 self.predict_df,
630 self.predict_df.to_numpy(copy=True),
631 predicts.reshape((-1, len(self.charged_frag_types))),
632 batch_df[["frag_start_idx", "frag_stop_idx"]].values,
633 )

running:

pdeep.train(psm_df, fragment_inten_df, 
    warmup_epoch=1, epoch=2, batch_size=512, lr=1e-4,
    verbose=True,
    verbose_each_epoch=True
)
predict_inten_df = pdeep.predict(psm_df, reference_frag_df=fragment_inten_df, verbose=True)
df, metrics = calc_ms2_similarity(psm_df, predict_inten_df, fragment_inten_df, pdeep.charged_frag_types, verbose=True)

metrics =

PCC COS SA SPC
count 741510.00 741510.00 741510.00 741510.00
mean 0.00 0.00 0.00 -0.022181
std 0.00 0.00 0.00 0.195575
min 0.00 0.00 0.00 -0.821355
25% 0.00 0.00 0.00 -0.176919
50% 0.00 0.00 0.00 -0.009774
75% 0.00 0.00 0.00 0.134845
max 0.00 0.00 0.00 0.669911
>0.90 0.00 0.00 0.00 0.000000
>0.75 0.00 0.00 0.00 0.000000

After Revise
in ms2.py:
628 update_sliced_fragment_dataframe(
629 self.predict_df,
630 self.predict_df.to_numpy(),
631 predicts.reshape((-1, len(self.charged_frag_types))),
632 batch_df[["frag_start_idx", "frag_stop_idx"]].values,
633 )

running:

pdeep.train(psm_df, fragment_inten_df, 
    warmup_epoch=1, epoch=2, batch_size=512, lr=1e-4,
    verbose=True,
    verbose_each_epoch=True
)
predict_inten_df = pdeep.predict(psm_df, reference_frag_df=fragment_inten_df, verbose=True)
df, metrics = calc_ms2_similarity(psm_df, predict_inten_df, fragment_inten_df, pdeep.charged_frag_types, verbose=True)

metrics =

PCC COS SA SPC
count 741510.00 741510.00 741510.00 741510.00
mean 0.572111 0.613076 0.442540 -0.135041
std 0.237287 0.216775 0.186603 0.193894
min -0.085739 0.003055 0.001945 -1.331361
25% 0.394702 0.453877 0.299919 -0.262786
50% 0.597644 0.640260 0.442347 -0.131268
75% 0.756201 0.780827 0.570404 0.003786
max 0.997808 0.997729 0.957086 0.451942
>0.90 0.071483 0.082213 0.004655 0.000000
>0.75 0.258934 0.308326 0.053810 0.000000

@mschwoer
Copy link
Contributor

mschwoer commented Dec 20, 2024

related to MannLabs/alphadia#409

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants