File tree Expand file tree Collapse file tree 2 files changed +42
-2
lines changed Expand file tree Collapse file tree 2 files changed +42
-2
lines changed Original file line number Diff line number Diff line change 23
23
24
24
nop :
25
25
command : >-
26
- python --version
26
+ nop.py
27
27
28
28
nop-fail :
29
29
command : >-
30
- python --version
30
+ nop-fail.py
31
+
32
+ smiles-to-file :
33
+ command : >-
34
+ string-to-file.py --smiles {{ smiles }} --output {{ outputFile }}
35
+ variables :
36
+ outputs :
37
+ type : object
38
+ properties :
39
+ title : Output file
40
+ mime-types :
41
+ - chemical/x-mdl-sdfile
42
+ - squonk/x-smiles
43
+ creates : ' {{ outputFile }}'
44
+ type : file
45
+ options :
46
+ type : object
47
+ required :
48
+ - outputFile
49
+ - smiles
50
+ properties :
51
+ outputFile :
52
+ title : Output file
53
+ type : string
54
+ default : clustered.sdf
55
+ pattern : " ^[A-Za-z0-9_/\\ .\\ -]+\\ .(smi|sdf)$"
56
+ smiles :
57
+ title : SMILES
58
+ type : string
Original file line number Diff line number Diff line change
1
+ import argparse
2
+
3
+ parser = argparse .ArgumentParser (
4
+ prog = "smiles-to-file" ,
5
+ description = "Takes an input SMILES string and writes it to a file" ,
6
+ )
7
+ parser .add_argument ("-s" , "--smiles" , required = True )
8
+ parser .add_argument ("-o" , "--outputFile" , required = True )
9
+ args = parser .parse_args ()
10
+
11
+ with open (args .outputFile , "wt" , encoding = "utf8" ) as output_file :
12
+ output_file .write (f"{ args .smiles } \n " )
You can’t perform that action at this time.
0 commit comments