Skip to content

Commit

Permalink
Merge pull request #21 from bigbio/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ypriverol committed Aug 13, 2024
2 parents b2ffe2c + f2751fb commit 1e24138
Show file tree
Hide file tree
Showing 8 changed files with 29,255 additions and 0 deletions.
8 changes: 8 additions & 0 deletions quantmsutils/features/snr.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def spectrum2feature(ctx, ms_path: str, idxml: str, output: str) -> None:
peptide_ids = []
oms.IdXMLFile().load(idxml, protein_ids, peptide_ids)

result_peptides = []
for peptide in peptide_ids:
spectrum_reference = peptide.getMetaValue("spectrum_reference")
scan_number = int(
Expand Down Expand Up @@ -88,6 +89,13 @@ def spectrum2feature(ctx, ms_path: str, idxml: str, output: str) -> None:
hit.setMetaValue("quantms:SpectralEntropy", str(spectral_entropy))
hit.setMetaValue("quantms:FracTICinTop10Peaks", str(fraction_tic_top_10))
hit.setMetaValue("quantms:WeightedStdMz", str(weighted_std_mz))

# update hit in peptidehits list
peptide.setHits([hit])
## update peptide in peptide_ids list
result_peptides.append(peptide)


except IndexError:
message = "scan_number" + str(scan_number) + "not found in file: " + ms_path
print(message)
Expand Down
16 changes: 16 additions & 0 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@ def test_spectrum2fature_file():

assert result.exit_code == 0

def test_diann2mztab_example():
runner = CliRunner()
result = runner.invoke(
cli, [
"diann2mztab",
"--folder", "tests/test_data/diann2mztab/",
"--exp_design", "tests/test_data/diann2mztab/PXD026600.sdrf_openms_design.tsv",
"--diann_version", "tests/test_data/diann2mztab/versions.yml",
"--dia_params", "20.0;ppm;10.0;ppm;Trypsin;Carbamidomethyl (C);Oxidation (M)",
"--charge", "3",
"--missed_cleavages", "1",
"--qvalue_threshold", "0.01"
],
)
assert result.exit_code == 0


# test for the convert_psm command in cli
def test_convert_psm_help():
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
29,229 changes: 29,229 additions & 0 deletions tests/test_data/diann2mztab/REF_EColi_K12_UPS1_combined.fasta

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tests/test_data/diann2mztab/versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"NFCORE_QUANTMS:QUANTMS:DIA:DIANNSUMMARY":
DIA-NN: 1.8.1

0 comments on commit 1e24138

Please sign in to comment.