Skip to content

Commit

Permalink
constants.py created.
Browse files Browse the repository at this point in the history
  • Loading branch information
ypriverol committed Dec 2, 2024
1 parent 5b9ef64 commit b200964
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions quantmsutils/diann/diann2mztab.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from pyopenms import AASequence, FASTAFile, ModificationsDB
from pyopenms.Constants import PROTON_MASS_U

from quantmsutils.utils.constants import MS_LEVEL, RETENTION_TIME, SCAN, EXPERIMENTAL_MASS_TO_CHARGE

pd.set_option("display.max_rows", 500)
pd.set_option("display.max_columns", 500)
pd.set_option("display.width", 1000)
Expand Down Expand Up @@ -1097,11 +1099,14 @@ def __find_info(directory, n):

file = __find_info(folder, n)
target = pd.read_parquet(file)
target = target[target["MSLevel"] == 2]

# Read original parquet columns from mzml_stats
target = target[target[MS_LEVEL] == 2]
target.reset_index(inplace=True, drop=True)
target["DIANN-intraID"] = target.index
group.sort_values(by="RT", inplace=True)
target = target[["Retention_Time", "SpectrumID", "DIANN-intraID", "Exp_Mass_To_Charge"]]
group.sort_values(by=RETENTION_TIME, inplace=True)
target = target[[RETENTION_TIME, SCAN, "DIANN-intraID", EXPERIMENTAL_MASS_TO_CHARGE]]

target.columns = [
"RT",
"opt_global_spectrum_reference",
Expand Down

0 comments on commit b200964

Please sign in to comment.