Skip to content

Commit

Permalink
Merge pull request #599 from CCMS-UCSD/classic_networking_linkouts_lc…
Browse files Browse the repository at this point in the history
…_browser

Classic networking linkouts lc browser
  • Loading branch information
mwang87 authored Aug 23, 2020
2 parents a5ae96d + e15acf6 commit f05b3df
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 3 deletions.
12 changes: 12 additions & 0 deletions metabolomics-snets-v2/metabolomics-snets-v2/binding.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
</bind>


<bind action="filesummary" tool="filesummary">
<inputAsRequirement port="spec" requirement="spec"/>
<inputAsRequirement port="workflowParameters" requirement="workflowParameters"/>
<productionToOutput port="filestatsresults" production="result"/>
</bind>



<bind action="searchlibraryparamgeneration_specnets" tool="LibrarySearchParamGeneration_specnets">
Expand Down Expand Up @@ -330,6 +336,12 @@
<query name="task" valueRef="@task"/>
<contentQuery name="content"/>
<compression type="zip"/>


<upload port="filestatsresults" type="file">
<query name="resource" value="filestatsresults"/>
</upload>

<upload port="clusterinfo" type="file">
<query name="resource" value="clusterinfo"/>
</upload>
Expand Down
10 changes: 10 additions & 0 deletions metabolomics-snets-v2/metabolomics-snets-v2/flow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
<output port="input_file_validation_flag" object="input_file_validation_flag"/>
</action>

<!-- File Summary -->
<object name="filestatsresults"/>
<action name="filesummary">
<input port="spec" collection="inputspectra"/>
<input port="workflowParameters" object="workflowParameters"/>
<output port="filestatsresults" object="filestatsresults"/>
</action>


<!-- Library Search -->
<collection name="paramsgen_specnets"/>
Expand Down Expand Up @@ -317,6 +325,8 @@


<action name="end">
<input port="filestatsresults" object="filestatsresults"/>

<!-- Library Search -->
<input port="result_specnets" object="result_specnets"/>
<input port="result_specnets_DB" object="result_specnets_DB"/>
Expand Down
33 changes: 33 additions & 0 deletions metabolomics-snets-v2/metabolomics-snets-v2/result.xml
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,33 @@
</block>


<!-- File Summary -->
<view id="file_summary" label="File Summaries" group="Default Molecular Networking Results Views">
<blockRef id="main" type="file_summary"/>
</view>

<block id="file_summary" type="table">
<data>
<source type="file" name="filestatsresults/"/>
<parsers>
<parser type="sortedTabular" sortBy="full_CCMS_path" operator="ascending"/>
</parsers>
</data>
<row>
<column label="View Chromatogram" type="genericurlgenerator" width="5">
<parameter name="URLBASE" value="http://dorresteintesthub.ucsd.edu:6548"/>
<parameter name="REQUESTPARAMETER=usi" value="mzspec:GNPS:TASK-{task}-f.[full_CCMS_path]:scan:1"/>
<parameter name="LABEL" value="View LCMS Chromatogram (Beta)"/>
</column>
<column type="text" field="full_CCMS_path" label="Filename" width="10"/>
<column type="text" field="Vendor" label="Vendor" width="10"/>
<column type="text" field="Model" label="Model" width="10"/>
<column type="integer" field="MS1s" label="MS1 Count" width="3"/>
<column type="integer" field="MS2s" label="MS2 Count" width="3"/>
</row>
</block>





Expand Down Expand Up @@ -1096,6 +1123,12 @@
<parameter name="REQUESTPARAMETER=filename" value="[Original_Path]"/>
<parameter name="LABEL" value="View Global Metadata"/>
</column>
<column label="View Chromatogram" type="genericurlgenerator" width="5">
<parameter name="URLBASE" value="http://dorresteintesthub.ucsd.edu:6548"/>
<parameter name="REQUESTPARAMETER=usi" value="mzspec:GNPS:TASK-{task}-[Original_Path]:scan:1"/>
<parameter name="REQUESTPARAMETER=xicmz" value="[parent mass]"/>
<parameter name="LABEL" value="View LCMS Chromatogram (Beta)"/>
</column>
<column type="text" field="AllFiles" label="Filename" width="10"/>
<column type="integer" field="ScanNumber" label="Scan" width="3"/>
<column type="float" field="sum(precursor intensity)" label="Precursor Int" precision="3"/>
Expand Down
27 changes: 27 additions & 0 deletions metabolomics-snets-v2/metabolomics-snets-v2/tool.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
<toolset>

<!-- File Summary -->
<pathSet base="anaconda3/bin">
<toolPath tool="filesummary" path="python" />
</pathSet>
<pathSet base="$base/scripts">
<pathVar name="msaccess.file" path="msaccess"/>
<pathVar name="filesummary.script" path="filesummary.py"/>
</pathSet>

<tool name="filesummary">
<require name="spec" type="folder"/>
<require name="parameter" type="file"/>
<require name="workflowParameters" type="file"/>
<produce name="result" type="file" naming="explicit" extension="tsv"/>

<execution env="binary" argConvention="adhoc">
<arg pathRef="filesummary.script"/>
<arg valueRef="spec"/>
<arg valueRef="workflowParameters"/>
<arg valueRef="result"/>
<arg pathRef="msaccess.file"/>
</execution>
</tool>



<!-- MSClustering -->

<pathSet base="$base">
Expand Down
16 changes: 13 additions & 3 deletions molecular-librarysearch-v2/tools/molecularsearch/filesummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import ming_parallel_library
import csv
import re

import pandas as pd
import glob

def summary_wrapper(search_param_dict):
summary_files(search_param_dict["spectrum_file"], search_param_dict["tempresults_folder"], search_param_dict["args"])
Expand Down Expand Up @@ -85,15 +86,24 @@ def main():

#print(result_list)
#full_result_list += result_list


used_files = set()
for result_object in full_result_list:
mangled_name = os.path.basename(result_object["Filename"])
full_path = mangled_mapping[mangled_name]
result_object["full_CCMS_path"] = full_path
used_files.add(full_path)

ming_fileio_library.write_list_dict_table_data(full_result_list, args.result_file)
for mangled_name in spectra_files:
full_path = mangled_mapping[os.path.basename(mangled_name)]
if full_path in used_files:
continue

output_dict = {}
output_dict["full_CCMS_path"] = full_path
full_result_list.append(output_dict)

pd.DataFrame(full_result_list).to_csv(args.result_file, sep="\t", index=False)



Expand Down

0 comments on commit f05b3df

Please sign in to comment.