compomics / psm_utils

Common utilities for parsing and handling peptide-spectrum matches and search engine results in Python
https://psm-utils.readthedocs.io
Apache License 2.0
24 stars 6 forks source link

Question: Best way to get seperate MSGF+ results (for target and decoy) to one psm_list #67

Closed JannikSchneider12 closed 6 months ago

JannikSchneider12 commented 7 months ago

Hello everyone,

I have the problem that I want to get my MSGF+ results to one psm_list. I have two searches, one target only and one decoy only because otherways I can't include decoys in the results. So I have two mzid files. I could pass them via the read_file function, but then I don't know if I can merge them to one psm_list. The other possibility that I tried was using the msgf2pin function from percolator to create one tsv file out of the two mzid files, but then the read_file function yields an error.

Does someone has a solution or can help?

Thanks for your time and help

RalfG commented 7 months ago

Hi Jannik,

You should be able to merge the two PSM lists with the + operator. So simply read both files into PSMLists and then sum them. For instance:

from psm_utils.io import read_file
target_psms = read_file(...)
decoy_psms = read_file(...)

all_psms = target_psms + decoy_psms

psm_utils should also be able to read PIN files from msgf2pin. What error was produced when you tried to read the merged pin file?