Skip to content

Commit

Permalink
seems scout is working
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafakalhor committed Apr 27, 2024
1 parent 4d8e00b commit 5f64471
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion oktoberfest/predict/koina.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ def __predict_async(self, data: Dict[str, np.ndarray], debug=False) -> Dict[str,

unfinished_tasks = new_unfinished_tasks
pbar.refresh()

return self.__handle_results(infer_results, debug)

def __handle_results(
Expand Down
5 changes: 2 additions & 3 deletions oktoberfest/predict/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,16 @@ def _prepare_alignment_df(
:param xl: if true, select the top 50 spectra for cross-linked peptide
:return: a library that is modified according to the description above
"""
top_n = 1000 if not xl else 50
top_n = 1000 if not xl else 20
hcd_targets = library.obs.query("(FRAGMENTATION == 'HCD') & ~REVERSE")
hcd_targets = hcd_targets.sort_values(by="SCORE", ascending=False)
if group_by_charge:
hcd_targets = hcd_targets.groupby("PRECURSOR_CHARGE")
top_hcd_targets = hcd_targets.head(top_n)

top_n= len(top_hcd_targets)
alignment_library = library[top_hcd_targets.index]
alignment_library = Spectra(anndata.concat([alignment_library for _ in range(*ce_range)]))
alignment_library.obs.reset_index(inplace=True)

alignment_library.obs["ORIG_COLLISION_ENERGY"] = alignment_library.obs["COLLISION_ENERGY"]
alignment_library.obs["COLLISION_ENERGY"] = np.repeat(range(*ce_range), top_n)

Expand Down
2 changes: 1 addition & 1 deletion oktoberfest/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _annotate_and_get_library(spectra_file: Path, config: Config, tims_meta_file
def _get_best_ce(library: Spectra, spectra_file: Path, config: Config):
results_dir = config.output / "results"
results_dir.mkdir(exist_ok=True)
if (library.obs["FRAGMENTATION"] == "HCD").any():
if ((library.obs["FRAGMENTATION"] == "HCD") & (library.obs["REVERSE"] == False)).any():
server_kwargs = {
"server_url": config.prediction_server,
"ssl": config.ssl,
Expand Down

0 comments on commit 5f64471

Please sign in to comment.