Skip to content

Commit d6c7803

Browse files
zmahnoor14mr-c
andauthored
metfrag and sirius CWL files from MAW (#146)
Co-authored-by: Michael R. Crusoe <michael.crusoe@gmail.com>
1 parent e590ae1 commit d6c7803

File tree

4 files changed

+161
-0
lines changed

4 files changed

+161
-0
lines changed

metfrag/metfrag.cwl

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: v1.0
3+
class: CommandLineTool
4+
5+
baseCommand: ['java', '-jar', '/usr/src/myapp/MetFragCommandLine-2.5.0.jar']
6+
7+
requirements:
8+
DockerRequirement:
9+
dockerPull: docker.io/zmahnoor/maw-metfrag_2.5.0:1.0.4
10+
InlineJavascriptRequirement: {}
11+
InitialWorkDirRequirement:
12+
listing:
13+
- entryname: param_file.txt
14+
entry: |-
15+
PeakListPath = $(inputs.PeakList.path)
16+
IonizedPrecursorMass = $(inputs.IonizedPrecursorMass)
17+
PrecursorIonMode = $(inputs.PrecursorIonMode)
18+
IsPositiveIonMode = $(inputs.IsPositiveIonMode)
19+
MetFragDatabaseType = LocalCSV
20+
LocalDatabasePath = $(inputs.LocalDatabase.path)
21+
DatabaseSearchRelativeMassDeviation = 5
22+
FragmentPeakMatchAbsoluteMassDeviation = 0.001
23+
FragmentPeakMatchRelativeMassDeviation = 15
24+
MetFragCandidateWriter = CSV
25+
SampleName = $(inputs.SampleName)
26+
ResultsPath = .
27+
MetFragPreProcessingCandidateFilter = UnconnectedCompoundFilter
28+
MetFragPostProcessingCandidateFilter = InChIKeyFilter
29+
MaximumTreeDepth = 2
30+
NumberThreads = $(runtime.cores)
31+
32+
33+
inputs: # additional inputs for all files; make them to show certain paths
34+
PeakList: File
35+
IonizedPrecursorMass: string
36+
PrecursorIonMode: int
37+
IsPositiveIonMode: boolean
38+
LocalDatabase: File
39+
SampleName: string
40+
#MetFragDatabaseType: string
41+
#DatabaseSearchRelativeMassDeviation: int
42+
#FragmentPeakMatchAbsoluteMassDeviation: float
43+
#FragmentPeakMatchRelativeMassDeviation: float
44+
#MetFragCandidateWriter: string
45+
#MetFragPreProcessingCandidateFilter: string
46+
#MetFragPostProcessingCandidateFilter: string
47+
#MaximumTreeDepth: int
48+
#NumberThreads: int
49+
50+
arguments:
51+
- ParameterFile=param_file.txt
52+
53+
outputs:
54+
candidate_list:
55+
type: File
56+
outputBinding:
57+
glob: "*.csv"

metfrag/metfrag_README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# How to use MetFrag in MAW:
2+
Pass the peaklist path, precursor mass, ion mode (1 for positive and 0 for negative), provide path to your local database, and a name for the result file
3+
```
4+
cwltool metfrag.cwl --PeakList path/to/peaklist.txt --IonizedPrecursorMass 123.45 --PrecursorIonMode 1 --IsPositiveIonMode True --LocalDatabase path/to/localdatabase.csv --SampleName result_file_name
5+
```

sirius/sirius.cwl

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: v1.0
3+
class: CommandLineTool
4+
5+
$namespaces:
6+
cwltool: http://commonwl.org/cwltool#
7+
hints:
8+
"cwltool:Secrets":
9+
secrets:
10+
- sirius_user
11+
- sirius_password
12+
13+
requirements:
14+
DockerRequirement:
15+
dockerPull: docker.io/zmahnoor/maw-sirius5:dev
16+
InlineJavascriptRequirement: {}
17+
ShellCommandRequirement: {}
18+
EnvVarRequirement:
19+
envDef:
20+
SIRIUS_USER: $(inputs.sirius_user)
21+
SIRIUS_PASSWORD: $(inputs.sirius_password)
22+
23+
inputs:
24+
sirius_user:
25+
type: string
26+
sirius_password:
27+
type: string
28+
spectrum:
29+
type: File
30+
profile:
31+
type: string
32+
default: "orbitrap"
33+
candidates:
34+
type: int
35+
default: 30
36+
ppm_max:
37+
type: int
38+
default: 5
39+
ppm_max_ms2:
40+
type: int
41+
default: 15
42+
database:
43+
type: string
44+
default: "coconut"
45+
isotope:
46+
type: boolean
47+
default: False
48+
49+
arguments:
50+
- sirius
51+
- login
52+
- --user-env
53+
- SIRIUS_USER
54+
- --password-env
55+
- SIRIUS_PASSWORD
56+
- shellQuote: False
57+
valueFrom: ";"
58+
- sirius
59+
- --input
60+
- $(inputs.spectrum.path)
61+
- --output
62+
- $(inputs.spectrum.nameroot).json
63+
- formula
64+
- --profile
65+
- $(inputs.profile)
66+
- |
67+
${
68+
if (inputs.isotope) {
69+
return ["--no-isotope-filter",
70+
"--no-isotope-score"];
71+
} else {
72+
return null;
73+
}
74+
}
75+
- --candidates
76+
- $(inputs.candidates)
77+
- --ppm-max
78+
- $(inputs.ppm_max)
79+
- --ppm-max-ms2
80+
- $(inputs.ppm_max_ms2)
81+
- fingerprint
82+
- structure
83+
- --database
84+
- $(inputs.database)
85+
- compound-classes
86+
- write-summaries
87+
- --output
88+
- $(inputs.spectrum.nameroot).json
89+
90+
outputs:
91+
results:
92+
type: Directory
93+
outputBinding:
94+
glob: $(inputs.spectrum.nameroot).json

sirius/sirius_README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# How to use SIRIUS in MAW:
2+
Pass your SIRIUS user email and password and the ```.ms``` input file to the cwltool.
3+
```
4+
cwltool --enable-ext --cachedir cache --debug maw-sirius.cwl --sirius_user your_email --sirius_password your_password --spectrum /Users/mahnoorzulfiqar/Downloads/New_ms2_spectra_endo_pos/insilico/SIRIUS/no_isotope/1_NA_iso_NA_MS1p_446.230465650658_SIRIUS_param.ms
5+
```

0 commit comments

Comments
 (0)