Repository: matchms/matchms

Issue:
Allow appending to file in export functions
**Is your feature request related to a problem? Please describe.**
When writing spectra to a file, it is currently only possible in `write` fashion, not in append - therefore appending spectral information to an already existing library is not so easy if one doesn't want to read the library into memory.

This could also be used for streaming output

**Describe the solution you'd like**
Add the flags for opening the file as read/write/append as parameter to the export function (write as default).

Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 02fc8eab..c808299e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,8 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+## [0.17.0] - 2022-08-23
+
 ### Added
 - `Scores`: added functionality for writing and reading `Scores` objects to/from disk as JSON and Pickle files [#353](https://github.com/matchms/matchms/pull/353)
+- `save_as_msp()` now has a `mode` option (write/append) [#346](https://github.com/matchms/matchms/pull/346)
 
 ## [0.16.0] - 2022-06-12
 
@@ -442,7 +445,8 @@ Contains three plot types: `plot_spectrum()` or `spectrum.plot()`, `plot_spectra
 - This is the initial version of Spec2Vec from https://github.com/iomega/Spec2Vec
 - (later splitted into matchms + spec2vec)
 
-[Unreleased]: https://github.com/matchms/matchms/compare/0.16.0...HEAD
+[Unreleased]: https://github.com/matchms/matchms/compare/0.17.0...HEAD
+[0.17.0]: https://github.com/matchms/matchms/compare/0.16.0...0.17.0
 [0.16.0]: https://github.com/matchms/matchms/compare/0.15.0...0.16.0
 [0.15.0]: https://github.com/matchms/matchms/compare/0.14.0...0.15.0
 [0.14.0]: https://github.com/matchms/matchms/compare/0.13.0...0.14.0
diff --git a/matchms/__version__.py b/matchms/__version__.py
index 8911e95c..435d64bd 100644
--- a/matchms/__version__.py
+++ b/matchms/__version__.py
@@ -1,1 +1,1 @@
-__version__ = '0.16.0'
+__version__ = '0.17.0'
diff --git a/matchms/exporting/save_as_msp.py b/matchms/exporting/save_as_msp.py
index 2c457f2d..fc9cbddf 100644
--- a/matchms/exporting/save_as_msp.py
+++ b/matchms/exporting/save_as_msp.py
@@ -12,7 +12,8 @@ _extentions_not_allowed = ["mzml", "mzxml", "json", "mgf"]
 
 
 def save_as_msp(spectrums: List[Spectrum], filename: str,
-                write_peak_comments: bool = True):
+                write_peak_comments: bool = True,
+                mode: str = "a"):
     """Save spectrum(s) as msp file.
 
     :py:attr:`~matchms.Spectrum.losses` of spectrum will not be saved.
@@ -44,6 +45,8 @@ def save_as_msp(spectrums: List[Spectrum], filename: str,
     write_peak_comments:
         Writes peak comments to individual peaks after the respective mz/intensity pair
         when set to True. Default is True.
+    mode:
+        Mode on how to write to file. One of ["w", "a"] (write/append). Default is append.
     """
     file_extension = filename.split(".")[-1]
     assert file_extension.lower() not in _extentions_not_allowed, \
@@ -53,7 +56,7 @@ def save_as_msp(spectrums: List[Spectrum], filename: str,
                        filename.split(".")[-1])
     spectrums = _ensure_list(spectrums)
 
-    with open(filename, "w", encoding="utf-8") as outfile:
+    with open(filename, mode, encoding="utf-8") as outfile:
         for spectrum in spectrums:
             _write_spectrum(spectrum, outfile, write_peak_comments)
 
diff --git a/setup.cfg b/setup.cfg
index eb894667..0dad9c3d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 0.16.0
+current_version = 0.17.0
 
 [bumpversion:file:matchms/__version__.py]
 search = __version__ = '{current_version}'


Test patch:
diff --git a/tests/gnps_spectra.json b/tests/gnps_spectra.json
new file mode 100644
index 00000000..8cf78d88
--- /dev/null
+++ b/tests/gnps_spectra.json
@@ -0,0 +1,495 @@
+[
+    {
+        "spectrum_id": "CCMSLIB00000001547",
+        "source_file": "130618_Ger_Jenia_WT-3-Des-MCLR_MH981.4-qb.1.1..mgf",
+        "task": "47daa4396adb426eaa5fa54b6ce7dd5f",
+        "scan": "1",
+        "ms_level": "2",
+        "library_membership": "GNPS-LIBRARY",
+        "spectrum_status": "1",
+        "peaks_json": "[[289.286377,8068.000000],[295.545288,22507.000000],[298.489624,3925.000000],[317.324951,18742.000000],[319.655945,8604.000000],[324.482422,8041.000000],[325.316284,9738.000000],[339.789429,16145.000000],[343.947021,18094.000000],[347.020508,13981.000000],[347.913391,6765.000000],[361.147705,11763.000000],[361.844360,24296.000000],[364.232727,2346.000000],[364.858154,10782.000000],[365.845886,10242.000000],[368.221680,12761.000000],[368.965698,19147.000000],[375.069519,15644.000000],[375.751953,25393.000000],[382.750549,12765.000000],[384.197083,17912.000000],[390.574219,7993.000000],[394.049194,16135.000000],[397.106262,13986.000000],[404.420715,12326.000000],[411.092712,2348.000000],[413.784546,8715.000000],[427.667358,68137.000000],[436.192749,14879.000000],[443.266113,44427.000000],[446.267273,23472.000000],[447.747498,29292.000000],[455.250000,70939.000000],[456.107544,105392.000000],[456.822144,3.000000],[457.543213,12862.000000],[464.285461,8617.000000],[469.872314,87594.000000],[471.062195,31482.000000],[475.257324,15449.000000],[476.143616,23143.000000],[476.975159,28430.000000],[478.891113,27890.000000],[479.975952,33235.000000],[483.242432,13564.000000],[487.210388,32885.000000],[488.160156,20786.000000],[491.191956,55073.000000],[494.279602,7435.000000],[495.653992,32208.000000],[498.412964,11684.000000],[503.028198,30643.000000],[503.699951,2.000000],[504.344543,36421.000000],[505.154541,9667.000000],[510.176514,38891.000000],[512.168701,10175.000000],[513.265381,16524.000000],[514.957397,11384.000000],[515.922852,78764.000000],[520.973389,28857.000000],[521.823730,5810.000000],[523.168945,58926.000000],[529.036865,20722.000000],[530.991211,31845.000000],[532.376709,3005.000000],[534.575195,12906.000000],[538.003174,220949.000000],[539.217773,272296.000000],[540.672852,43876.000000],[548.061401,13655.000000],[554.117432,76225.000000],[556.030396,214421.000000],[557.288818,52970.000000],[557.996094,6202.000000],[559.942261,18112.000000],[561.328735,14656.000000],[564.123047,25971.000000],[564.948730,34630.000000],[566.439941,35564.000000],[571.333740,61305.000000],[572.047363,17235.000000],[575.219238,42127.000000],[575.888916,6.000000],[577.102905,29550.000000],[579.645874,7151.000000],[580.942627,17609.000000],[582.110107,102075.000000],[583.458984,10113.000000],[585.237061,36774.000000],[598.172485,26085.000000],[599.352783,764523.000000],[600.382812,114267.000000],[601.066650,4.000000],[602.267578,27144.000000],[609.302002,10247.000000],[613.415771,8621.000000],[622.208984,23787.000000],[623.023193,63940.000000],[623.991455,19154.000000],[625.216187,23050.000000],[638.299561,12481.000000],[640.265625,17392.000000],[641.235107,65873.000000],[646.095947,8409.000000],[649.277100,5446.000000],[651.526611,17521.000000],[657.128906,12911.000000],[658.094971,14824.000000],[659.420898,41969.000000],[663.387695,18284.000000],[668.332520,65700.000000],[669.357178,5671.000000],[680.219727,44374.000000],[681.987793,24446.000000],[685.957764,19166.000000],[691.648682,29177.000000],[693.225830,33545.000000],[694.307861,22539.000000],[696.332397,121211.000000],[697.127808,9503.000000],[709.464478,20171.000000],[710.795410,22346.000000],[711.744873,32675.000000],[714.071777,50487.000000],[715.578979,54567.000000],[716.216553,8.000000],[723.267822,14415.000000],[724.081909,88510.000000],[725.488892,8470.000000],[728.352051,21518.000000],[735.806396,52022.000000],[738.346680,2697.000000],[744.365234,16205.000000],[747.456055,19268.000000],[753.271240,14114.000000],[761.609131,12373.000000],[764.462158,19876.000000],[765.280029,18361.000000],[769.275635,41999.000000],[770.328613,16548.000000],[771.386353,13776.000000],[787.432617,33003.000000],[796.139526,9637.000000],[797.232788,11322.000000],[806.556885,18639.000000],[808.442383,6355.000000],[811.637329,14687.000000],[812.300049,9904.000000],[813.149292,15959.000000],[817.219238,7640.000000],[820.274048,6246.000000],[821.288208,15591.000000],[823.361328,13693.000000],[824.618286,6895.000000],[828.517456,32132.000000],[830.409302,102583.000000],[831.306763,65294.000000],[832.105469,9727.000000],[833.184570,4115.000000],[835.212891,7606.000000],[836.078247,8740.000000],[838.518677,26160.000000],[839.455811,72006.000000],[845.612915,21577.000000],[847.433594,196462.000000],[848.125854,39637.000000],[851.380859,246170.000000],[852.370605,276882.000000],[853.270508,44216.000000],[865.597900,44697.000000],[866.295654,111012.000000],[867.190430,4120.000000],[868.372192,78023.000000],[869.331177,8584.000000],[871.557007,5374.000000],[877.137451,30131.000000],[880.216553,5692.000000],[883.442261,49241.000000],[884.216553,8.000000],[888.167114,41037.000000],[889.282959,24795.000000],[892.127808,14925.000000],[893.467896,23506.000000],[895.607422,13123.000000],[899.010132,28633.000000],[901.351196,13472.000000],[902.325562,3774.000000],[909.424438,244136.000000],[910.515381,43770.000000],[911.526367,15208.000000],[914.308960,6532.000000],[915.217773,28455.000000],[918.666138,5610.000000],[919.396240,85829.000000],[920.066650,3.000000],[921.123901,16163.000000],[922.205688,37863.000000],[925.063721,43395.000000],[931.132812,61732.000000],[932.351929,136657.000000],[933.524048,25202.000000],[935.493286,33896.000000],[936.552002,103130.000000],[937.588623,67605.000000],[938.471069,35379.000000],[939.617920,77289.000000],[946.257812,38584.000000],[949.370239,85420.000000],[950.284546,5976.000000],[951.551758,29995.000000],[953.396606,545281.000000],[954.491577,123937.000000],[963.686768,261578.000000],[964.524658,318164.000000],[965.192139,124405.000000],[982.221924,27147.000000]]",
+        "splash": "splash10-0w2a-0001282259-0001282259",
+        "submit_user": "mwang87",
+        "Compound_Name": "3-Des-Microcystein_LR",
+        "Ion_Source": "LC-ESI",
+        "Compound_Source": "Isolated",
+        "Instrument": "qTof",
+        "PI": "Gerwick",
+        "Data_Collector": "Jenia",
+        "Adduct": "M+H",
+        "Scan": "-1",
+        "Precursor_MZ": "981.54",
+        "ExactMass": "0.0",
+        "Charge": "0",
+        "CAS_Number": "N/A",
+        "Pubmed_ID": "N/A",
+        "Smiles": "CC(C)CC1NC(=O)C(C)NC(=O)C(=C)N(C)C(=O)CCC(NC(=O)C(C)C(NC(=O)C(CCCNC(N)=N)NC(=O)C(C)C(NC1=O)C(O)=O)\\C=C\\C(\\C)=C\\C(C)C(O)Cc1ccccc1)C(O)=O",
+        "INCHI": "N/A",
+        "INCHI_AUX": "N/A",
+        "Library_Class": "1",
+        "SpectrumID": "CCMSLIB00000001547",
+        "Ion_Mode": "Positive",
+        "create_time": "2019-10-30 21:18:25.0",
+        "task_id": "aa87bf9cd0784df9956753f435c32434",
+        "user_id": "null",
+        "InChIKey_smiles": "IYDKWWDUBYWQGF-NNAZGLEUSA-N",
+        "InChIKey_inchi": "",
+        "Formula_smiles": "C48H72N10O12",
+        "Formula_inchi": "",
+        "url": "https://gnps.ucsd.edu/ProteoSAFe/gnpslibraryspectrum.jsp?SpectrumID=CCMSLIB00000001547",
+        "annotation_history": [
+            {
+                "Compound_Name": "3-Des-Microcystein_LR",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "Ger",
+                "PI": "Gerwick",
+                "Data_Collector": "Jenia",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "981.4",
+                "ExactMass": "0.0",
+                "Charge": "0",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "N/A",
+                "INCHI": "N/A",
+                "INCHI_AUX": "N/A",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001547",
+                "Ion_Mode": "Positive",
+                "create_time": "2014-02-04 17:56:43.0",
+                "task_id": "47daa4396adb426eaa5fa54b6ce7dd5f",
+                "user_id": "mwang87"
+            },
+            {
+                "Compound_Name": "3-Des-Microcystein_LR",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "qTof",
+                "PI": "Gerwick",
+                "Data_Collector": "Jenia",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "981.54",
+                "ExactMass": "0.0",
+                "Charge": "0",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "CC(C)CC1NC(=O)C(C)NC(=O)C(=C)N(C)C(=O)CCC(NC(=O)C(C)C(NC(=O)C(CCCNC(N)=N)NC(=O)C(C)C(NC1=O)C(O)=O)\\C=C\\C(\\C)=C\\C(C)C(O)Cc1ccccc1)C(O)=O",
+                "INCHI": "N/A",
+                "INCHI_AUX": "N/A",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001547",
+                "Ion_Mode": "Positive",
+                "create_time": "2019-10-30 21:18:25.0",
+                "task_id": "aa87bf9cd0784df9956753f435c32434",
+                "user_id": "lfnothias"
+            }
+        ]
+    },
+    {
+        "spectrum_id": "CCMSLIB00000001548",
+        "source_file": "20111105_Anada_Ger_HoiamideB_MH940_qb.1.1..mgf",
+        "task": "47daa4396adb426eaa5fa54b6ce7dd5f",
+        "scan": "1",
+        "ms_level": "2",
+        "library_membership": "GNPS-LIBRARY",
+        "spectrum_status": "1",
+        "peaks_json": "[[278.049927,35793.000000],[278.957642,47593.000000],[281.258667,95495.000000],[291.996094,115278.000000],[293.827637,91752.000000],[299.065979,129040.000000],[309.152832,62974.000000],[324.236206,31157.000000],[334.968811,115627.000000],[341.283569,30547.000000],[343.978516,94124.000000],[353.147217,205611.000000],[353.844360,1.000000],[359.101166,581387.000000],[359.888855,18.000000],[368.931641,40369.000000],[375.024811,191523.000000],[375.664062,39.000000],[377.287628,934209.000000],[378.192047,295658.000000],[380.225586,99848.000000],[381.088074,28994.000000],[383.194763,126064.000000],[384.326294,119935.000000],[390.163330,132876.000000],[391.216492,152650.000000],[397.480957,49394.000000],[405.885986,15096.000000],[408.151367,50942.000000],[408.941162,1521917.000000],[410.069397,235028.000000],[412.908936,19523.000000],[415.317749,40832.000000],[416.189331,116396.000000],[421.346222,822444.000000],[422.236237,406319.000000],[425.736572,33271.000000],[430.427429,115251.000000],[431.030762,152986.000000],[436.663208,30867.000000],[453.213257,215667.000000],[453.853271,2.000000],[456.716797,125621.000000],[457.249573,718325.000000],[458.258514,121013.000000],[459.323029,42422.000000],[462.352295,53209.000000],[468.064392,56113.000000],[471.292297,101158.000000],[472.837769,17471.000000],[475.225220,1066899.000000],[476.323944,931888.000000],[477.293152,314415.000000],[481.310425,20995.000000],[486.095825,35999.000000],[488.752777,97793.000000],[490.151245,189397.000000],[491.134399,38134.000000],[492.823486,167781.000000],[493.837646,123040.000000],[499.340332,68929.000000],[500.926270,35192.000000],[502.819702,346672.000000],[503.328186,1789291.000000],[503.844055,115544.000000],[504.448425,209601.000000],[505.521667,210506.000000],[506.153992,23586.000000],[507.281860,1756109.000000],[508.139343,920658.000000],[508.715088,5.000000],[509.322998,67825.000000],[510.159729,125144.000000],[511.108826,44963.000000],[513.214233,63849.000000],[514.097351,157893.000000],[515.079712,76460.000000],[518.323853,32014.000000],[519.041016,240930.000000],[521.166443,2474045.000000],[522.086304,485376.000000],[522.963379,290176.000000],[529.374146,106411.000000],[530.899231,722904.000000],[532.089783,189952.000000],[532.834473,71377.000000],[534.093506,79577.000000],[535.231201,533187.000000],[536.079834,205958.000000],[536.935913,19616.000000],[537.806885,427771.000000],[538.545166,14.000000],[539.760132,185155.000000],[543.283936,115082.000000],[545.483398,53069.000000],[553.243530,10619710.000000],[554.189453,1265687.000000],[555.107849,885736.000000],[556.199341,35655.000000],[557.188904,144709.000000],[558.325073,276628.000000],[559.441162,38371.000000],[563.392944,369187.000000],[564.342773,53377.000000],[565.162598,153259.000000],[567.527832,90530.000000],[569.096680,13406.000000],[573.235718,244664.000000],[573.872803,48.000000],[575.213562,846336.000000],[576.479736,79230.000000],[582.099854,85856.000000],[583.982666,34163.000000],[584.817871,17642.000000],[585.449829,126403.000000],[587.480713,30454.000000],[589.125000,202774.000000],[589.857056,3.000000],[591.335327,324628.000000],[593.545410,59873.000000],[599.153564,39495.000000],[601.312927,773465.000000],[602.344727,103997.000000],[605.229919,390697.000000],[606.044434,1.000000],[607.083252,438106.000000],[607.802979,32.000000],[611.162537,126605.000000],[613.219177,1278729.000000],[614.208252,134599.000000],[614.943481,32793.000000],[616.261230,35333.000000],[617.239929,1181920.000000],[617.832764,3566.000000],[619.109741,611095.000000],[620.090210,215720.000000],[623.606201,32893.000000],[625.371094,162473.000000],[629.113037,397263.000000],[631.285767,837261.000000],[632.427246,426749.000000],[633.305969,773961.000000],[634.005371,139725.000000],[635.159546,104212.000000],[638.429932,50215.000000],[639.142578,211014.000000],[640.066650,0.000000],[644.970947,126358.000000],[645.833496,400437.000000],[646.540649,13.000000],[647.614746,28622.000000],[649.493652,92063.000000],[651.267822,2952105.000000],[652.501709,948097.000000],[653.303345,261489.000000],[655.203003,33201.000000],[656.197632,63099.000000],[657.307983,3027254.000000],[658.356934,577368.000000],[659.635254,85949.000000],[661.488525,480492.000000],[662.373413,76094.000000],[663.271667,5528330.000000],[664.294983,1893201.000000],[665.272827,48.000000],[671.457947,584357.000000],[672.555908,35863.000000],[675.252808,3062771.000000],[676.276123,1149021.000000],[677.002197,57.000000],[679.320496,347430.000000],[688.130615,336462.000000],[689.338928,5507539.000000],[690.380371,939865.000000],[691.865601,127803.000000],[693.103333,441499.000000],[694.241089,177434.000000],[694.866699,3.000000],[706.645874,764079.000000],[707.298584,11425631.000000],[708.412170,3282238.000000],[709.281738,37425.000000],[710.297302,104548.000000],[711.575684,59794.000000],[714.353027,293763.000000],[720.310608,463766.000000],[723.610229,67559.000000],[724.423279,333180.000000],[725.338684,2697145.000000],[726.246155,477936.000000],[727.232544,407357.000000],[727.836182,23.000000],[731.005493,58569.000000],[733.947266,42640.000000],[734.489502,322546.000000],[735.218750,30.000000],[736.155151,161121.000000],[738.186523,1302348.000000],[738.971680,187994.000000],[739.817383,181407.000000],[740.513184,61.000000],[743.460449,177286.000000],[744.158691,26051.000000],[746.365784,668916.000000],[746.917114,45488.000000],[749.868530,33868.000000],[752.247192,1273569.000000],[753.092773,124216.000000],[753.863403,42270.000000],[754.550781,53958.000000],[756.299866,83498.000000],[758.105103,72039.000000],[760.394287,285768.000000],[761.139648,92506.000000],[762.440063,487254.000000],[763.821289,118871.000000],[764.401733,78746.000000],[765.879333,244224.000000],[766.875977,103968.000000],[768.550537,359217.000000],[769.536011,71507.000000],[770.247070,6843020.000000],[771.345947,1834188.000000],[772.112915,291081.000000],[772.859253,98762.000000],[773.393433,15544.000000],[774.196289,89552.000000],[775.369934,162814.000000],[776.830322,39987.000000],[778.437683,568287.000000],[779.430786,387544.000000],[780.564697,96591.000000],[782.339478,146674.000000],[786.388916,33301.000000],[788.550964,179046.000000],[789.336060,752627.000000],[790.289795,2323301.000000],[791.421265,491574.000000],[792.208252,468317.000000],[792.876465,10.000000],[793.950195,158696.000000],[795.489502,38698.000000],[796.091187,954908.000000],[797.200439,337367.000000],[798.289185,46495.000000],[800.432495,111840.000000],[801.090576,18.000000],[802.506714,113841.000000],[803.426880,382726.000000],[804.150146,305130.000000],[805.093140,72883.000000],[805.733887,25871.000000],[806.318115,161990.000000],[807.514771,70266.000000],[808.273560,21070504.000000],[809.333984,4046391.000000],[810.207275,259344.000000],[811.469727,27873.000000],[812.310425,187082.000000],[813.238647,70162.000000],[814.210083,462427.000000],[814.969604,5.000000],[818.325684,249639.000000],[819.179932,5.000000],[821.257446,2401369.000000],[822.402405,1322524.000000],[823.065796,26639.000000],[826.383850,1256031.000000],[827.219849,5.000000],[828.190063,2491409.000000],[829.269775,415142.000000],[832.262146,456122.000000],[833.509155,211714.000000],[834.274414,8.000000],[836.505859,107931.000000],[837.125854,4.000000],[837.992310,18698.000000],[839.326721,2462282.000000],[840.278259,8756806.000000],[841.229004,1659474.000000],[842.093811,260534.000000],[843.241211,234347.000000],[844.313904,2187139.000000],[845.152466,83303.000000],[846.270020,2781280.000000],[847.444214,1204369.000000],[848.088745,3.000000],[850.265015,922613.000000],[851.186401,116222.000000],[854.273743,1016497.000000],[855.291382,102364.000000],[858.455566,702571.000000],[860.296204,2520372.000000],[861.256592,530700.000000],[862.471863,1859168.000000],[863.435181,549532.000000],[864.379272,443001.000000],[865.002441,70558.000000],[866.333496,12614.000000],[868.264954,134340.000000],[871.557007,123565.000000],[872.289917,18706856.000000],[873.345642,2718281.000000],[874.043213,315833.000000],[876.373779,5434008.000000],[876.880249,19.000000],[877.403809,1670336.000000],[878.322937,10828502.000000],[879.327148,2115364.000000],[880.158447,114122.000000],[886.277527,2620326.000000],[887.166870,545701.000000],[887.893188,5.000000],[890.246277,55866120.000000],[891.272888,13506386.000000],[892.020142,75.000000],[893.624634,44855.000000],[894.326416,18938176.000000],[895.376404,5114120.000000],[896.202576,979881.000000],[897.012695,226445.000000],[904.195679,46132128.000000],[905.224548,12148538.000000],[906.084473,13.000000],[906.811646,12834.000000],[908.183472,17888056.000000],[909.235107,4328052.000000],[910.258850,56715.000000],[912.229492,168909.000000],[913.382202,64191.000000],[921.458130,892847.000000],[922.178101,109387080.000000],[923.155762,23455760.000000],[924.007812,68.000000],[940.099915,1264261.000000],[940.883240,2.000000]]",
+        "splash": "splash10-00dl-0000011189-0000011189",
+        "submit_user": "mwang87",
+        "Compound_Name": "Hoiamide B",
+        "Ion_Source": "LC-ESI",
+        "Compound_Source": "Isolated",
+        "Instrument": "qTof",
+        "PI": "Gerwick",
+        "Data_Collector": "Amanda",
+        "Adduct": "M+H",
+        "Scan": "-1",
+        "Precursor_MZ": "940.25",
+        "ExactMass": "939.452",
+        "Charge": "0",
+        "CAS_Number": "N/A",
+        "Pubmed_ID": "N/A",
+        "Smiles": "CCC[C@@H](C)[C@@H]([C@H](C)[C@@H]1[C@H]([C@H](Cc2nc(cs2)C3=N[C@](CS3)(C4=N[C@](CS4)(C(=O)N[C@H]([C@H]([C@H](C(=O)O[C@H](C(=O)N[C@H](C(=O)O1)[C@@H](C)O)[C@@H](C)CC)C)O)[C@@H](C)CC)C)C)OC)C)O",
+        "INCHI": "InChI=1S/C45H73N5O10S3/c1-14-17-24(6)34(52)26(8)37-25(7)30(58-13)18-31-46-29(19-61-31)39-49-45(12,21-62-39)43-50-44(11,20-63-43)42(57)48-32(22(4)15-2)35(53)27(9)40(55)59-36(23(5)16-3)38(54)47-33(28(10)51)41(56)60-37/h19,22-28,30,32-37,51-53H,14-18,20-21H2,1-13H3,(H,47,54)(H,48,57)/t22-,23-,24+,25-,26-,27+,28+,30-,32-,33-,34-,35-,36-,37-,44+,45+/m0/s1",
+        "INCHI_AUX": "N/A",
+        "Library_Class": "1",
+        "SpectrumID": "CCMSLIB00000001548",
+        "Ion_Mode": "Positive",
+        "create_time": "2019-06-04 02:55:49.0",
+        "task_id": "cd4ed49954b94767a54918c340d18fa1",
+        "user_id": "null",
+        "InChIKey_smiles": "KNGPFNUOXXLKCN-ZNCJFREWSA-N",
+        "InChIKey_inchi": "KNGPFNUOXXLKCN-ZNCJFREWSA-N",
+        "Formula_smiles": "C45H73N5O10S3",
+        "Formula_inchi": "C45H73N5O10S3",
+        "url": "https://gnps.ucsd.edu/ProteoSAFe/gnpslibraryspectrum.jsp?SpectrumID=CCMSLIB00000001548",
+        "annotation_history": [
+            {
+                "Compound_Name": "Hoiamide B",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "Ger",
+                "PI": "Gerwick",
+                "Data_Collector": "Amanda",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "940.25",
+                "ExactMass": "0.0",
+                "Charge": "0",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "N/A",
+                "INCHI": "N/A",
+                "INCHI_AUX": "N/A",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001548",
+                "Ion_Mode": "Positive",
+                "create_time": "2014-02-04 17:56:43.0",
+                "task_id": "47daa4396adb426eaa5fa54b6ce7dd5f",
+                "user_id": "mwang87"
+            },
+            {
+                "Compound_Name": "Hoiamide B",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "qTof",
+                "PI": "Gerwick",
+                "Data_Collector": "Amanda",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "940.25",
+                "ExactMass": "939.452",
+                "Charge": "0",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "CCC[C@@H](C)[C@@H]([C@H](C)[C@@H]1[C@H]([C@H](Cc2nc(cs2)C3=N[C@](CS3)(C4=N[C@](CS4)(C(=O)N[C@H]([C@H]([C@H](C(=O)O[C@H](C(=O)N[C@H](C(=O)O1)[C@@H](C)O)[C@@H](C)CC)C)O)[C@@H](C)CC)C)C)OC)C)O",
+                "INCHI": "InChI=1S/C45H73N5O10S3/c1-14-17-24(6)34(52)26(8)37-25(7)30(58-13)18-31-46-29(19-61-31)39-49-45(12,21-62-39)43-50-44(11,20-63-43)42(57)48-32(22(4)15-2)35(53)27(9)40(55)59-36(23(5)16-3)38(54)47-33(28(10)51)41(56)60-37/h19,22-28,30,32-37,51-53H,14-18,20-21H2,1-13H3,(H,47,54)(H,48,57)/t22-,23-,24+,25-,26-,27+,28+,30-,32-,33-,34-,35-,36-,37-,44+,45+/m0/s1",
+                "INCHI_AUX": "N/A",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001548",
+                "Ion_Mode": "Positive",
+                "create_time": "2019-06-04 02:55:49.0",
+                "task_id": "cd4ed49954b94767a54918c340d18fa1",
+                "user_id": "ggentajouve"
+            }
+        ]
+    },
+    {
+        "spectrum_id": "CCMSLIB00000001549",
+        "source_file": "20111105_Jenia_Ger_MalyngamideC_MH_456_qb.1.1..mgf",
+        "task": "47daa4396adb426eaa5fa54b6ce7dd5f",
+        "scan": "1",
+        "ms_level": "2",
+        "library_membership": "GNPS-LIBRARY",
+        "spectrum_status": "1",
+        "peaks_json": "[[128.838745,8064.000000],[132.075684,8080.000000],[132.830322,18139.000000],[134.038437,11099.000000],[135.861877,4449.000000],[136.808807,25689.000000],[137.399994,0.000000],[138.058044,10764.000000],[138.973206,4246.000000],[139.948700,1724.000000],[144.946014,7320.000000],[145.902298,49972.000000],[146.937012,51801.000000],[147.516663,0.000000],[148.894623,28649.000000],[149.976990,1863.000000],[153.859802,7103.000000],[154.713699,36921.000000],[155.846817,2060.000000],[156.714844,6284.000000],[158.752625,1735.000000],[160.830704,16155.000000],[163.185608,533.000000],[163.910172,252195.000000],[164.623047,32682.000000],[165.733948,3395.000000],[166.981857,13151.000000],[171.847717,104840.000000],[172.495239,1.000000],[173.275482,12953.000000],[173.914734,5425.000000],[174.843506,1678.000000],[179.897583,20765.000000],[181.835129,183621.000000],[182.753876,156636.000000],[183.335068,12.000000],[183.913422,5378.000000],[185.065643,3780.000000],[186.137329,811.000000],[189.110214,39074.000000],[197.980545,6792.000000],[199.184845,10571.000000],[199.844528,624963.000000],[200.777771,142047.000000],[201.483322,1.000000],[203.099976,3409.000000],[205.096130,13589.000000],[205.863190,3181.000000],[206.984756,46408.000000],[208.040466,3242.000000],[208.964996,22175.000000],[210.259705,710.000000],[212.964813,16141.000000],[214.151306,13266.000000],[215.761108,11654.000000],[216.936066,1618.000000],[217.831894,937927.000000],[218.579987,3.000000],[221.636169,2399.000000],[222.598358,9334.000000],[223.988632,80101.000000],[224.586639,1.000000],[229.886719,10375.000000],[234.017761,27179.000000],[236.033844,38385.000000],[237.818314,31662.000000],[238.861313,28934.000000],[239.690002,11188.000000],[240.222229,1.000000],[241.927307,30061.000000],[242.991882,2003.000000],[243.905640,10750.000000],[247.445831,15595.000000],[248.213318,0.000000],[251.955292,27835.000000],[254.062531,4240.000000],[254.630402,1254.000000],[255.876740,2013.000000],[258.053741,23367.000000],[259.056335,17488.000000],[260.177734,7311.000000],[260.765381,7718.000000],[262.098389,21095.000000],[263.673523,10252.000000],[264.552368,37683.000000],[268.199219,16811.000000],[269.090881,5872.000000],[271.308411,435.000000],[272.420837,1091.000000],[272.947662,29580.000000],[274.890625,3256.000000],[275.762695,12200.000000],[277.944397,3182.000000],[281.043823,1494.000000],[282.318359,5854.000000],[283.845001,23247.000000],[284.954407,2428.000000],[285.899780,2482.000000],[287.046417,24986.000000],[288.275391,4782.000000],[289.689941,17680.000000],[290.959991,6664.000000],[292.850342,11947.000000],[295.933075,17736.000000],[297.365479,10209.000000],[297.999786,9928.000000],[299.985352,2090.000000],[307.719360,52460.000000],[308.549927,0.000000],[309.054688,13865.000000],[310.058533,3309.000000],[310.919434,12360.000000],[312.388794,2471.000000],[313.061646,5753.000000],[313.898224,654448.000000],[314.618134,1.000000],[316.068970,2603.000000],[321.953339,36012.000000],[323.073242,30548.000000],[323.795776,461.000000],[324.946899,24349.000000],[325.870728,1667.000000],[328.325989,1378.000000],[334.002808,33185.000000],[335.118286,3659.000000],[339.905670,14517.000000],[341.105286,572.000000],[342.098663,28518.000000],[342.997925,1492.000000],[345.584991,5009.000000],[350.237061,1429.000000],[352.251495,70368.000000],[353.108459,16312.000000],[357.992676,5510.000000],[360.066620,6277.000000],[361.583008,13914.000000],[362.816467,8611.000000],[367.725464,1254.000000],[370.019318,577662.000000],[370.866577,7.000000],[372.178589,6989.000000],[378.005493,445431.000000],[378.671936,4.000000],[380.209106,22266.000000],[387.997772,262881.000000],[388.711029,3.000000],[395.914978,858.000000],[401.854828,51090.000000],[406.004456,627822.000000],[406.774811,11.000000],[409.659729,1702.000000],[419.272339,10655.000000],[420.101593,70422.000000],[423.253418,295910.000000],[423.916626,32604272.000000],[424.812042,25.000000],[426.196167,18399.000000],[437.281433,18805.000000],[438.103607,28144.000000],[439.510559,1335.000000],[455.885986,4412.000000]]",
+        "splash": "splash10-00di-0000900000-0000900000",
+        "submit_user": "mwang87",
+        "Compound_Name": "Malyngamide C",
+        "Ion_Source": "LC-ESI",
+        "Compound_Source": "Isolated",
+        "Instrument": "qTof",
+        "PI": "Gerwick",
+        "Data_Collector": "Amanda",
+        "Adduct": "M+H",
+        "Scan": "-1",
+        "Precursor_MZ": "456.1",
+        "ExactMass": "455.244",
+        "Charge": "0",
+        "CAS_Number": "N/A",
+        "Pubmed_ID": "N/A",
+        "Smiles": "CCCCCCC[C@@H](C/C=C/CCC(=O)NC/C(=C/Cl)/[C@@]12[C@@H](O1)[C@H](CCC2=O)O)OC",
+        "INCHI": "InChI=1S/C24H38ClNO5/c1-3-4-5-6-8-11-19(30-2)12-9-7-10-13-22(29)26-17-18(16-25)24-21(28)15-14-20(27)23(24)31-24/h7,9,16,19-20,23,27H,3-6,8,10-15,17H2,1-2H3,(H,26,29)/b9-7+,18-16-/t19-,20-,23-,24+/m0/s1",
+        "INCHI_AUX": "N/A",
+        "Library_Class": "1",
+        "SpectrumID": "CCMSLIB00000001549",
+        "Ion_Mode": "Positive",
+        "create_time": "2021-03-18 16:28:20.0",
+        "task_id": "48c1656fa4464fea93b71bfd79e0faa5",
+        "user_id": "null",
+        "InChIKey_smiles": "WXDBUBIFYCCNLE-NSCMQRKRSA-N",
+        "InChIKey_inchi": "WXDBUBIFYCCNLE-NSCMQRKRSA-N",
+        "Formula_smiles": "C24H38ClNO5",
+        "Formula_inchi": "C24H38ClNO5",
+        "url": "https://gnps.ucsd.edu/ProteoSAFe/gnpslibraryspectrum.jsp?SpectrumID=CCMSLIB00000001549",
+        "annotation_history": [
+            {
+                "Compound_Name": "Malyngamide C",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "qTof",
+                "PI": "Gerwick",
+                "Data_Collector": "Amanda",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "456.1",
+                "ExactMass": "455.244",
+                "Charge": "0",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "CCCCCCC[C@@H](C/C=C/CCC(=O)NC/C(=C/Cl)/[C@@]12[C@@H](O1)[C@H](CCC2=O)O)OC",
+                "INCHI": "InChI=1S/C24H38ClNO5/c1-3-4-5-6-8-11-19(30-2)12-9-7-10-13-22(29)26-17-18(16-25)24-21(28)15-14-20(27)23(24)31-24/h7,9,16,19-20,23,27H,3-6,8,10-15,17H2,1-2H3,(H,26,29)/b9-7+,18-16-/t19-,20-,23-,24+/m0/s1",
+                "INCHI_AUX": "N/A",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001549",
+                "Ion_Mode": "Positive",
+                "create_time": "2021-03-18 16:10:52.0",
+                "task_id": "13c6f12780744a5c8d25341963461fad",
+                "user_id": "kimkami2"
+            },
+            {
+                "Compound_Name": "Malyngamide C",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "qTof",
+                "PI": "Gerwick",
+                "Data_Collector": "Amanda",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "456.1",
+                "ExactMass": "455.244",
+                "Charge": "0",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "CCCCCCC[C@@H](C/C=C/CCC(=O)NC/C(=C/Cl)/[C@@]12[C@@H](O1)[C@H](CCC2=O)O)OC",
+                "INCHI": "InChI=1S/C24H38ClNO5/c1-3-4-5-6-8-11-19(30-2)12-9-7-10-13-22(29)26-17-18(16-25)24-21(28)15-14-20(27)23(24)31-24/h7,9,16,19-20,23,27H,3-6,8,10-15,17H2,1-2H3,(H,26,29)/b9-7+,18-16-/t19-,20-,23-,24+/m0/s1",
+                "INCHI_AUX": "N/A",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001549",
+                "Ion_Mode": "Positive",
+                "create_time": "2021-03-18 16:10:45.0",
+                "task_id": "20a71879275f4a35a9e4b3659d5b65cc",
+                "user_id": "kimkami2"
+            },
+            {
+                "Compound_Name": "Malyngamide C",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "Ger",
+                "PI": "Gerwick",
+                "Data_Collector": "Amanda",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "456.1",
+                "ExactMass": "0.0",
+                "Charge": "0",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "N/A",
+                "INCHI": "N/A",
+                "INCHI_AUX": "N/A",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001549",
+                "Ion_Mode": "Positive",
+                "create_time": "2014-02-04 17:56:43.0",
+                "task_id": "47daa4396adb426eaa5fa54b6ce7dd5f",
+                "user_id": "mwang87"
+            },
+            {
+                "Compound_Name": "Malyngamide C",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "qTof",
+                "PI": "Gerwick",
+                "Data_Collector": "Amanda",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "456.1",
+                "ExactMass": "455.244",
+                "Charge": "0",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "CCCCCCC[C@@H](C/C=C/CCC(=O)NC/C(=C/Cl)/[C@@]12[C@@H](O1)[C@H](CCC2=O)O)OC",
+                "INCHI": "InChI=1S/C24H38ClNO5/c1-3-4-5-6-8-11-19(30-2)12-9-7-10-13-22(29)26-17-18(16-25)24-21(28)15-14-20(27)23(24)31-24/h7,9,16,19-20,23,27H,3-6,8,10-15,17H2,1-2H3,(H,26,29)/b9-7+,18-16-/t19-,20-,23-,24+/m0/s1",
+                "INCHI_AUX": "N/A",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001549",
+                "Ion_Mode": "Positive",
+                "create_time": "2021-03-18 16:28:20.0",
+                "task_id": "48c1656fa4464fea93b71bfd79e0faa5",
+                "user_id": "kimkami2"
+            }
+        ]
+    },
+    {
+        "spectrum_id": "CCMSLIB00000001550",
+        "source_file": "20111105_Jenia_Ger_Scytonemin_MH_545_qb.1.1..mgf",
+        "task": "47daa4396adb426eaa5fa54b6ce7dd5f",
+        "scan": "1",
+        "ms_level": "2",
+        "library_membership": "GNPS-LIBRARY",
+        "spectrum_status": "1",
+        "peaks_json": "[[343.896484,142503.000000],[345.458496,67939.000000],[372.684021,175247.000000],[386.097473,65864.000000],[395.155640,104575.000000],[399.223022,60954.000000],[406.367249,31184.000000],[408.018677,100834.000000],[411.038452,32080.000000],[412.037964,57989.000000],[425.144653,113047.000000],[428.946472,18204.000000],[439.259216,94641.000000],[451.303467,109804.000000],[453.173279,83206.000000],[471.290649,97971.000000],[473.082581,77358.000000],[474.340637,39583.000000],[484.037598,69735.000000],[488.428955,406750.000000],[489.287537,7417608.000000],[490.313110,4128547.000000],[491.288513,3.000000],[498.630005,112346.000000],[499.849731,163597.000000],[500.469604,33473.000000],[501.284241,87997.000000],[502.145020,106179.000000],[504.172668,27900.000000],[516.481567,1003328.000000],[517.132935,12979350.000000],[518.111328,7024024.000000],[518.976562,67.000000],[528.132935,9615938.000000],[529.155762,4285929.000000],[530.238403,96747.000000],[544.155518,4675899.000000],[545.082642,43057184.000000],[546.063965,11037290.000000],[546.972168,9.000000]]",
+        "splash": "splash10-0002-0000190000-0000190000",
+        "submit_user": "mwang87",
+        "Compound_Name": "Scytonemin",
+        "Ion_Source": "LC-ESI",
+        "Compound_Source": "Isolated",
+        "Instrument": "Ion Trap",
+        "PI": "Gerwick",
+        "Data_Collector": "Amanda",
+        "Adduct": "M+H",
+        "Scan": "-1",
+        "Precursor_MZ": "545.0",
+        "ExactMass": "0.0",
+        "Charge": "0",
+        "CAS_Number": "N/A",
+        "Pubmed_ID": "N/A",
+        "Smiles": "OC1=CC=C(\\C=C2\\C(=O)C(C3=C4C5=C(C=CC=C5)N=C4\\C(=C/C4=CC=C(O)C=C4)C3=O)=C3C4=C(C=CC=C4)N=C23)C=C1",
+        "INCHI": "InChI=1S/C36H20N2O4/c39-21-13-9-19(10-14-21)17-25-33-29(23-5-1-3-7-27(23)37-33)31(35(25)41)32-30-24-6-2-4-8-28(24)38-34(30)26(36(32)42)18-20-11-15-22(40)16-12-20/h1-18,39-40H/b25-17+,26-18+",
+        "INCHI_AUX": "CGZKSPLDUIRCIO-RPCRKUJJSA-N",
+        "Library_Class": "1",
+        "SpectrumID": "CCMSLIB00000001550",
+        "Ion_Mode": "Positive",
+        "create_time": "2019-07-23 10:38:26.0",
+        "task_id": "ca48cf7bc6644f5e89f98d62f114dfea",
+        "user_id": "null",
+        "InChIKey_smiles": "CGZKSPLDUIRCIO-RPCRKUJJSA-N",
+        "InChIKey_inchi": "CGZKSPLDUIRCIO-RPCRKUJJSA-N",
+        "Formula_smiles": "C36H20N2O4",
+        "Formula_inchi": "C36H20N2O4",
+        "url": "https://gnps.ucsd.edu/ProteoSAFe/gnpslibraryspectrum.jsp?SpectrumID=CCMSLIB00000001550",
+        "annotation_history": [
+            {
+                "Compound_Name": "Scytonemin",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "Ger",
+                "PI": "Gerwick",
+                "Data_Collector": "Amanda",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "545.0",
+                "ExactMass": "0.0",
+                "Charge": "0",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "N/A",
+                "INCHI": "N/A",
+                "INCHI_AUX": "N/A",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001550",
+                "Ion_Mode": "Positive",
+                "create_time": "2014-02-04 17:56:43.0",
+                "task_id": "47daa4396adb426eaa5fa54b6ce7dd5f",
+                "user_id": "mwang87"
+            },
+            {
+                "Compound_Name": "Scytonemin",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "Ion Trap",
+                "PI": "Gerwick",
+                "Data_Collector": "Amanda",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "0.0",
+                "ExactMass": "0.0",
+                "Charge": "0",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "OC1=CC=C(\\C=C2\\C(=O)C(C3=C4C5=C(C=CC=C5)N=C4\\C(=C/C4=CC=C(O)C=C4)C3=O)=C3C4=C(C=CC=C4)N=C23)C=C1",
+                "INCHI": "InChI=1S/C36H20N2O4/c39-21-13-9-19(10-14-21)17-25-33-29(23-5-1-3-7-27(23)37-33)31(35(25)41)32-30-24-6-2-4-8-28(24)38-34(30)26(36(32)42)18-20-11-15-22(40)16-12-20/h1-18,39-40H/b25-17+,26-18+",
+                "INCHI_AUX": "CGZKSPLDUIRCIO-RPCRKUJJSA-N",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001550",
+                "Ion_Mode": "Positive",
+                "create_time": "2019-07-22 13:56:59.0",
+                "task_id": "6f75c41848474a3c9b29fd19adb632d7",
+                "user_id": "zhz077"
+            },
+            {
+                "Compound_Name": "Scytonemin",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "Ion Trap",
+                "PI": "Gerwick",
+                "Data_Collector": "Amanda",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "545.0",
+                "ExactMass": "0.0",
+                "Charge": "0",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "OC1=CC=C(\\C=C2\\C(=O)C(C3=C4C5=C(C=CC=C5)N=C4\\C(=C/C4=CC=C(O)C=C4)C3=O)=C3C4=C(C=CC=C4)N=C23)C=C1",
+                "INCHI": "InChI=1S/C36H20N2O4/c39-21-13-9-19(10-14-21)17-25-33-29(23-5-1-3-7-27(23)37-33)31(35(25)41)32-30-24-6-2-4-8-28(24)38-34(30)26(36(32)42)18-20-11-15-22(40)16-12-20/h1-18,39-40H/b25-17+,26-18+",
+                "INCHI_AUX": "CGZKSPLDUIRCIO-RPCRKUJJSA-N",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001550",
+                "Ion_Mode": "Positive",
+                "create_time": "2019-07-23 10:38:26.0",
+                "task_id": "ca48cf7bc6644f5e89f98d62f114dfea",
+                "user_id": "zhz077"
+            }
+        ]
+    },
+    {
+        "spectrum_id": "CCMSLIB00000001551",
+        "source_file": "A1.mgf",
+        "task": "d14a5843653040ba9fa2c4376f2be358",
+        "scan": "1",
+        "ms_level": "2",
+        "library_membership": "GNPS-LIBRARY",
+        "spectrum_status": "1",
+        "peaks_json": "[[101.015465,34.201859],[101.059807,14.903370],[103.002441,17.018160],[103.028542,58.157490],[103.051033,46.279202],[104.049545,74.360039],[105.035530,33.939091],[105.068886,131.880402],[106.065529,1076.048950],[106.163048,25.345711],[107.070229,346.654602],[108.044289,165.469803],[108.079056,127.294701],[109.052727,449.686615],[109.151184,10.638890],[109.783958,13.624240],[110.060417,3147.275879],[110.132996,36.797791],[110.158386,67.473793],[110.184387,26.193081],[110.213326,18.345970],[110.394592,10.170290],[110.490852,11.543720],[111.076462,539.782776],[111.177116,12.915200],[111.563881,10.310670],[112.035728,21.437611],[112.081123,47.559681],[113.012817,13.577910],[115.007751,13.535610],[115.053963,159.350296],[116.056465,41.231121],[117.011398,30.767620],[117.067688,102.842499],[118.065544,137.627396],[119.045944,18.955070],[119.080719,49.256691],[120.080437,130.773407],[121.083122,48.164890],[122.025009,16.321211],[122.060623,1645.828003],[122.164406,34.383980],[122.192986,12.527780],[122.977036,11.060610],[123.031403,10.025720],[123.064934,269.724701],[124.037086,21.123051],[124.075294,1179.595947],[124.178055,24.201910],[124.737938,10.774360],[125.012955,15.349180],[125.079422,126.251801],[126.051094,37.585281],[127.054535,68.858276],[128.062531,175.073700],[129.069473,201.787704],[130.062210,95.536118],[131.027618,106.933899],[131.084732,132.527893],[132.075775,88.366417],[133.020676,29.074070],[133.087570,152.680496],[134.056061,40.723400],[134.092392,60.491879],[135.061447,12.421800],[135.099136,10.564480],[136.039688,26.122681],[136.074646,95.005157],[137.071335,12.435990],[140.027908,26.983219],[141.067093,45.892059],[142.053848,69.273582],[143.019150,21.095369],[143.079300,101.111198],[144.048172,32.817871],[144.082687,113.353996],[145.088348,102.619202],[146.057175,74.545464],[146.095642,142.204895],[147.105698,45.839520],[148.079697,42.640209],[148.107529,29.094231],[149.044388,14.828570],[149.084732,11.582520],[150.054993,499.750488],[151.054901,63.909142],[152.073273,21.224440],[153.070023,13.499430],[154.068665,33.457520],[155.081726,48.140259],[156.018539,16.891470],[156.080276,62.032051],[157.089706,44.801651],[158.036316,1219.680054],[158.092651,92.353401],[158.151917,19.553740],[158.752136,11.115590],[159.043320,460.709198],[159.188217,11.442180],[160.049973,1806.395996],[160.108292,142.816299],[160.168228,28.330429],[160.226761,10.459540],[160.277695,11.352780],[160.447906,18.384090],[160.607910,13.845870],[160.778442,10.667330],[161.050232,206.358307],[161.118530,86.160439],[162.049240,855.240173],[162.123703,36.975609],[162.163559,19.335609],[162.424103,11.400250],[163.053116,75.238022],[164.104767,13.898210],[164.751587,10.562500],[165.073547,54.406502],[166.073349,11.558730],[166.118637,35.273441],[167.071640,15.361110],[168.047913,14.920600],[168.091949,13.751320],[169.095779,15.470510],[170.038666,13.201670],[170.095978,79.274673],[171.076630,35.386681],[171.113602,29.740740],[172.051651,62.652489],[172.119980,20.138889],[173.086594,51.213230],[173.120499,42.563351],[174.046188,48.354500],[174.088898,76.717590],[174.125244,83.885727],[174.803146,10.889810],[175.090866,19.378910],[175.122818,15.576720],[176.048584,27.093679],[182.098816,19.871590],[183.098297,25.781160],[184.052536,13.725150],[184.111954,33.951469],[185.117111,16.272980],[186.032135,744.139771],[186.124725,26.180990],[187.035553,103.924500],[187.101349,22.333731],[188.028778,484.431396],[188.105728,75.992729],[188.144470,71.315582],[188.189377,11.142860],[188.552170,10.337120],[189.026428,27.597219],[189.113754,68.110291],[190.042862,25.700211],[192.097214,15.542220],[196.045868,22.944010],[198.030884,63.692329],[198.126480,23.785860],[199.032455,20.396130],[199.104813,25.383680],[200.032043,44.217232],[201.108597,12.461110],[202.026031,32.168251],[202.124741,31.834700],[203.128098,13.360950],[204.042252,622.210205],[205.045288,107.695503],[205.811600,10.052160],[206.038727,356.355591],[206.108749,13.766810],[207.043732,21.972219],[207.084961,16.200560],[208.056198,14.258880],[210.083710,16.709150],[211.067932,17.687941],[216.135574,111.351997],[217.145996,11.584790],[218.113190,12.942250],[219.069839,12.111380],[220.063431,10.119440],[224.117264,26.850731],[225.087845,13.142360],[225.115387,18.846451],[226.119202,34.912331],[234.054108,11.862370],[234.103012,33.461910],[235.082443,19.017780],[236.102692,18.102720],[236.186050,11.130950],[237.090729,24.072069],[238.094437,15.663010],[240.117752,12.053500],[244.123672,12.333330],[250.099930,34.898281],[251.077301,11.236700],[252.114014,348.697510],[253.115982,70.117706],[254.111923,173.443695],[255.111130,37.488892],[270.126160,182.837204],[271.014526,10.133550],[271.134308,26.863390],[272.120453,94.913406],[278.095734,13.361110],[287.478882,11.939390],[297.118103,10.846370],[314.110779,60.368191],[315.121857,13.094020],[316.109253,19.152781],[1089.836670,10.111110],[1097.665161,18.810101]]",
+        "splash": "splash10-03di-0910000000-0910000000",
+        "submit_user": "mwang87",
+        "Compound_Name": "Salinisporamide A",
+        "Ion_Source": "LC-ESI",
+        "Compound_Source": "Isolated",
+        "Instrument": "qTof",
+        "PI": "Fenical-Jensen-Moore",
+        "Data_Collector": "Max",
+        "Adduct": "M+H",
+        "Scan": "-1",
+        "Precursor_MZ": "314.116",
+        "ExactMass": "313.108",
+        "Charge": "1",
+        "CAS_Number": "N/A",
+        "Pubmed_ID": "N/A",
+        "Smiles": "N/A",
+        "INCHI": "N/A",
+        "INCHI_AUX": "N/A",
+        "Library_Class": "1",
+        "SpectrumID": "CCMSLIB00000001551",
+        "Ion_Mode": "Positive",
+        "create_time": "2014-02-04 17:56:31.0",
+        "task_id": "d14a5843653040ba9fa2c4376f2be358",
+        "user_id": "null",
+        "InChIKey_smiles": "",
+        "InChIKey_inchi": "",
+        "Formula_smiles": "",
+        "Formula_inchi": "",
+        "url": "https://gnps.ucsd.edu/ProteoSAFe/gnpslibraryspectrum.jsp?SpectrumID=CCMSLIB00000001551",
+        "annotation_history": [
+            {
+                "Compound_Name": "Salinisporamide A",
+                "Ion_Source": "LC-ESI",
+                "Compound_Source": "Isolated",
+                "Instrument": "qTof",
+                "PI": "Fenical-Jensen-Moore",
+                "Data_Collector": "Max",
+                "Adduct": "M+H",
+                "Scan": "-1",
+                "Precursor_MZ": "314.116",
+                "ExactMass": "313.108",
+                "Charge": "1",
+                "CAS_Number": "N/A",
+                "Pubmed_ID": "N/A",
+                "Smiles": "N/A",
+                "INCHI": "N/A",
+                "INCHI_AUX": "N/A",
+                "Library_Class": "1",
+                "SpectrumID": "CCMSLIB00000001551",
+                "Ion_Mode": "Positive",
+                "create_time": "2014-02-04 17:56:31.0",
+                "task_id": "d14a5843653040ba9fa2c4376f2be358",
+                "user_id": "mwang87"
+            }
+        ]
+    }
+]
\ No newline at end of file
diff --git a/tests/test_save_as_json_load_from_json.py b/tests/test_save_as_json_load_from_json.py
index e07075af..f97f96d7 100644
--- a/tests/test_save_as_json_load_from_json.py
+++ b/tests/test_save_as_json_load_from_json.py
@@ -4,14 +4,25 @@ import numpy
 import pytest
 from matchms.exporting import save_as_json
 from matchms.importing import load_from_json
-from .builder_Spectrum import SpectrumBuilder
+from tests.builder_Spectrum import SpectrumBuilder
 
 
-def test_save_and_load_json_single_spectrum(tmp_path):
-    """Test saving spectrum to .json file"""
+@pytest.fixture
+def builder() -> SpectrumBuilder:
     mz = numpy.array([100, 200, 300], dtype="float")
     intensities = numpy.array([10, 10, 500], dtype="float")
     builder = SpectrumBuilder().with_mz(mz).with_intensities(intensities)
+    return builder
+
+
+def load_test_spectra_file(test_filename):
+    module_root = os.path.join(os.path.dirname(__file__), "..")
+    spectrums_file = os.path.join(module_root, "tests", test_filename)
+    spectra = list(load_from_json(spectrums_file))
+    return spectra
+
+def test_save_and_load_json_single_spectrum(tmp_path, builder):
+    """Test saving spectrum to .json file"""
     spectrum = builder.with_metadata({"charge": -1,
                                       "inchi": '"InChI=1S/C6H12"',
                                       "precursor_mz": 222.2,
@@ -29,11 +40,8 @@ def test_save_and_load_json_single_spectrum(tmp_path):
 
 
 @pytest.mark.parametrize("metadata_harmonization", [True, False])
-def test_save_and_load_json_spectrum_list(metadata_harmonization, tmp_path):
+def test_save_and_load_json_spectrum_list(metadata_harmonization, tmp_path, builder):
     """Test saving spectrum list to .json file"""
-    mz = numpy.array([100, 200, 300], dtype="float")
-    intensities = numpy.array([10, 10, 500], dtype="float")
-    builder = SpectrumBuilder().with_mz(mz).with_intensities(intensities)
     spectrum1 = builder.with_metadata({"test_field": "test1"},
                                       metadata_harmonization=metadata_harmonization).build()
     spectrum2 = builder.with_metadata({"test_field": "test2"},
@@ -52,6 +60,8 @@ def test_save_and_load_json_spectrum_list(metadata_harmonization, tmp_path):
     assert spectrum_imports[1] == spectrum2, "Original and saved+loaded spectrum not identical"
 
 
+
+
 def test_load_from_json_zero_peaks(tmp_path):
     spectrum1 = SpectrumBuilder().with_metadata(
         {"test_field": "test1"}).build()
@@ -68,7 +78,7 @@ def test_load_from_json_zero_peaks(tmp_path):
     assert len(spectrum_imports) == 0, "Spectrum without peaks should be skipped"
 
 
-def test_load_from_json_with_minimal_json(tmp_path):
+def test_load_from_json_with_minimal_json(tmp_path, builder):
     filename = tmp_path / "test.json"
     body = '[{"test_field": "test1", "peaks_json": [[100.0, 10.0], [200.0, 10.0], [300.0, 500.0]]}]'
 
@@ -77,9 +87,6 @@ def test_load_from_json_with_minimal_json(tmp_path):
 
     spectrum_imports = load_from_json(filename, metadata_harmonization=False)
 
-    mz = numpy.array([100, 200, 300], dtype="float")
-    intensities = numpy.array([10, 10, 500], dtype="float")
-    builder = SpectrumBuilder().with_mz(mz).with_intensities(intensities)
     expected = builder.with_metadata({"test_field": "test1"},
                                      metadata_harmonization=False).build()
 
@@ -87,12 +94,9 @@ def test_load_from_json_with_minimal_json(tmp_path):
         expected], "Loaded JSON document not identical to expected Spectrum"
 
 
-def test_save_as_json_with_minimal_json(tmp_path):
+def test_save_as_json_with_minimal_json(tmp_path, builder):
     filename = tmp_path / "test.json"
 
-    mz = numpy.array([100, 200, 300], dtype="float")
-    intensities = numpy.array([10, 10, 500], dtype="float")
-    builder = SpectrumBuilder().with_mz(mz).with_intensities(intensities)
     spectrum1 = builder.with_metadata({"test_field": "test1"},
                                       metadata_harmonization=False).build()
 
@@ -104,3 +108,12 @@ def test_save_as_json_with_minimal_json(tmp_path):
     expected = [{"test_field": "test1", "peaks_json": [
         [100.0, 10.0], [200.0, 10.0], [300.0, 500.0]]}]
     assert spectrum_imports == expected, "Saved Spectrum not identical to expected JSON Document"
+
+
+@pytest.mark.parametrize("filename, expected_length", [
+    ["gnps_spectra.json", 5]
+])
+def test_read_gnps_spectra(filename, expected_length):
+    actual = load_test_spectra_file(filename)
+
+    assert len(actual) == expected_length
diff --git a/tests/test_save_as_mgf.py b/tests/test_save_as_mgf.py
index 7a20644a..22903df0 100644
--- a/tests/test_save_as_mgf.py
+++ b/tests/test_save_as_mgf.py
@@ -7,6 +7,13 @@ from matchms.importing import load_from_mgf
 from .builder_Spectrum import SpectrumBuilder
 
 
+def load_test_spectra_file(test_filename):
+    module_root = os.path.join(os.path.dirname(__file__), "..")
+    spectrums_file = os.path.join(module_root, "tests", test_filename)
+    spectra = list(load_from_mgf(spectrums_file))
+    return spectra
+
+
 def test_save_as_mgf_single_spectrum():
     """Test saving spectrum to .mgf file"""
     spectrum = SpectrumBuilder().with_mz(
@@ -92,3 +99,15 @@ def test_save_load_mgf_consistency(tmpdir, charge, ionmode, parent_mass):
     assert spectrum_imports[0].get("charge") == charge
     assert spectrum_imports[0].get("ionmode") == ionmode
     assert spectrum_imports[0].get("parent_mass") == str(parent_mass)
+
+
+@pytest.mark.parametrize("test_file", ["testdata.mgf", "pesticides.mgf"])
+def test_write_append(test_file, tmpdir):
+    expected = load_test_spectra_file(test_file)
+    tmp_file = os.path.join(tmpdir, "testfile.mgf")
+    save_as_mgf(expected[:2], tmp_file)
+    save_as_mgf(expected[2:], tmp_file)
+
+    actual = list(load_from_mgf(tmp_file))
+
+    assert expected == actual
diff --git a/tests/test_save_as_msp.py b/tests/test_save_as_msp.py
index 3992d07f..8c1c0bec 100644
--- a/tests/test_save_as_msp.py
+++ b/tests/test_save_as_msp.py
@@ -23,10 +23,14 @@ def spectrum():
 
 @pytest.fixture(params=["rcx_gc-ei_ms_20201028_perylene.msp", "MoNA-export-GC-MS-first10.msp", "Hydrogen_chloride.msp"])
 def data(request):
+    spectra = load_test_spectra_file(request.param)
+    return spectra
+
+def load_test_spectra_file(test_filename):
     module_root = os.path.join(os.path.dirname(__file__), "..")
-    spectrums_file = os.path.join(module_root, "tests", request.param)
-    spectra = load_from_msp(spectrums_file)
-    return list(spectra)
+    spectrums_file = os.path.join(module_root, "tests", test_filename)
+    spectra = list(load_from_msp(spectrums_file))
+    return spectra
 
 
 @pytest.fixture
@@ -36,6 +40,23 @@ def filename():
         yield filename
 
 
+def save_and_reload_spectra(filename, spectra: List[Spectrum], write_peak_comments=True):
+    """ Utility function to save spectra to msp and load them again.
+
+    Params:
+    -------
+    spectra: Spectra objects to store
+
+    Returns:
+    --------
+    reloaded_spectra: Spectra loaded from saved msp file.
+    """
+
+    save_as_msp(spectra, filename, write_peak_comments)
+    reloaded_spectra = list(load_from_msp(filename))
+    return reloaded_spectra
+
+
 def test_spectrum_none_exception(none_spectrum, filename):
     """ Test for exception being thrown if the spectrum to be saved. """
     with pytest.raises(AttributeError) as exception:
@@ -104,23 +125,6 @@ def test_dont_write_peak_comments(filename, data):
             "Expected that no peak comments are written to file"
 
 
-def save_and_reload_spectra(filename, spectra: List[Spectrum], write_peak_comments=True):
-    """ Utility function to save spectra to msp and load them again.
-
-    Params:
-    -------
-    spectra: Spectra objects to store
-
-    Returns:
-    --------
-    reloaded_spectra: Spectra loaded from saved msp file.
-    """
-
-    save_as_msp(spectra, filename, write_peak_comments)
-    reloaded_spectra = list(load_from_msp(filename))
-    return reloaded_spectra
-
-
 def test_num_peaks_last_metadata_field(filename, data):
     """ Test to check whether the last line before the peaks is NUM PEAKS: ... """
     save_as_msp(data, filename)
@@ -138,3 +142,14 @@ def test_num_peaks_last_metadata_field(filename, data):
 
                     assert isinstance(mz, float)
                     assert isinstance(intensity, float)
+
+
+@pytest.mark.parametrize("test_file", ["MoNA-export-GC-MS-first10.msp", "massbank_five_spectra.msp"])
+def test_write_append(test_file, filename):
+    expected = load_test_spectra_file(test_file)
+    save_as_msp(expected[:2], filename, mode = "a")
+    save_as_msp(expected[2:], filename, mode = "a")
+
+    actual = list(load_from_msp(filename))
+
+    assert expected == actual