Skip to content

Commit

Permalink
Merge pull request #22 from bigbio/dev
Browse files Browse the repository at this point in the history
Minor changes
  • Loading branch information
ypriverol committed Aug 13, 2024
2 parents 1e24138 + 52858c5 commit 0af595a
Show file tree
Hide file tree
Showing 9 changed files with 35,237 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
*.tsv
*.csv
*_df.csv
*.tsv
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "quantms-utils"
version = "0.0.2"
version = "0.0.7"
description = "Python scripts and helpers for the quantMS workflow"
authors = ["Yasset Perez-Riverol", "Dai Chengxin"]
packages = [
Expand Down
2 changes: 1 addition & 1 deletion quantmsutils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.6"
__version__ = "0.0.7"
12 changes: 6 additions & 6 deletions quantmsutils/diann/diann2mztab.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def diann2mztab(
:param ctx: Click context
:param folder: DiannConvert specifies the folder where the required file resides. The folder contains
the DiaNN main report, protein matrix, precursor matrix, experimental design file, protein sequence
FASTA file, version file of DiaNN and ms_info TSVs
FASTA file, version file of DiaNN and ms_info parquet
:param exp_design: Experimental design file
:param dia_params: A list contains DIA parameters
:type dia_params: list
Expand Down Expand Up @@ -342,7 +342,7 @@ def fasta(self) -> os.PathLike:

@property
def ms_info(self) -> os.PathLike:
return self.find_first_file_with_suffix("ms_info.tsv")
return self.find_first_file_with_suffix("ms_info.parquet")

@property
def diann_version(self) -> str:
Expand Down Expand Up @@ -1064,7 +1064,7 @@ def mztab_psh(report, folder, database):
:type report: pandas.core.frame.DataFrame
:param folder: DiannConvert specifies the folder where the required file resides. The folder contains
the DiaNN main report, protein matrix, precursor matrix, experimental design file, protein sequence
FASTA file, version file of DiaNN and ms_info TSVs
FASTA file, version file of DiaNN and ms_info parquet
:type folder: str
:param database: Path to fasta file
:type database: str
Expand All @@ -1075,8 +1075,8 @@ def mztab_psh(report, folder, database):

def __find_info(directory, n):
# This line matches n="220101_myfile", folder="." to
# "myfolder/220101_myfile_ms_info.tsv"
files = list(Path(directory).rglob(f"{n}_ms_info.tsv"))
# "myfolder/220101_myfile_ms_info.parquet"
files = list(Path(directory).rglob(f"{n}_ms_info.parquet"))
# Check that it matches one and only one file
if not files:
raise ValueError(f"Could not find {n} info file in {directory}")
Expand All @@ -1094,7 +1094,7 @@ def __find_info(directory, n):
n = n[0]

file = __find_info(folder, n)
target = pd.read_csv(file, sep="\t")
target = pd.read_parquet(file)
group.sort_values(by="RT.Start", inplace=True)
target = target[["Retention_Time", "SpectrumID", "Exp_Mass_To_Charge"]]
target.columns = [
Expand Down
1 change: 1 addition & 0 deletions quantmsutils/rescoring/ms2rescore.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ def ms2rescore(
):
"""
Rescore PSMs in an idXML file and keep other information unchanged.
:param ms2pip_model_dir: Folder for models.
:param ctx: Click context object
:param psm_file: PSM file (idXML)
:param spectrum_path: Spectrum file or dictionary with spectrum files (MGF/mzML)
Expand Down
9 changes: 9 additions & 0 deletions tests/test_data/diann2mztab/PXD026600.sdrf_openms_design.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Fraction_Group Fraction Spectra_Filepath Label Sample
1 1 RD139_Narrow_UPS1_0_1fmol_inj1.mzML 1 1
2 1 RD139_Narrow_UPS1_0_1fmol_inj2.mzML 1 1
3 1 RD139_Narrow_UPS1_0_25fmol_inj1.mzML 1 2
4 1 RD139_Narrow_UPS1_0_25fmol_inj2.mzML 1 2

Sample MSstats_Condition MSstats_BioReplicate
1 CT=Mixture;CN=UPS1;QY=0.1 fmol 1
2 CT=Mixture;CN=UPS1;QY=0.25 fmol 2
1,530 changes: 1,530 additions & 0 deletions tests/test_data/diann2mztab/diann_report.pg_matrix.tsv

Large diffs are not rendered by default.

6,790 changes: 6,790 additions & 0 deletions tests/test_data/diann2mztab/diann_report.pr_matrix.tsv

Large diffs are not rendered by default.

26,898 changes: 26,898 additions & 0 deletions tests/test_data/diann2mztab/diann_report.tsv

Large diffs are not rendered by default.

0 comments on commit 0af595a

Please sign in to comment.