@@ -41,7 +41,7 @@ def configure_logger(lg: logging.Logger) -> None:
41
41
42
42
class Irt_choice (enum .Enum ):
43
43
no_iRT = enum .auto ()
44
- iRT = enum .auto ()
44
+ Biognosys_iRT = enum .auto ()
45
45
ciRT = enum .auto ()
46
46
Pierce_iRT = enum .auto ()
47
47
userRT = enum .auto ()
@@ -74,7 +74,7 @@ def resolve_mapped(path) -> str:
74
74
if len (sys .argv ) >= 9 :
75
75
rta , ima = sys .argv [8 ].split (os .pathsep )
76
76
no_iRT = rta .casefold () == 'noirt'
77
- is_iRT = rta .casefold () == 'irt'
77
+ is_Biognosys_iRT = rta .casefold () == 'Biognosys_iRT' . casefold ()
78
78
is_ciRT = rta .casefold () == 'cirt'
79
79
is_Pierce_iRT = rta .casefold () == 'Pierce_iRT' .casefold ()
80
80
is_userRT = pathlib .Path (rta ).exists ()
@@ -83,7 +83,7 @@ def resolve_mapped(path) -> str:
83
83
is_userIM = pathlib .Path (ima ).exists ()
84
84
userIM_file = pathlib .Path (ima ).resolve (strict = True ) if is_userIM else None
85
85
irt_choice = Irt_choice .no_iRT if no_iRT else \
86
- Irt_choice .iRT if is_iRT else \
86
+ Irt_choice .Biognosys_iRT if is_Biognosys_iRT else \
87
87
Irt_choice .ciRT if is_ciRT else \
88
88
Irt_choice .Pierce_iRT if is_Pierce_iRT else \
89
89
Irt_choice .userRT if userRT_file else \
@@ -427,15 +427,11 @@ def get_pep_ion_minprob(opt: Filter_option, philosopher_filter_log: str = None):
427
427
# 'im':
428
428
})
429
429
for i in range (1 , 8 )]
430
- irt_df = pd .concat (dd ).reset_index (drop = True )
430
+ Biognosys_iRT_df = pd .concat (dd ).reset_index (drop = True )
431
+
431
432
irt_file = workdir / 'irt.tsv'
432
433
im_file = workdir / 'im.tsv'
433
- '''easypqp convert --pepxml 1.pep_xml --spectra 1.mgf --exclude-range -1.5,3.5
434
- easypqp convert --pepxml 2.pep_xml --spectra 2.mgf --exclude-range -1.5,3.5'''
435
- 'easypqp convert --pepxml interact.pep.xml --spectra 1.mgf --unimod unimod.xml --exclude-range -1.5,3.5'
436
- f'easypqp library --psmtsv { psm_tsv_file } --rt_reference { irt_file } --out out.tsv *.psmpkl *.peakpkl'
437
- # https://github.com/grosenberger/easypqp/blob/master/easypqp/data/unimod.xml?raw=true
438
- # http://www.unimod.org/xml/unimod.xml
434
+
439
435
from typing import List
440
436
def pairing_pepxml_spectra_v3 (spectras : List [pathlib .PurePath ], pep_xmls : List [pathlib .PurePath ]):
441
437
rec = re .compile ('(.+?)(?:_(?:un)?calibrated)?' )
@@ -471,6 +467,8 @@ def get_rank(name):
471
467
use_iRT = irt_choice is not Irt_choice .no_iRT
472
468
use_im = im_choice is not Im_choice .no_im
473
469
filelist_arg = [resolve_mapped (filelist_easypqp_library )]
470
+
471
+
474
472
def easypqp_library_cmd (use_irt : bool , use_im : bool ):
475
473
return [resolve_mapped (easypqp ), 'library' ,
476
474
'--psmtsv' , resolve_mapped (psm_tsv_file ), '--peptidetsv' , resolve_mapped (peptide_tsv_file ), ] + \
@@ -547,20 +545,23 @@ def main_easypqp():
547
545
workdir .mkdir (exist_ok = overwrite )
548
546
output_directory = workdir / 'easypqp_files'
549
547
output_directory .mkdir (exist_ok = overwrite )
550
- if irt_choice is Irt_choice .iRT :
551
- irt_df .to_csv (irt_file , index = False , sep = '\t ' , lineterminator = '\n ' )
548
+ if irt_choice is Irt_choice .Biognosys_iRT :
549
+ Biognosys_iRT_df .to_csv (irt_file , index = False , sep = '\t ' , lineterminator = '\n ' )
552
550
elif irt_choice is Irt_choice .ciRT :
553
551
shutil .copyfile (script_dir / 'hela_irtkit.tsv' , irt_file )
554
552
elif irt_choice is Irt_choice .Pierce_iRT :
555
553
shutil .copyfile (script_dir / 'Pierce_iRT.tsv' , irt_file )
556
554
elif irt_choice is Irt_choice .userRT :
557
555
shutil .copyfile (userRT_file , irt_file )
556
+
558
557
if im_choice is Im_choice .userIM :
559
558
shutil .copyfile (userIM_file , im_file )
559
+
560
560
print (f'''Spectral library building
561
561
Commands to execute:
562
562
{ allcmds }
563
563
{ '~' * 69 } ''' , flush = True )
564
+
564
565
(output_directory / 'cmds.txt' ).write_text (allcmds )
565
566
subprocess .run ([os .fspath (easypqp ), '--version' ], check = True )
566
567
procs = []
0 commit comments