-
Notifications
You must be signed in to change notification settings - Fork 3
/
KEGGdraw.vb
131 lines (112 loc) · 4.01 KB
/
KEGGdraw.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#Region "Microsoft.VisualBasic::2a887d00df81db58f8612486ac64ccba, src\visualize\KCF\KEGGdraw.vb"
' Author:
'
' xieguigang ([email protected], BioNovoGene Co., LTD.)
'
' Copyright (c) 2018 [email protected], BioNovoGene Co., LTD.
'
'
' MIT License
'
'
' Permission is hereby granted, free of charge, to any person obtaining a copy
' of this software and associated documentation files (the "Software"), to deal
' in the Software without restriction, including without limitation the rights
' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
' copies of the Software, and to permit persons to whom the Software is
' furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in all
' copies or substantial portions of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
' SOFTWARE.
' /********************************************************************************/
' Summaries:
' Class KEGGdraw
'
' Constructor: (+1 Overloads) Sub New
' Function: FromEnvironment
'
'
' /********************************************************************************/
#End Region
Imports System.Runtime.CompilerServices
Imports System.Text
Imports Microsoft.VisualBasic.CommandLine
Imports Microsoft.VisualBasic.CommandLine.InteropService
Imports Microsoft.VisualBasic.ApplicationServices
' Microsoft VisualBasic CommandLine Code AutoGenerator
' assembly: ..\app\KEGGdraw.exe
'
' //
' //
' //
' // VERSION: 1.0.0.*
' // COPYRIGHT: Copyright © [email protected] 2019
' // GUID: 7363f587-3c76-4d5e-b95c-36be7d823064
' //
'
'
' < KEGGdraw.CLI >
'
'
' SYNOPSIS
' KEGGdraw command [/argument argument-value...] [/@set environment-variable=value...]
'
' All of the command that available in this program has been list below:
'
' 1. KCF chemical structure tool
'
'
' /draw.kcf: Draw image from KCF model data file.
'
'
' ----------------------------------------------------------------------------------------------------
'
' 1. You can using "KEGGdraw ??<commandName>" for getting more details command help.
' 2. Using command "KEGGdraw /CLI.dev [---echo]" for CLI pipeline development.
Namespace External
''' <summary>
''' KEGGdraw.CLI
''' </summary>
'''
Public Class KEGGdraw : Inherits InteropService
Public Const App$ = "KEGGdraw.exe"
Sub New(App$)
MyBase._executableAssembly = App$
End Sub
<MethodImpl(MethodImplOptions.AggressiveInlining)>
Public Shared Function FromEnvironment(directory As String) As KEGGdraw
Return New KEGGdraw(App:=directory & "/" & KEGGdraw.App)
End Function
''' <summary>
''' ```
''' /draw.kcf /in <kcf.txt/directory> [/transparent /corp /out <out.png/directory>]
''' ```
''' Draw image from KCF model data file.
''' </summary>
'''
Public Function DrawKCF([in] As String, Optional out As String = "", Optional transparent As Boolean = False, Optional corp As Boolean = False) As Integer
Dim CLI As New StringBuilder("/draw.kcf")
Call CLI.Append(" ")
Call CLI.Append("/in " & """" & [in] & """ ")
If Not out.StringEmpty Then
Call CLI.Append("/out " & """" & out & """ ")
End If
If transparent Then
Call CLI.Append("/transparent ")
End If
If corp Then
Call CLI.Append("/corp ")
End If
Dim proc As IIORedirectAbstract = RunDotNetApp(CLI.ToString())
Return proc.Run()
End Function
End Class
End Namespace