pycompound 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pycompound-0.1.2/src/pycompound.egg-info → pycompound-0.1.3}/PKG-INFO +1 -1
- {pycompound-0.1.2 → pycompound-0.1.3}/pyproject.toml +1 -1
- {pycompound-0.1.2 → pycompound-0.1.3}/src/app.py +9 -2
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound/plot_spectra.py +15 -10
- {pycompound-0.1.2 → pycompound-0.1.3/src/pycompound.egg-info}/PKG-INFO +1 -1
- {pycompound-0.1.2 → pycompound-0.1.3}/LICENSE +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/README.md +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/setup.cfg +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound/build_library.py +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound/plot_spectra_CLI.py +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound/processing.py +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound/similarity_measures.py +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound/spec_lib_matching.py +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound/spec_lib_matching_CLI.py +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound/tuning_CLI.py +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound.egg-info/SOURCES.txt +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound.egg-info/dependency_links.txt +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound.egg-info/requires.txt +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/src/pycompound.egg-info/top_level.txt +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/tests/test_build_library.py +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/tests/test_plot_spectra.py +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/tests/test_similarity_measures.py +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/tests/test_spec_lib_matching.py +0 -0
- {pycompound-0.1.2 → pycompound-0.1.3}/tests/test_tuning.py +0 -0
|
@@ -884,11 +884,18 @@ def server(input, output, session):
|
|
|
884
884
|
weights = [float(weight.strip()) for weight in input.weights().split(",") if weight.strip()]
|
|
885
885
|
weights = {'Cosine':weights[0], 'Shannon':weights[1], 'Renyi':weights[2], 'Tsallis':weights[3]}
|
|
886
886
|
|
|
887
|
+
high_quality_reference_library_tmp2 = False
|
|
888
|
+
if input.high_quality_reference_library() != 'False':
|
|
889
|
+
high_quality_reference_library_tmp2 = True
|
|
890
|
+
|
|
891
|
+
print(input.high_quality_reference_library())
|
|
892
|
+
print(high_quality_reference_library_tmp2)
|
|
893
|
+
|
|
887
894
|
if input.chromatography_platform() == "HRMS":
|
|
888
|
-
fig = generate_plots_on_HRMS_data(query_data=input.query_data()[0]['datapath'], reference_data=input.reference_data()[0]['datapath'], spectrum_ID1=spectrum_ID1, spectrum_ID2=spectrum_ID2, similarity_measure=input.similarity_measure(), weights=weights, spectrum_preprocessing_order=input.spectrum_preprocessing_order(), high_quality_reference_library=
|
|
895
|
+
fig = generate_plots_on_HRMS_data(query_data=input.query_data()[0]['datapath'], reference_data=input.reference_data()[0]['datapath'], spectrum_ID1=spectrum_ID1, spectrum_ID2=spectrum_ID2, similarity_measure=input.similarity_measure(), weights=weights, spectrum_preprocessing_order=input.spectrum_preprocessing_order(), high_quality_reference_library=high_quality_reference_library_tmp2, mz_min=input.mz_min(), mz_max=input.mz_max(), int_min=input.int_min(), int_max=input.int_max(), window_size_centroiding=input.window_size_centroiding(), window_size_matching=input.window_size_matching(), noise_threshold=input.noise_threshold(), wf_mz=input.wf_mz(), wf_intensity=input.wf_int(), LET_threshold=input.LET_threshold(), entropy_dimension=input.entropy_dimension(), y_axis_transformation=input.y_axis_transformation(), return_plot=True)
|
|
889
896
|
plt.show()
|
|
890
897
|
elif input.chromatography_platform() == "NRMS":
|
|
891
|
-
fig = generate_plots_on_NRMS_data(query_data=input.query_data()[0]['datapath'], reference_data=input.reference_data()[0]['datapath'], spectrum_ID1=spectrum_ID1, spectrum_ID2=spectrum_ID2, similarity_measure=input.similarity_measure(), spectrum_preprocessing_order=input.spectrum_preprocessing_order(), high_quality_reference_library=
|
|
898
|
+
fig = generate_plots_on_NRMS_data(query_data=input.query_data()[0]['datapath'], reference_data=input.reference_data()[0]['datapath'], spectrum_ID1=spectrum_ID1, spectrum_ID2=spectrum_ID2, similarity_measure=input.similarity_measure(), spectrum_preprocessing_order=input.spectrum_preprocessing_order(), high_quality_reference_library=high_quality_reference_library_tmp2, mz_min=input.mz_min(), mz_max=input.mz_max(), int_min=input.int_min(), int_max=input.int_max(), noise_threshold=input.noise_threshold(), wf_mz=input.wf_mz(), wf_intensity=input.wf_int(), LET_threshold=input.LET_threshold(), entropy_dimension=input.entropy_dimension(), y_axis_transformation=input.y_axis_transformation(), return_plot=True)
|
|
892
899
|
plt.show()
|
|
893
900
|
with io.BytesIO() as buf:
|
|
894
901
|
fig.savefig(buf, format="png", dpi=150, bbox_inches="tight")
|
|
@@ -92,8 +92,8 @@ def generate_plots_on_HRMS_data(query_data=None, reference_data=None, spectrum_I
|
|
|
92
92
|
print(f'Error: spectrum_preprocessing_order must contain only \'C\', \'F\', \'M\', \'N\', \'L\', \'W\'.')
|
|
93
93
|
sys.exit()
|
|
94
94
|
|
|
95
|
-
if similarity_measure not in ['cosine','shannon','renyi','tsallis','mixture','jaccard','dice','3w_jaccard','sokal_sneath','binary_cosine','mountford','mcconnaughey','driver_kroeber','simpson','braun_banquet','fager_mcgowan','kulczynski','
|
|
96
|
-
print('\nError: similarity_measure must be either cosine, shannon, renyi, tsallis, mixture, jaccard, dice, 3w_jaccard, sokal_sneath, binary_cosine, mountford, mcconnaughey, driver_kroeber, simpson, braun_banquet, fager_mcgowan, kulczynski,
|
|
95
|
+
if similarity_measure not in ['cosine','shannon','renyi','tsallis','mixture','jaccard','dice','3w_jaccard','sokal_sneath','binary_cosine','mountford','mcconnaughey','driver_kroeber','simpson','braun_banquet','fager_mcgowan','kulczynski','intersection','hamming','hellinger']:
|
|
96
|
+
print('\nError: similarity_measure must be either cosine, shannon, renyi, tsallis, mixture, jaccard, dice, 3w_jaccard, sokal_sneath, binary_cosine, mountford, mcconnaughey, driver_kroeber, simpson, braun_banquet, fager_mcgowan, kulczynski, intersection, hamming, or hellinger.')
|
|
97
97
|
sys.exit()
|
|
98
98
|
|
|
99
99
|
if isinstance(int_min,int) is True:
|
|
@@ -243,10 +243,12 @@ def generate_plots_on_HRMS_data(query_data=None, reference_data=None, spectrum_I
|
|
|
243
243
|
r_spec[:,1] = LE_transform(r_spec[:,1], LET_threshold, normalization_method=normalization_method)
|
|
244
244
|
if transformation == 'N' and q_spec.shape[0] > 1 and r_spec.shape[1] > 1:
|
|
245
245
|
q_spec = remove_noise(q_spec, nr = noise_threshold)
|
|
246
|
-
|
|
246
|
+
if high_quality_reference_library == False or high_quality_reference_library == 'False':
|
|
247
|
+
r_spec = remove_noise(r_spec, nr = noise_threshold)
|
|
247
248
|
if transformation == 'F' and q_spec.shape[0] > 1 and r_spec.shape[1] > 1:
|
|
248
249
|
q_spec = filter_spec_lcms(q_spec, mz_min = mz_min, mz_max = mz_max, int_min = int_min, int_max = int_max, is_matched = is_matched)
|
|
249
|
-
|
|
250
|
+
if high_quality_reference_library == False or high_quality_reference_library == 'False':
|
|
251
|
+
r_spec = filter_spec_lcms(r_spec, mz_min = mz_min, mz_max = mz_max, int_min = int_min, int_max = int_max, is_matched = is_matched)
|
|
250
252
|
|
|
251
253
|
q_ints = q_spec[:,1]
|
|
252
254
|
r_ints = r_spec[:,1]
|
|
@@ -291,12 +293,15 @@ def generate_plots_on_HRMS_data(query_data=None, reference_data=None, spectrum_I
|
|
|
291
293
|
plt.yticks([])
|
|
292
294
|
|
|
293
295
|
|
|
296
|
+
print('\n\n\n')
|
|
297
|
+
print(high_quality_reference_library)
|
|
298
|
+
print('\n\n\n')
|
|
294
299
|
plt.subplots_adjust(top=0.8, hspace=0.92, bottom=0.3)
|
|
295
300
|
plt.figlegend(loc = 'upper center')
|
|
296
301
|
fig.text(0.05, 0.18, f'Similarity Measure: {similarity_measure.capitalize()}', fontsize=7)
|
|
297
302
|
fig.text(0.05, 0.15, f'Similarity Score: {round(similarity_score,4)}', fontsize=7)
|
|
298
303
|
fig.text(0.05, 0.12, f"Spectrum Preprocessing Order: {''.join(spectrum_preprocessing_order)}", fontsize=7)
|
|
299
|
-
fig.text(0.05, 0.09, f'High Quality Reference Library: {high_quality_reference_library}', fontsize=7)
|
|
304
|
+
fig.text(0.05, 0.09, f'High Quality Reference Library: {str(high_quality_reference_library)}', fontsize=7)
|
|
300
305
|
fig.text(0.05, 0.06, f'Window Size (Centroiding): {window_size_centroiding}', fontsize=7)
|
|
301
306
|
fig.text(0.05, 0.03, f'Window Size (Matching): {window_size_matching}', fontsize=7)
|
|
302
307
|
fig.text(0.45, 0.18, f'Raw-Scale M/Z Range: [{mz_min_tmp},{mz_max_tmp}]', fontsize=7)
|
|
@@ -387,8 +392,8 @@ def generate_plots_on_NRMS_data(query_data=None, reference_data=None, spectrum_I
|
|
|
387
392
|
print(f'Error: spectrum_preprocessing_order must contain only \'F\', \'N\', \'W\', \'L\'.')
|
|
388
393
|
sys.exit()
|
|
389
394
|
|
|
390
|
-
if similarity_measure not in ['cosine','shannon','renyi','tsallis','mixture','jaccard','dice','3w_jaccard','sokal_sneath','binary_cosine','mountford','mcconnaughey','driver_kroeber','simpson','braun_banquet','fager_mcgowan','kulczynski','
|
|
391
|
-
print('\nError: similarity_measure must be either cosine, shannon, renyi, tsallis, mixture, jaccard, dice, 3w_jaccard, sokal_sneath, binary_cosine, mountford, mcconnaughey, driver_kroeber, simpson, braun_banquet, fager_mcgowan, kulczynski,
|
|
395
|
+
if similarity_measure not in ['cosine','shannon','renyi','tsallis','mixture','jaccard','dice','3w_jaccard','sokal_sneath','binary_cosine','mountford','mcconnaughey','driver_kroeber','simpson','braun_banquet','fager_mcgowan','kulczynski','intersection','hamming','hellinger']:
|
|
396
|
+
print('\nError: similarity_measure must be either cosine, shannon, renyi, tsallis, mixture, jaccard, dice, 3w_jaccard, sokal_sneath, binary_cosine, mountford, mcconnaughey, driver_kroeber, simpson, braun_banquet, fager_mcgowan, kulczynski, intersection, hamming, or hellinger.')
|
|
392
397
|
sys.exit()
|
|
393
398
|
|
|
394
399
|
if isinstance(int_min,int) is True:
|
|
@@ -528,11 +533,11 @@ def generate_plots_on_NRMS_data(query_data=None, reference_data=None, spectrum_I
|
|
|
528
533
|
r_spec[:,1] = LE_transform(r_spec[:,1], LET_threshold, normalization_method)
|
|
529
534
|
if transformation == 'N':
|
|
530
535
|
q_spec = remove_noise(q_spec, nr = noise_threshold)
|
|
531
|
-
if high_quality_reference_library == False:
|
|
536
|
+
if high_quality_reference_library == False or high_quality_reference_library == 'False':
|
|
532
537
|
r_spec = remove_noise(r_spec, nr = noise_threshold)
|
|
533
538
|
if transformation == 'F':
|
|
534
539
|
q_spec = filter_spec_gcms(q_spec, mz_min = mz_min, mz_max = mz_max, int_min = int_min, int_max = int_max)
|
|
535
|
-
if high_quality_reference_library == False:
|
|
540
|
+
if high_quality_reference_library == False or high_quality_reference_library == 'False':
|
|
536
541
|
r_spec = filter_spec_gcms(r_spec, mz_min = mz_min, mz_max = mz_max, int_min = int_min, int_max = int_max)
|
|
537
542
|
|
|
538
543
|
if q_spec.shape[0] > 1:
|
|
@@ -580,7 +585,7 @@ def generate_plots_on_NRMS_data(query_data=None, reference_data=None, spectrum_I
|
|
|
580
585
|
fig.text(0.05, 0.15, f'Similarity Measure: {similarity_measure.capitalize()}', fontsize=7)
|
|
581
586
|
fig.text(0.05, 0.12, f'Similarity Score: {round(similarity_score,4)}', fontsize=7)
|
|
582
587
|
fig.text(0.05, 0.09, f"Spectrum Preprocessing Order: {''.join(spectrum_preprocessing_order)}", fontsize=7)
|
|
583
|
-
fig.text(0.05, 0.06, f'High Quality Reference Library: {high_quality_reference_library}', fontsize=7)
|
|
588
|
+
fig.text(0.05, 0.06, f'High Quality Reference Library: {str(high_quality_reference_library)}', fontsize=7)
|
|
584
589
|
fig.text(0.05, 0.03, f'Raw-Scale M/Z Range: [{min_mz},{max_mz}]', fontsize=7)
|
|
585
590
|
fig.text(0.45, 0.15, f'Raw-Scale Intensity Range: [{int_min_tmp},{int_max_tmp}]', fontsize=7)
|
|
586
591
|
fig.text(0.45, 0.12, f'Noise Threshold: {noise_threshold}', fontsize=7)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|