a b/docs/getting-started.md
1
# Getting Started
2
3
A [video tutorial](https://youtu.be/dOwkInn6eDw) covering the instructions below is also available.
4
5
### <a name="system-requirements"></a>System Requirements
6
7
* JDK [17](https://www.oracle.com/java/technologies/downloads/#jdk17-windows)+
8
   * A `JAVA_HOME` environment variable pointing to your JDK, or the Java executable in your PATH
9
* [Gradle](https://gradle.org/install/) (included)
10
11
### <a name="build-run"></a>Build & Run
12
13
The easiest way to run the program on Windows is by using the executable file located in the [releases](https://github.com/VerisimilitudeX/DNAnalyzer/releases/latest) section to install the program, build gradle and run the GUI.
14
15
* We use [Gradle](https://gradle.org) for building. The Gradle wrapper takes care of downloading dependencies, testing, compiling, linking, and packaging the code.
16
<details>
17
18
<summary>Windows</summary>
19
20
The easiest way to run the program on Windows is by using the executable file located in the [releases](https://github.com/VerisimilitudeX/DNAnalyzer/releases/latest) section to install the program, build gradle and run the GUI.
21
22
```pwsh
23
.\gradlew build
24
```
25
26
### <a name="usage"></a>Usage
27
28
```pwsh
29
<executable> <arguments>
30
```
31
32
#### <a name="executable"></a>Executable
33
34
```pwsh
35
java -jar build/libs/DNAnalyzer.jar
36
```
37
38
#### <a name="arguments"></a>Arguments
39
40
DNAnalyzer uses CLI arguments instead of `stdin`. For example, you can do:
41
42
```pwsh
43
assets/dna/random/dnalong.fa --amino=arg --min=16450 --max=520218 -r
44
```
45
46
### <a name="example"></a>Example
47
48
```pwsh
49
java -jar build/libs/DNAnalyzer.jar assets/dna/random/dnalong.fa --amino=ser --min=16450 --max=520218 -r
50
```
51
52
#### <a name="gradle-run"></a>Gradle Run
53
54
If you prefer, you can also run it directly from Gradle:
55
56
```pwsh
57
.\gradlew run --args="assets/dna/random/dnalong.fa --amino=ser --min=10 --max=100"
58
```
59
60
#### <a name="gui"></a>GUI
61
62
DNAnalyzer also comes with a (very basic) GUI; to start DNAnalyzer with the GUI, run:
63
64
```pwsh
65
.\gradlew run --args="--gui assets/dna/random/dnalong.fa"
66
```
67
68
Then:
69
70
* Enter the file name of the DNA file in the text field
71
* Set min and max
72
* Click analyze
73
74
* Note: Ensure you have Java [17](https://www.oracle.com/java/technologies/downloads/#java17) or higher installed and a `JAVA_HOME` path variable set for the program to function correctly!
75
76
77
The results of your analysis will be shown in the right pane.
78
79
</details>
80
81
<details>
82
      <summary>Linux & macOS</summary>
83
84
85
### <a name="features"></a>DNAnalyzer & Java Download
86
87
To run DNAnaylzer on Linux, you'll need to download the DNAnalyzer source code and download and install Java 17.
88
89
First, download the zip or tar.gz file from [DNAnalyzer releases](https://github.com/VerisimilitudeX/DNAnalyzer/releases/latest) and unzip it using the native utility. 
90
91
Then, download [Java 17](https://www.oracle.com/ca-en/java/technologies/downloads/#java17), find the download at https://www.oracle.com/ca-en/java/technologies/downloads/#java17, ensure you choose the Linux option and get the one for your correct processor architecture.
92
93
### Java installation
94
95
```bash
96
wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz
97
```
98
Next, unzip it.
99
100
```bash
101
tar -xvzf jdk-17_linux-x64_bin.tar.gz
102
```
103
Then map the `JAVA_HOME` path. Fill it in with your JAVA directory where JAVA is unzipped.
104
```bash
105
export JAVA_HOME="{YOUR JAVA DIRECTORY HERE}/jdk-17.0.7" && export PATH=$JAVA_HOME/bin:$PATH
106
```
107
<details>
108
<summary>Example of a full path command.</summary>
109
110
```bash
111
export JAVA_HOME="/workspaces/DNAnalyzer/jdk-17.0.7"
112
```
113
114
</details>
115
116
```bash
117
./gradlew build
118
```
119
If you see `Task :compileJava FAILED`, the program cannot find your Java installation. You may need to export your JAVA_HOME path again.
120
121
## OpenAI API Key
122
We use GPT-4 API to display the results of the analysis. To use the API, you'll need to get an API key from OpenAI. You can get one [here](https://platform.openai.com/). **Note, this is an optional step.** If you don't want to use the API, you can still use the program, but you won't be able to see the results of the analysis.
123
124
To set the API key on Linux or macOS, run `export OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx` where `sk-xxxxxxxxxxxxxxxxxxxxxxxx` is your API key.
125
126
For Windows, use `setx OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxx` instead.
127
128
129
### Usage
130
131
```bash
132
<executable> <arguments>
133
```
134
135
#### Executable
136
137
```pwsh
138
java -jar build/libs/DNAnalyzer.jar
139
```
140
141
#### Arguments
142
143
DNAnalyzer uses CLI arguments instead of `stdin`. For example, you can do:
144
145
```bash
146
assets/dna/random/dnalong.fa --amino=arg --min=16450 --max=520218 -r
147
```
148
149
### Example
150
151
```pwsh
152
java -jar build/libs/DNAnalyzer.jar assets/dna/random/dnalong.fa --amino=ser --min=16450 --max=520218 -r
153
```
154
155
#### Gradle Run
156
157
If you prefer, you can also run it directly from Gradle:
158
159
```pwsh
160
./gradlew run --args="assets/dna/random/dnalong.fa --amino=ser --min=10 --max=100"
161
```
162
163
#### GUI
164
165
DNAnalyzer also comes with a (very basic) GUI; to start DNAnalyzer with the GUI, run:
166
167
```pwsh
168
./gradlew run --args="--gui assets/dna/random/dnalong.fa"
169
```
170
171
Then:
172
173
* Enter the file name of the DNA file in the text field
174
* Set min and max
175
* Click analyze
176
177
178
The results of your analysis will be shown in the right pane.
179
</details>
180
181
182
183
#### Available Commands
184
185
```py
186
187
188
Usage: DNAnalyzer [-hrV] --amino=<aminoAcid> [--find=<proteinFile>]
189
                  [--max=<maxCount>] [--min=<minCount>] DNA
190
A program to analyze DNA sequences.
191
      DNA                    The FASTA file to be analyzed.
192
      --amino=<aminoAcid>    The amino acid representing the start of a gene.
193
      --find=<proteinFile>   The DNA sequence to be found within the FASTA file.
194
  -h, --help                 Show this help message and exit.
195
      --max=<maxCount>       The maximum count of the reading frame.
196
      --min=<minCount>       The minimum count of the reading frame.
197
  -r, --reverse              Reverse the DNA sequence before processing.
198
  -V, --version              Print version information and exit.
199
```