Skip to content

Commit d2238c0

Browse files
committed
Update README
1 parent eb5fb0b commit d2238c0

File tree

1 file changed

+155
-1
lines changed

1 file changed

+155
-1
lines changed

mars-cli/README.md

+155-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Installing the mars-cli
22

3+
This installation procedure describes a typical Linux installation. This application can perfectly work on Windows and MacOS but some of the steps might be different.
4+
35
Installing the mars-cli from source:
46

57
```sh
6-
cd mars-cli # Assuming you are in the root folder
8+
cd mars-cli # Assuming you are in the root folder of this project
79
pip install .
810
```
911

@@ -18,6 +20,20 @@ If you want to overwrite the `settings.ini` file when reinstalling, you need to
1820
```sh
1921
OVERWRITE_SETTINGS=True pip install .[test]
2022
```
23+
Installing the MARS-cli, will by default create a `.mars` directory in the home directory to store settings and log files.
24+
If you wish to create the `.mars` directory in another place, you must specify the `MARS_SETTINGS_DIR` variable and set it to the desired path:
25+
26+
```sh
27+
export MARS_SETTINGS_DIR=<path/to/parent_folder/containing/.mars>
28+
```
29+
30+
If you want to make it permanent, you can run to following commands in the terminal.
31+
Note: replace `.bashrc` by the config file of your shell.
32+
33+
```sh
34+
echo '# Add MARS setting directory to PATH' >> $HOME/.bashrc
35+
echo 'export MARS_SETTINGS_DIR=<path/to/parent_folder/containing/.mars>' >> $HOME/.bashrc
36+
```
2137

2238
Once installed, the CLI application will be available from the terminal.
2339

@@ -51,6 +67,144 @@ __log_max_size__: The maximum size in kB for the log file. By default the maximu
5167

5268
__log_max_files__: The maximum number of old log files to keep. By default, this is set to 5
5369

70+
## Target respoistory settings
71+
72+
Each of the target repositories have a set of settings:
73+
74+
- development-url: URL to the development server when performing a health-check
75+
- development-submission-url: URL to the development server when performing a submission
76+
- production-url: URL to the production server when performing a health-check
77+
- production-submission-url: URL to the production server when performing a submissionW
78+
79+
# Using the MARS-CLI
80+
81+
If you wish to use a different location for the `.mars' folder:
82+
83+
```sh
84+
export MARS_SETTINGS_DIR=<path/to/parent_folder/containing/.mars>
85+
mars-cli [options] <command> ARGUMENT
86+
```
87+
88+
## Help
89+
90+
The mars-cli's help text can be found from the command line as such:
91+
92+
```sh
93+
mars-cli --help
94+
```
95+
96+
Output:
97+
98+
```
99+
➜ mars-cli --help
100+
Usage: mars-cli [OPTIONS] COMMAND [ARGS]...
101+
102+
Options:
103+
-d, --development Boolean indicating the usage of the development
104+
environment of the target repositories. If not present,
105+
the production instances will be used.
106+
--help Show this message and exit.
107+
108+
Commands:
109+
health-check Check the health of the target repositories.
110+
submit Start a submission to the target repositories.
111+
validate-isa-json Validate the ISA JSON file.
112+
```
113+
114+
or for a specific command:
115+
116+
```sh
117+
mars-cli submit --help
118+
```
119+
120+
Output:
121+
122+
```
123+
➜ mars-cli submit --help
124+
############# Welcome to the MARS CLI. #############
125+
Running in Production environment
126+
Usage: mars-cli submit [OPTIONS] CREDENTIALS_FILE ISA_JSON_FILE
127+
128+
Start a submission to the target repositories.
129+
130+
Options:
131+
--submit-to-ena BOOLEAN Submit to ENA.
132+
--submit-to-metabolights BOOLEAN
133+
Submit to Metabolights.
134+
--investigation-is-root BOOLEAN
135+
Boolean indicating if the investigation is
136+
the root of the ISA JSON. Set this to True
137+
if the ISA-JSON does not contain a
138+
'investigation' field.
139+
--help Show this message and exit.
140+
```
141+
142+
## Development
143+
144+
By default the mars-CLI will try to submit the ISA-JSON's metadata towards the repositories' production servers. Passing the development flag will run it in development mode and substitute the production servers with the development servers.
145+
146+
## Health check repository services
147+
148+
You can check whether the supported repositories are healthy, prior to submission, by doing a health-check.
149+
150+
```sh
151+
mars-cli health-check
152+
```
153+
154+
Output:
155+
156+
```
157+
➜ mars-cli health-check
158+
############# Welcome to the MARS CLI. #############
159+
Running in Production environment
160+
Checking the health of the target repositories.
161+
Checking production instances.
162+
Webin (https://www.ebi.ac.uk/ena/submit/webin/auth) is healthy.
163+
ENA (https://www.ebi.ac.uk/ena/submit/webin-v2/) is healthy.
164+
Biosamples (https://www.ebi.ac.uk/biosamples/samples/) is healthy.
165+
```
166+
167+
## Submitting to repository services
168+
169+
TODO
170+
171+
### Options
172+
173+
- `--submit-to-ena`: By default set to `True`. Will try submit ISA-JSON metadata towards ENA. Setting it to `False` will skip sending the ISA-JSON's metadata to ENA.
174+
175+
```sh
176+
mars-cli submit --submit-to-ena False my-credentials my-isa-json.json
177+
```
178+
179+
- `--submit-to-metabolights`: By default set to `True`. Will try submit ISA-JSON metadata towards Metabolights. Setting it to `False` will skip sending the ISA-JSON's metadata to Metabolights.
180+
181+
```sh
182+
mars-cli submit --submit-to-metabolights False my-credentials my-isa-json.json
183+
```
184+
185+
`--investigation-is-root`: By default this flag is set to false, maening the ISA-JSON should have the `investigation` key at the root level. In case the root level __IS__ the investigation (`investigation` level is omitted), you need set the flag `--investigation-is-root` to `True` in order to validate the ISA-JSON.
186+
187+
```sh
188+
mars-cli submit --investigation-is-root True my-credentials my-isa-json.json
189+
```
190+
191+
## Validation of the ISA JSON
192+
193+
You can perform a syntactic validation of the ISA-JSON, without submitting to the target repositories.
194+
195+
__Note:__ This does not take validation into account from the repository's side. This does not guarantee successful submission.
196+
197+
```sh
198+
mars-cli validate-isa-json --investigation-is-root True ../test-data/biosamples-input-isa.json
199+
```
200+
201+
### Options
202+
203+
`--investigation-is-root`: By default this flag is set to false, maening the ISA-JSON should have the `investigation` key at the root level. In case the root level __IS__ the investigation (`investigation` level is omitted), you need set the flag `--investigation-is-root` to `True` in order to validate the ISA-JSON.
204+
205+
```sh
206+
mars-cli validate-isa-json my-isa-investigation.json
207+
```
54208

55209
# Extending BioSamples' records
56210
The Python script ``biosamples-externalReferences.py`` defines a class BiosamplesRecord for managing biosample records. This class is designed to interact with the BioSamples database, allowing operations like fetching, updating, and extending biosample records.

0 commit comments

Comments
 (0)