Skip to content

Commit

Permalink
Change "iRT" to "Biognosys_iRT" to make the meaning clear.
Browse files Browse the repository at this point in the history
  • Loading branch information
fcyu committed Sep 29, 2023
1 parent 135f29b commit 9737388
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private JPanel createPanelEasypqp() {

final String optionAuto = "Automatic selection of a run as reference RT";
final String optionManual = "User provided RT calibration file";
pqpCal = Arrays.asList(optionAuto, "iRT", "ciRT", "Pierce_iRT", optionManual);
pqpCal = Arrays.asList(optionAuto, "Biognosys_iRT", "ciRT", "Pierce_iRT", optionManual);
pqpType = Arrays.asList(EASYPQP_TIMSTOF, "non-timsTOF");

uiComboPqpCal = UiUtils.createUiCombo(pqpCal);
Expand Down Expand Up @@ -406,7 +406,7 @@ public String getEasypqpDataType() {
}

public String getEasypqpCalOption() {
return new String[]{"noiRT", "iRT", "ciRT", "Pierce_iRT", "a tsv file"}[uiComboPqpCal.getSelectedIndex()];
return new String[]{"noiRT", "Biognosys_iRT", "ciRT", "Pierce_iRT", "a tsv file"}[uiComboPqpCal.getSelectedIndex()];
}
public String getEasypqpIMCalOption() {
return new String[]{"noIM", "a tsv file"}[uiComboPqpIMCal.getSelectedIndex()];
Expand Down
2 changes: 1 addition & 1 deletion MSFragger-GUI/src/com/dmtavt/fragpipe/ui.translations
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ ptmshepherd.precursor_mass_units :: Da <=> 0
speclibgen.easypqp.data-type :: timsTOF <=> timsTOF
speclibgen.easypqp.data-type :: non-timsTOF <=> non-timsTOF
speclibgen.easypqp.rt-cal :: Automatic selection of a run as reference RT <=> noiRT
speclibgen.easypqp.rt-cal :: iRT <=> iRT
speclibgen.easypqp.rt-cal :: Biognosys_iRT <=> Biognosys_iRT
speclibgen.easypqp.rt-cal :: ciRT <=> ciRT
speclibgen.easypqp.rt-cal :: Pierce_iRT <=> Pierce_iRT
speclibgen.easypqp.rt-cal :: User provided RT calibration file <=> a tsv file
Expand Down
25 changes: 13 additions & 12 deletions MSFragger-GUI/tools/speclib/gen_con_spec_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def configure_logger(lg: logging.Logger) -> None:

class Irt_choice(enum.Enum):
no_iRT = enum.auto()
iRT = enum.auto()
Biognosys_iRT = enum.auto()
ciRT = enum.auto()
Pierce_iRT = enum.auto()
userRT = enum.auto()
Expand Down Expand Up @@ -74,7 +74,7 @@ def resolve_mapped(path) -> str:
if len(sys.argv) >= 9:
rta, ima = sys.argv[8].split(os.pathsep)
no_iRT = rta.casefold() == 'noirt'
is_iRT = rta.casefold() == 'irt'
is_Biognosys_iRT = rta.casefold() == 'Biognosys_iRT'.casefold()
is_ciRT = rta.casefold() == 'cirt'
is_Pierce_iRT = rta.casefold() == 'Pierce_iRT'.casefold()
is_userRT = pathlib.Path(rta).exists()
Expand All @@ -83,7 +83,7 @@ def resolve_mapped(path) -> str:
is_userIM = pathlib.Path(ima).exists()
userIM_file = pathlib.Path(ima).resolve(strict=True) if is_userIM else None
irt_choice = Irt_choice.no_iRT if no_iRT else \
Irt_choice.iRT if is_iRT else \
Irt_choice.Biognosys_iRT if is_Biognosys_iRT else \
Irt_choice.ciRT if is_ciRT else \
Irt_choice.Pierce_iRT if is_Pierce_iRT else \
Irt_choice.userRT if userRT_file else \
Expand Down Expand Up @@ -427,15 +427,11 @@ def get_pep_ion_minprob(opt: Filter_option, philosopher_filter_log: str = None):
# 'im':
})
for i in range(1, 8)]
irt_df = pd.concat(dd).reset_index(drop=True)
Biognosys_iRT_df = pd.concat(dd).reset_index(drop=True)

irt_file = workdir / 'irt.tsv'
im_file = workdir / 'im.tsv'
'''easypqp convert --pepxml 1.pep_xml --spectra 1.mgf --exclude-range -1.5,3.5
easypqp convert --pepxml 2.pep_xml --spectra 2.mgf --exclude-range -1.5,3.5'''
'easypqp convert --pepxml interact.pep.xml --spectra 1.mgf --unimod unimod.xml --exclude-range -1.5,3.5'
f'easypqp library --psmtsv {psm_tsv_file} --rt_reference {irt_file} --out out.tsv *.psmpkl *.peakpkl'
# https://github.com/grosenberger/easypqp/blob/master/easypqp/data/unimod.xml?raw=true
# http://www.unimod.org/xml/unimod.xml

from typing import List
def pairing_pepxml_spectra_v3(spectras: List[pathlib.PurePath], pep_xmls: List[pathlib.PurePath]):
rec = re.compile('(.+?)(?:_(?:un)?calibrated)?')
Expand Down Expand Up @@ -471,6 +467,8 @@ def get_rank(name):
use_iRT = irt_choice is not Irt_choice.no_iRT
use_im = im_choice is not Im_choice.no_im
filelist_arg = [resolve_mapped(filelist_easypqp_library)]


def easypqp_library_cmd(use_irt: bool, use_im: bool):
return [resolve_mapped(easypqp), 'library',
'--psmtsv', resolve_mapped(psm_tsv_file), '--peptidetsv', resolve_mapped(peptide_tsv_file), ] + \
Expand Down Expand Up @@ -547,20 +545,23 @@ def main_easypqp():
workdir.mkdir(exist_ok=overwrite)
output_directory = workdir / 'easypqp_files'
output_directory.mkdir(exist_ok=overwrite)
if irt_choice is Irt_choice.iRT:
irt_df.to_csv(irt_file, index=False, sep='\t', lineterminator='\n')
if irt_choice is Irt_choice.Biognosys_iRT:
Biognosys_iRT_df.to_csv(irt_file, index=False, sep='\t', lineterminator='\n')
elif irt_choice is Irt_choice.ciRT:
shutil.copyfile(script_dir / 'hela_irtkit.tsv', irt_file)
elif irt_choice is Irt_choice.Pierce_iRT:
shutil.copyfile(script_dir / 'Pierce_iRT.tsv', irt_file)
elif irt_choice is Irt_choice.userRT:
shutil.copyfile(userRT_file, irt_file)

if im_choice is Im_choice.userIM:
shutil.copyfile(userIM_file, im_file)

print(f'''Spectral library building
Commands to execute:
{allcmds}
{'~' * 69}''', flush=True)

(output_directory / 'cmds.txt').write_text(allcmds)
subprocess.run([os.fspath(easypqp), '--version'], check=True)
procs = []
Expand Down

0 comments on commit 9737388

Please sign in to comment.