# HG changeset patch
# User computational-metabolomics
# Date 1594726954 14400
# Node ID 3dbe79671820a853513f9957f0fc7cfed0b2575d
"planemo upload for repository https://github.com/computational-metabolomics/metfrag-galaxy commit b337c6296968848e3214f4b51df3d86776f84b6a"
diff -r 000000000000 -r 3dbe79671820 metfrag-vis.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/metfrag-vis.py Tue Jul 14 07:42:34 2020 -0400
@@ -0,0 +1,695 @@
+#!/usr/bin/env python
+
+# Load modules
+import argparse
+import base64
+import csv
+import os
+import re
+import time
+import urllib.parse
+
+import matplotlib.pyplot as plt
+
+import pubchempy
+
+import requests
+
+# Parse arguments
+parser = argparse.ArgumentParser(
+ description='Visualise MetFrag results in html.')
+parser.add_argument('-v', '--version', action='version',
+ version='MetFrag-vis Version 0.9',
+ help='show version')
+parser.add_argument('-i', '--input', metavar='metfrag_results.tsv',
+ dest="input_tsv", required=True,
+ help='MetFrag results as input')
+parser.add_argument('-o', '--output', metavar='metfrag_results.html',
+ dest="output_html", required=True,
+ help='Write MetFrag results into this output file')
+parser.add_argument('-m', '--max-candidates', metavar='10',
+ dest="max_candidates", default=10, type=int,
+ required=False,
+ help='Maximum number of candidates per compound [1-1000]')
+parser.add_argument('-s', '--synonyms', dest='synonyms', action='store_true',
+ required=False,
+ help='Fetch synonyms from PubChem [disabled by default]')
+parser.add_argument('-c', '--classyfire', dest='classyfire',
+ action='store_true', required=False,
+ help='Fetch compound classes from ClassyFire'
+ ' [disabled by default]')
+
+args = parser.parse_args()
+
+# Input CSV with MetFrag results
+input_tsv = args.input_tsv
+
+# Output html of MetFrag results
+output_html = args.output_html
+
+# Max number of candidates per compound
+max_candidates = args.max_candidates
+
+# PubChem synonyms
+pubchem_synonyms_enabled = args.synonyms
+
+# ClassyFire classes
+classyfire_classes_enabled = args.classyfire
+
+
+# ---------- cdk_inchi_to_svg ----------
+def cdk_inchi_to_svg(inchi):
+ if "cdk-inchi-to-svg" in os.environ:
+ JAVA_CMD = 'cdk-inchi-to-svg' + ' ' + str(
+ '\'' + inchi + '\'') + ' ' + 'cdk-inchi-to-svg-output.svg'
+ else:
+ JAVA_BINARY = '/usr/local/bin/java'
+ CDK_INCHI_TO_SVG_JAR = '/usr/local/bin/' \
+ 'cdk-inchi-to-svg-0.0.1-' \
+ 'SNAPSHOT-jar-with-dependencies.jar'
+ JAVA_CMD = str(
+ JAVA_BINARY + ' ' + '-jar' + ' ' + CDK_INCHI_TO_SVG_JAR + ' '
+ + str('\'' + inchi + '\'') + ' ' + 'cdk-inchi-to-svg-output.svg')
+
+ # Exec cdk-inchi-to-svg JAVA binary
+ exitcode = os.system(JAVA_CMD)
+
+ # Check whether binary has successfully been run
+ if (exitcode == 0):
+ with open("cdk-inchi-to-svg-output.svg", "r") as svg_file:
+ svg_string = []
+ for line in svg_file:
+ if not ('' +
+ direct_parent_name + '')
+
+ # Alternative parents
+ alt_parents = []
+ for i in range(0, len(classyfire_query.json()['entities'][0][
+ 'alternative_parents'])):
+ alt_parent_name = classyfire_query.json()[
+ 'entities'][0]['alternative_parents'][i]['name']
+ alt_parent_url = classyfire_query.json()[
+ 'entities'][0]['alternative_parents'][i]['url']
+ alt_parent = str(
+ '' +
+ alt_parent_name + '')
+ alt_parents.append(alt_parent)
+
+ # Concat classes
+ classes = str('' + direct_parent + ',
' + str(
+ ',
'.join(alt_parents)))
+ else:
+ print('Warning. Timout sending query to ClassyFire. Skipping entry.')
+ classes = ' '
+
+ return (classes)
+
+
+# ---------- Plot Spectrum ----------
+def plot_spectrum(spectrum, spectrum_explained, spectrum_explained_formulas):
+ # Plot
+ plt.figure(figsize=[5.5, 4.4])
+ plt.xlabel('m/z')
+ plt.ylabel('intensity')
+
+ # Plot spectrum
+ x = []
+ y = []
+ for i in spectrum.split(';'):
+ t = i.split('_')
+ x.append(t[0])
+ y.append(t[1])
+
+ for i in range(0, len(x)):
+ plt.plot([float(x[i]), float(x[i])], [0, float(y[i])], linewidth=1,
+ color='black')
+ plt.plot(float(x[i]), float(y[i]), 'o', color='black', markersize=4)
+
+ if not (spectrum_explained == 'NA') and not (
+ spectrum_explained_formulas == 'NA'):
+ # Plot explained peaks
+ ex = []
+ ey = []
+ for i in spectrum_explained.split(';'):
+ t = i.split('_')
+ ex.append(t[0])
+ ey.append(y[x.index(t[0])])
+
+ for i in range(0, len(ex)):
+ plt.plot([float(ex[i]), float(ex[i])], [0, float(ey[i])],
+ linewidth=3, color='#2b8126')
+ plt.plot(float(ex[i]), float(ey[i]), 'o', color='#2b8126',
+ markersize=8)
+
+ # Plot formulas on explained peaks
+ ex = []
+ ey = []
+ ez = []
+ for i in spectrum_explained_formulas.split(';'):
+ t = i.split(':')
+ ex.append(t[0])
+ ey.append(y[x.index(t[0])])
+ ez.append(t[1])
+
+ for i in range(0, len(ex)):
+ plt.text(float(ex[i]), float(ey[i]) + 1000, ez[i], color='#2b8126',
+ fontsize=8,
+ horizontalalignment='center', verticalalignment='bottom')
+
+ # Save SVG
+ plt.savefig("metfrag-vis-spectrum.svg", format="svg", transparent=True)
+ plt.close()
+
+ # Import SVG
+ with open("metfrag-vis-spectrum.svg", "r") as svg_file:
+ svg_string = []
+ for line in svg_file:
+ if not ('\n')
+metfrag_html.write('\n')
+metfrag_html.write('
\n')
+metfrag_html.write('' + 'msPurity MetFrag results' + '\n')
+metfrag_html.write('\n')
+metfrag_html.write('\n')
+metfrag_html.write('\n')
+
+# Read input csv file
+with open(input_tsv, "r") as metfrag_file:
+ metfrag_results = csv.DictReader(metfrag_file, delimiter='\t')
+ # Parse each line
+ line_count = 0
+ compound = ""
+ candidates = 0
+ for row in metfrag_results:
+
+ # Start new document
+ if (line_count == 0):
+ if os.path.join(os.path.dirname(os.path.abspath(__file__)),
+ 'metfrag_logo.png'):
+ logo_pth = os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ 'metfrag_logo.png')
+ else:
+ logo_pth = '/usr/local/share/metfrag/metfrag_logo.png'
+
+ with open(logo_pth, "rb") as png_file:
+ png_encoded = base64.b64encode(png_file.read())
+ metfrag_html.write(str(
+ '\n results
\n'
+ ))
+ else:
+ # Parameter list at beginning of document
+ if (line_count == 1):
+ metfrag_html.write('\nParameter list
\n')
+ metfrag_html.write(str('MetFragDatabaseType=' +
+ re.sub(' .*', '',
+ re.sub('.*MetFragDatabaseType=',
+ '',
+ row[
+ "MetFragCLIString"]))
+ + '
\n')
+ )
+ metfrag_html.write(str('PrecursorIonMode=' +
+ re.sub(' .*', '',
+ re.sub('.*PrecursorIonMode=', '',
+ row[
+ "MetFragCLIString"]))
+ + '
\n')
+ )
+ metfrag_html.write(str('DatabaseSearchRelativeMassDeviation=' +
+ re.sub(' .*', '',
+ re.sub(
+ '.*DatabaseSearchRelative'
+ 'MassDeviation=',
+ '',
+ row[
+ "MetFragCLIString"])) +
+ '
\n')
+ )
+ metfrag_html.write(
+ str('FragmentPeakMatchAbsoluteMassDeviation=' +
+ re.sub(' .*', '',
+ re.sub(
+ '.*FragmentPeakMatchAbsoluteMassDeviation=',
+ '',
+ row["MetFragCLIString"])) + '
\n')
+ )
+ metfrag_html.write(
+ str('FragmentPeakMatchRelativeMassDeviation=' +
+ re.sub(' .*', '',
+ re.sub(
+ '.*FragmentPeakMatchRelativeMassDeviation=',
+ '',
+ row["MetFragCLIString"])) + '
\n')
+ )
+ metfrag_html.write(str('FilterExcludedElements=' +
+ re.sub(' .*', '',
+ re.sub(
+ '.*FilterExcludedElements=',
+ '',
+ row[
+ "MetFragCLIString"])) +
+ '
\n')
+ )
+ metfrag_html.write(str('FilterIncludedElements=' +
+ re.sub(' .*', '',
+ re.sub(
+ '.*FilterIncludedElements=',
+ '',
+ row[
+ "MetFragCLIString"])) +
+ '
\n')
+ )
+ metfrag_html.write(str('MetFragScoreTypes=' +
+ re.sub(' .*', '',
+ re.sub('.*MetFragScoreTypes=',
+ '',
+ row[
+ "MetFragCLIString"]))
+ + '
\n')
+ )
+ # New compound in list
+ if (row["name"] != compound):
+ compound = row["name"]
+ candidates = 0
+ identifier = row["name"]
+ monoisotopic_mass = row["MonoisotopicMass"]
+ precursor_mz = row["precursor_mz"]
+
+ if "retention_time" in row:
+ precursor_rt = row["retention_time"]
+ try:
+ precursor_rt = round(float(precursor_rt), 4)
+ except ValueError:
+ continue
+ else:
+ precursor_rt = ''
+
+ if "precursor_type" in row:
+ precursor_type = row["precursor_type"]
+ elif "adduct" in row:
+ precursor_type = row["adduct"]
+ else:
+ precursor_type = ''
+
+ if line_count > 1:
+ metfrag_html.write(str('\n'))
+
+ metfrag_html.write(str('\n' + '' + identifier + '
\n'))
+ metfrag_html.write(str('Precursor Type: ' + str(
+ precursor_type) + '
'))
+ metfrag_html.write(str('Precursor Mass: ' + str(
+ round(float(precursor_mz), 4)) + '
'))
+ metfrag_html.write(
+ str('Precursor Retention Time: ' + str(
+ precursor_mz) + '
'))
+ metfrag_html.write(str('\n' + '\n'))
+ metfrag_html.write(str(
+ ''
+ + '' + 'Spectrum' + ' | '
+ + '' + 'Structure' + ' | '
+ + '' + 'Monoisotopic Mass' + ' | '
+ + '' + 'Molecular Formula' + ' | '
+ + '' + 'Compound Name' + ' | '
+ + '' + 'PubChem Synonyms'+' | '
+ + '' + 'Compound Classes' + ' | '
+ + '' + 'MetFrag Score' + ' | '
+ + '' + 'MetFusion Score' + ' | '
+ + '' + 'Fragmenter Score' + ' | '
+ + '' + 'Suspectlist Score' + ' | '
+ + '' + 'Explained Peaks' + ' | '
+ + '' + 'MetFrag Web' + ' | '
+ + '' + 'External Links' + ' | '
+ + '' + 'InChI' + ' | '
+ + '
\n'))
+
+ # Compound candidate
+ if (candidates < max_candidates):
+ # Column variables
+ inchi = row["InChI"]
+ smiles = row["SMILES"]
+ mol_formula = row["MolecularFormula"]
+ compound_name = row["IUPACName"]
+ frag_score = row["FragmenterScore"]
+ metfusion_score = row["OfflineMetFusionScore"]
+ score = row["Score"]
+ if "SuspectListScore" in row:
+ suspectlist_score = row["SuspectListScore"]
+ else:
+ suspectlist_score = 0
+ peaks_explained = row["NoExplPeaks"]
+ peaks_used = row["NumberPeaksUsed"]
+ spectrum_explained = row["ExplPeaks"]
+ spectrum_explained_formulas = row["FormulasOfExplPeaks"]
+ identifier = row["Identifier"]
+
+ # PubChem Synonyms
+ if pubchem_synonyms_enabled:
+ pubchem_synonyms = fetch_pubchem_synonyms(inchi)
+ else:
+ pubchem_synonyms = ' '
+
+ # Compound Classes
+ if classyfire_classes_enabled:
+ compound_classes = fetch_classyfire_classes(inchi)
+ else:
+ compound_classes = ' '
+
+ # Draw Spectrum
+ spectrum = re.sub(' .*', '', re.sub('.*PeakListString=', '',
+ row["MetFragCLIString"]))
+ spectrum_string = plot_spectrum(spectrum, spectrum_explained,
+ spectrum_explained_formulas)
+
+ # Draw SVG
+ svg_string = cdk_inchi_to_svg(str(inchi))
+
+ # External links
+ external_links = str(
+ 'PubChem' + ', ' +
+ 'KEGG' + ', ' +
+ 'HMDB' + ', ' +
+ 'BioCyc' + ', ' +
+ 'ChEBI')
+
+ # MetFragWeb
+ FragmentPeakMatchAbsoluteMassDeviation = str(
+ '' +
+ re.sub(' .*', '',
+ re.sub(
+ '.*FragmentPeakMatchAbsoluteMassDeviation=',
+ 'FragmentPeakMatchAbsoluteMassDeviation=',
+ row["MetFragCLIString"]))
+ )
+ FragmentPeakMatchRelativeMassDeviation = str(
+ '' +
+ re.sub(' .*', '',
+ re.sub(
+ '.*FragmentPeakMatchRelativeMassDeviation=',
+ 'FragmentPeakMatchRelativeMassDeviation=',
+ row["MetFragCLIString"]))
+ )
+ DatabaseSearchRelativeMassDeviation = str(
+ '' +
+ re.sub(' .*', '',
+ re.sub(
+ '.*DatabaseSearchRelativeMassDeviation=',
+ 'DatabaseSearchRelativeMassDeviation=',
+ row["MetFragCLIString"]))
+ )
+ IonizedPrecursorMass = str(
+ 'IonizedPrecursorMass=' + str(row["precursor_mz"]))
+ NeutralPrecursorMass = str(
+ '' + re.sub(' .*', '',
+ re.sub(
+ '.*NeutralPrecursorMass=',
+ 'NeutralPrecursorMass=',
+ row[
+ "MetFragCLIString"]))
+ )
+ NeutralPrecursorMolecularFormula = str(
+ 'NeutralPrecursorMolecularFormula=' + str(
+ row["MolecularFormula"]))
+ PrecursorIonMode = str(
+ '' + re.sub(' .*', '', re.sub('.*PrecursorIonMode=',
+ 'PrecursorIonMode=',
+ row["MetFragCLIString"])))
+ PeakList = str(
+ '' + re.sub(' .*', '',
+ re.sub('.*PeakListString=', 'PeakList=',
+ row["MetFragCLIString"])))
+ MetFragDatabaseType = str(
+ '' + re.sub(' .*', '',
+ re.sub(
+ '.*MetFragDatabaseType=',
+ 'MetFragDatabaseType=',
+ row["MetFragCLIString"])))
+
+ metfrag_web = str(
+ 'https://msbi.ipb-halle.de/MetFrag/landing.xhtml?' +
+ FragmentPeakMatchAbsoluteMassDeviation + '&' +
+ FragmentPeakMatchRelativeMassDeviation + '&' +
+ DatabaseSearchRelativeMassDeviation + '&' +
+ IonizedPrecursorMass + '&' +
+ NeutralPrecursorMass + '&' +
+ # NeutralPrecursorMolecularFormula + '&' +
+ PrecursorIonMode + '&' +
+ PeakList + '&' +
+ MetFragDatabaseType)
+
+ # Write html code
+ metfrag_html.write(str('' +
+ '' +
+ spectrum_string +
+ ' | ' +
+ '' +
+ svg_string +
+ ' | ' +
+ '' +
+ monoisotopic_mass +
+ ' | ' +
+ '' +
+ mol_formula +
+ ' | ' +
+ '' +
+ compound_name +
+ ' | ' +
+ '' +
+ pubchem_synonyms +
+ ' | ' +
+ '' +
+ compound_classes + ' | ' +
+ '' +
+ str(round(float(score), 3)) +
+ ' | ' +
+ '' +
+ str(round(float(metfusion_score), 3)) +
+ ' | ' +
+ '' +
+ str(round(float(frag_score), 3)) +
+ ' | ' +
+ '' +
+ str(
+ round(float(suspectlist_score), 3)
+ ) +
+ ' | ' +
+ '' +
+ peaks_explained +
+ ' / ' +
+ peaks_used +
+ ' | ' +
+ '' +
+ 'MetFragWeb' +
+ ' | ' +
+ '' +
+ external_links +
+ ' | ' +
+ '' +
+ inchi +
+ ' | ' +
+ '
\n'))
+
+ line_count += 1
+ candidates += 1
+
+ # Finish candidate list
+ metfrag_html.write(str('
\n'))
+
+# Write html footer
+metfrag_html.write('\n\n')
+metfrag_html.write('\n')
+
+# Close output html file
+metfrag_html.close()
diff -r 000000000000 -r 3dbe79671820 metfrag-vis.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/metfrag-vis.xml Tue Jul 14 07:42:34 2020 -0400
@@ -0,0 +1,154 @@
+
+
+ Visualisation for MetFrag results
+
+
+ metfrag
+ cdk-inchi-to-svg
+ python
+ pubchempy
+ matplotlib
+ requests
+ numpy
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+---------------------
+MetFrag Visualisation
+---------------------
+
+Description
+-----------
+
+MetFrag is a freely available software for the annotation of high precision tandem mass spectra of metabolites which is
+a first and critical step for the identification of a molecule's structure. Candidate molecules of different databases
+are fragmented "in silico" and matched against mass to charge values. A score calculated using the fragment peak
+matches gives hints to the quality of the candidate spectrum assignment.
+
+This module summarises the results generated by MetFrag. It takes the (sometimes very large) output tabular file, parses the file and enriches it with images of the spectra showing the extracted and matched peaks and putative structures of the compound candidates. The module supports limiting the results per compound (default 10 candidates). Results can be enriched with further information from PubChem and ClassyFire to make it easier to select candidates. The information is summarised in a HTML5 file which can be viewed directly in Galaxy.
+
+Website: http://ipb-halle.github.io/MetFrag/
+
+Parameters
+----------
+
+**\1. Tabular file**
+
+Tabular file created using the *MetFrag* tool.
+
+**\2. MetFrag Hits Limit**
+
+Defines the limit of candidates returned per compound.
+
+**\3. Synonyms**
+
+If set to True, synonyms for each candidate are fetched from PubChem.
+
+**\4. ClassyFire**
+
+If set to True, compound classes are fetched for each candidate using ClassyFire.
+
+Output
+-------
+
+The output is similar to the MetFrag results tabular, but enriched with additional images of spectra, compound candidates and (if enabled) compound classes, alternative names and links to online services.
+
++-------------+--------------------------------------------+---+
+| adduct | name |...|
++-------------+--------------------------------------------+---+
+| [M-H]- | D-Glucose; LC-ESI-QTOF; MS2; CE: 10; R=; |...|
++-------------+--------------------------------------------+---+
+| [M-H]- | D-Glucose; LC-ESI-QTOF; MS2; CE: 10; R=; |...|
++-------------+--------------------------------------------+---+
+| ... | ... |...|
++-------------+--------------------------------------------+---+
+
+Table continued (these columns are derived from the MetFrag result):
+
++---+------------------+----------------------------------------------------------+-------------------------------------------------------------------------------------+-----+
+|...| sample_name | ExplPeaks | FormulasOfExplPeaks | ... |
++---+------------------+----------------------------------------------------------+-------------------------------------------------------------------------------------+-----+
+|...| 1_metfrag_result | 59.0138_715.8;71.014_679.7;89.0251_999.0;101.0234_103.0 | 59.0138:[C2H4O2]-H-;71.014:[C3H5O2-H]-H-;89.0251:[C3H6O3]-H-;101.0234:[C4H7O3-H]-H- | ... |
++---+------------------+----------------------------------------------------------+-------------------------------------------------------------------------------------+-----+
+|...| 1_metfrag_result | 59.0138_715.8;71.014_679.7;89.0251_999.0;101.0234_103.0 | 59.0138:[C2H4O2]-H-;71.014:[C3H5O2-H]-H-;89.0251:[C3H6O3]-H-;101.0234:[C4H7O3-H]-H- | ... |
++---+------------------+----------------------------------------------------------+-------------------------------------------------------------------------------------+-----+
+|...| ... | ... | ... | ... |
++---+------------------+----------------------------------------------------------+-------------------------------------------------------------------------------------+-----+
+
+
+Table continued (columns are derived from the MetFrag result):
+
++---+------------------+----------------------------+------------------------------------------------------+------------+---------------------------------------------------------------------------------+---+
+|...| FragmenterScore | FragmenterScore_Values | FormulasOfExplPeaks | Identifier | InChI |...|
++---+------------------+----------------------------+------------------------------------------------------+------------+---------------------------------------------------------------------------------+---+
+|...| 105.844569063138 | 696.0;1156.0;696.0;1156.0 | 6-(hydroxymethyl)oxane-2,3,4,5-tetrol | 206 | InChI=1S/C6H12O6/c7-1-2-3(8)4(9)5(10)6(11)12-2/h2-11H,1H |...|
++---+------------------+----------------------------+------------------------------------------------------+------------+---------------------------------------------------------------------------------+---+
+|...| 105.844569063138 | 696.0;1156.0;696.0;1156.0 | (3R,4S,5S,6R)-6-(hydroxymethyl)oxane-2,3,4,5-tetrol | 5793 | InChI=1S/C6H12O6/c7-1-2-3(8)4(9)5(10)6(11)12-2/h2-11H,1H2/t2-,3-,4+,5-,6?/m1/s1 |...|
++---+------------------+----------------------------+------------------------------------------------------+------------+---------------------------------------------------------------------------------+---+
+|...| ... | ... | ... | ... | ... |...|
++---+------------------+----------------------------+------------------------------------------------------+------------+---------------------------------------------------------------------------------+---+
+
+Table continued (columns are derived from the MetFrag result):
+
+
++---+-------------+-----------------+-----------------------+----------------------------------------------+------------------+------------------+--------+
+|...| NoExplPeaks | NumberPeaksUsed | OfflineMetFusionScore | SMILES | Score | SuspectListScore | XlogP3 |
++---+-------------+-----------------+-----------------------+----------------------------------------------+------------------+------------------+--------+
+|...| 4 | 5 | 2.84566828424078 | C(C1C(C(C(C(O1)O)O)O)O)O | 1.82678219603441 | 1 | -2.6 |
++---+-------------+-----------------+-----------------------+----------------------------------------------+------------------+------------------+--------+
+|...| 4 | 5 | 2.84566828424078 | C([C@@H]1[C@H]([C@@H]([C@H](C(O1)O)O)O)O)O | 1.82678219603441 | 1 | -2.6 |
++---+-------------+-----------------+-----------------------+----------------------------------------------+------------------+------------------+--------+
+|...| ... | ... | ... | ... | ... | ... | ... |
++---+-------------+-----------------+-----------------------+----------------------------------------------+------------------+------------------+--------+
+
+Additional notes
+--------------------
+
+This module queries the online services PubChem and ClassyFire.
+
+Feunang YD, Eisner R, Knox C, Chepelev L, Hastings J, Owen G, Fahy E, Steinbeck C, Subramanian S, Bolton E,
+Greiner R, Wishart DS (2016): ClassyFire: automated chemical classification with a comprehensive, computable taxonomy. J Cheminform 8:61. doi: 10.1186/s13321-016-0174-y
+
+Kim S, Chen J, Cheng T, Gindulyte A, He J, He S, Li Q, Shoemaker BA, Thiessen PA, Yu B, Zaslavsky L, Zhang J, Bolton EE (2019): PubChem 2019 update: improved access to chemical data. Nucleic Acids Res. 8;47(D1):D1102-D1109. doi: 10.1093/nar/gky1033
+
+Developers and contributors
+---------------------------
+- **Kristian Peters (kpeters@ipb-halle.de) - IPB Halle (Germany)**
+- **Tom Lawson (t.n.lawson@bham.ac.uk) - University of Birmingham (UK)**
+- **Christoph Ruttkies (christoph.ruttkies@ipb-halle.de) - IPB Halle (Germany)**
+
+
+ 10.1186/s13321-016-0115-9
+
+
diff -r 000000000000 -r 3dbe79671820 metfrag_logo.png
Binary file metfrag_logo.png has changed
diff -r 000000000000 -r 3dbe79671820 test-data/metfrag_vis_input.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/metfrag_vis_input.tabular Tue Jul 14 07:42:34 2020 -0400
@@ -0,0 +1,4 @@
+MetFragCLIString name AlignmentID retention_time num_peaks sample_name precursor_type precursor_mz ExplPeaks FormulasOfExplPeaks FragmenterScore FragmenterScore_Values IUPACName Identifier InChI InChIKey InChIKey1 InChIKey2 MaximumTreeDepth MolecularFormula MonoisotopicMass NoExplPeaks NumberPeaksUsed OfflineMetFusionScore SMILES Score XlogP3
+metfrag PrecursorIonMode=1 MetFragScoreWeights=1.0,1.0 SampleName=1_metfrag_result FragmentPeakMatchAbsoluteMassDeviation=0.001 NumberThreads=1 DatabaseSearchRelativeMassDeviation=10.0 PeakListPath=./temp/1_tmpspec.txt MetFragDatabaseType=PubChem FragmentPeakMatchRelativeMassDeviation=5.0 MetFragCandidateWriter=CSV MetFragScoreTypes=FragmenterScore,OfflineMetFusionScore IsPositiveIonMode=True NeutralPrecursorMass=148.12786092 ResultsPath=./temp/ PeakListString=121.099329887276_182;149.133267159026_510;150.14016979533_114 pos_27_winter_Marpol_27_2.E.3_01_17272:1 1 720.852 3 1_metfrag_result [M+H]+ 149.13513692 NA NA 0.0 NA dimethyl(dipropyl)-lambda4-sulfane 71774044 InChI=1S/C8H20S/c1-5-7-9(3,4)8-6-2/h5-8H2,1-4H3 OPMSGHPOQIQQRS-UHFFFAOYSA-N OPMSGHPOQIQQRS UHFFFAOYSA 2 C8H20S 148.128572 0 1 0.37031226614982965 CCCS(C)(C)CCC 1.0 2.7
+metfrag PrecursorIonMode=1 MetFragScoreWeights=1.0,1.0 SampleName=1_metfrag_result FragmentPeakMatchAbsoluteMassDeviation=0.001 NumberThreads=1 DatabaseSearchRelativeMassDeviation=10.0 PeakListPath=./temp/1_tmpspec.txt MetFragDatabaseType=PubChem FragmentPeakMatchRelativeMassDeviation=5.0 MetFragCandidateWriter=CSV MetFragScoreTypes=FragmenterScore,OfflineMetFusionScore IsPositiveIonMode=True NeutralPrecursorMass=148.12786092 ResultsPath=./temp/ PeakListString=121.099329887276_182;149.133267159026_510;150.14016979533_114 pos_27_winter_Marpol_27_2.E.3_01_17272:1 1 720.852 3 1_metfrag_result [M+H]+ 149.13513692 NA NA 0.0 NA butyl-ethyl-dimethyl-lambda4-sulfane 90984195 InChI=1S/C8H20S/c1-5-7-8-9(3,4)6-2/h5-8H2,1-4H3 HCGXHQGSWBNABQ-UHFFFAOYSA-N HCGXHQGSWBNABQ UHFFFAOYSA 2 C8H20S 148.128572 0 1 0.37031226614982965 CCCCS(C)(C)CC 1.0 2.5
+metfrag PrecursorIonMode=1 MetFragScoreWeights=1.0,1.0 SampleName=1_metfrag_result FragmentPeakMatchAbsoluteMassDeviation=0.001 NumberThreads=1 DatabaseSearchRelativeMassDeviation=10.0 PeakListPath=./temp/1_tmpspec.txt MetFragDatabaseType=PubChem FragmentPeakMatchRelativeMassDeviation=5.0 MetFragCandidateWriter=CSV MetFragScoreTypes=FragmenterScore,OfflineMetFusionScore IsPositiveIonMode=True NeutralPrecursorMass=148.12786092 ResultsPath=./temp/ PeakListString=121.099329887276_182;149.133267159026_510;150.14016979533_114 pos_27_winter_Marpol_27_2.E.3_01_17272:1 1 720.852 3 1_metfrag_result [M+H]+ 149.13513692 NA NA 0.0 NA trimethyl(3-methylbutyl)-lambda4-sulfane 118334050 InChI=1S/C8H20S/c1-8(2)6-7-9(3,4)5/h8H,6-7H2,1-5H3 DFXVYXYADDYUJD-UHFFFAOYSA-N DFXVYXYADDYUJD UHFFFAOYSA 2 C8H20S 148.128572 0 1 0.3692650195260169 CC(C)CCS(C)(C)C 0.9971719904536216 2.6
\ No newline at end of file
diff -r 000000000000 -r 3dbe79671820 test-data/metfrag_vis_output.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/metfrag_vis_output.html Tue Jul 14 07:42:34 2020 -0400
@@ -0,0 +1,1317 @@
+
+
+
+msPurity MetFrag results
+
+
+
+
+ results
+
+Parameter list
+MetFragDatabaseType=PubChem
+PrecursorIonMode=1
+DatabaseSearchRelativeMassDeviation=10.0
+FragmentPeakMatchAbsoluteMassDeviation=0.001
+FragmentPeakMatchRelativeMassDeviation=5.0
+FilterExcludedElements=metfrag
+FilterIncludedElements=metfrag
+MetFragScoreTypes=FragmenterScore,OfflineMetFusionScore
+
+pos_27_winter_Marpol_27_2.E.3_01_17272:1
+Precursor Type: [M+H]+
Precursor Mass: 149.1351
Precursor Retention Time: 720.852
+
+Spectrum | Structure | Monoisotopic Mass | Molecular Formula | Compound Name | PubChem Synonyms | Compound Classes | MetFrag Score | MetFusion Score | Fragmenter Score | Suspectlist Score | Explained Peaks | MetFrag Web | External Links | InChI |
+
+
+ | | 148.128572 | C8H20S | butyl-ethyl-dimethyl-lambda4-sulfane | | | 1.0 | 0.37 | 0.0 | 0.0 | 0 / 1 | MetFragWeb | PubChem, KEGG, HMDB, BioCyc, ChEBI | InChI=1S/C8H20S/c1-5-7-8-9(3,4)6-2/h5-8H2,1-4H3 |
+
+
+ | | 148.128572 | C8H20S | trimethyl(3-methylbutyl)-lambda4-sulfane | SCHEMBL17037255 | | 0.997 | 0.369 | 0.0 | 0.0 | 0 / 1 | MetFragWeb | PubChem, KEGG, HMDB, BioCyc, ChEBI | InChI=1S/C8H20S/c1-8(2)6-7-9(3,4)5/h8H,6-7H2,1-5H3 |
+
+
+
+