Skip to content

Commit

Permalink
Merge pull request #328 from theGreatHerrLebert/feature/timsim-gui
Browse files Browse the repository at this point in the history
Feature/timsim gui
  • Loading branch information
theGreatHerrLebert authored Feb 21, 2025
2 parents a22ccb4 + 847bb6b commit 68d6d8c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
14 changes: 8 additions & 6 deletions imspy/imspy/timstof/dbsearch/imspy_dda.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def main():
parser.set_defaults(c_terminal=None)

parser.add_argument("--calibrate_mz", dest="calibrate_mz", action="store_true", help="Calibrate mz (default: False)")
parser.set_defaults(calibrate_mz=None)

parser.add_argument(
"--no_decoys",
Expand Down Expand Up @@ -314,6 +315,7 @@ def main():
parser.add_argument("--tims2rescore_table", dest="tims2rescore_table", action="store_true", help="Write PSM table that can be passed to tims2rescore")
parser.set_defaults(tims2rescore_table=None)
parser.add_argument("--use_mgf", action="store_true", help="Use Bruker DataAnalysis parsed MGF files stored in the .d folders instead of raw data.")
parser.set_defaults(use_mgf=None)

args = parser.parse_args()

Expand Down Expand Up @@ -411,7 +413,9 @@ def main():
for file in dirs:
if file.endswith(".d"):
path = os.path.join(root, file)
if args.use_mgf:
if params['use_mgf']:
if args.verbose:
print(f"Looking for mgf in folder `{path}` ...")
mgf_path = None
mgf_path_cnt = 0
for potential_mgf_path in Path(path).iterdir():
Expand All @@ -422,8 +426,6 @@ def main():
mgfs.append(mgf_path)
paths.append(path)



# Get the write folder path
write_folder_path = str(Path(args.path))

Expand Down Expand Up @@ -563,7 +565,7 @@ def main():

fragments = None

if args.use_mgf:
if params['use_mgf']:
mgf_path = mgfs[file_id]
fragments = mgf_to_sagepy_query(mgf_path, top_n=params['take_top_n'])
else:
Expand Down Expand Up @@ -659,13 +661,13 @@ def main():

psm_dict = scorer.score_collection_psm(
db=indexed_db,
spectrum_collection=fragments if args.use_mgf else fragments['processed_spec'].values,
spectrum_collection=fragments if params['use_mgf'] else fragments['processed_spec'].values,
num_threads=params['num_threads'],
)

if params['calibrate_mz']:

if args.use_mgf:
if params['use_mgf']:
raise NotImplementedError("Mass calibration is not yet supported in --use_mgf mode.")

if args.verbose:
Expand Down
4 changes: 2 additions & 2 deletions imspy/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "imspy"
version = "0.3.12"
version = "0.3.13"
description = ""
authors = [
{ name = "theGreatHerrLebert", email = "davidteschner@googlemail.com" }
Expand All @@ -19,7 +19,7 @@ dependencies = [
"wandb>=0.12.1",
"mokapot>=0.10.0",
"sagepy>=0.3.8",
"imspy-connector>=0.3.12",
"imspy-connector>=0.3.13",
"scipy>=1.7.1",
"tqdm>=4.66",
"pyarrow>=13.0",
Expand Down
2 changes: 1 addition & 1 deletion imspy_connector/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "imspy-connector"
version = "0.3.12"
version = "0.3.13"
edition = "2021"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion imspy_connector/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "imspy_connector"
dependencies = [
"opentims-bruker-bridge>=1.1.0",
]
version = "0.3.12"
version = "0.3.13"
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Rust",
Expand Down

0 comments on commit 68d6d8c

Please sign in to comment.