# Oscar

### 0. Summary of commands

{% code overflow="wrap" %}

```bash
version=v2.3.0
bids_directory=${HOME}/xnat-exports/bnc/study-demodat2/bids
simg=/oscar/data/bnc/simgs/brownbnc/xnat-tools-${version}.sif
apptainer exec \
  --no-home \
  -B ${bids_directory}:/bids:ro \
  -B /oscar/scratch/${USER}:/scratch \
  ${simg} \
  env DENO_DIR=/scratch/deno deno run -A -qr jsr:@bids/validator /bids
```

{% endcode %}

### 1. Log into oscar and start an interactive section

If you are using the [Desktop app on Open OnDemand](https://docs.ccv.brown.edu/bnc-user-manual/using-oscar/oscar-utility-script#id-1.-start-an-interactive-session), then you are already inside an interactive session and you just need to open the terminal. Otherwise, you can start an interactive job of 1 hour with

```bash
interact -n 2 -t 01:00:00 -m 8g
```

### 2. Define variables

#### Specify the version of xnat-tools you want to use. Any version from [v2.1.0](https://github.com/brown-bnc/xnat-tools/releases/tag/v2.1.0) onward will automatically run the most recent version of the BIDS validator.

```bash
version=v2.3.0
```

You can run `ls /oscar/data/bnc/simgs/brownbnc/xnat-tools*` to print all available versions

#### Set up paths

Specify your **bids directory.** This is where `dataset_description.json` file lives

```bash
bids_directory=${HOME}/xnat-exports/bnc/study-demodat2/bids
```

Path to Apptainer/Singularity Image for xnat-tools, which contains the BIDS validator

```bash
simg=/oscar/data/bnc/simgs/brownbnc/xnat-tools-${version}.sif
```

### 3. Run the main executable via apptainer \[formerly singularity]

The following command runs the BIDS validator (via our xnat-tools apptainer image) to test if a directory is BIDS compliant. The command tells apptainer to launch the `xnat-tools-${version}.sif` image and run the `@bids/validator` with a program called deno. The bids validator expects a directory as an input, which in this case corresponds to `${bids_directory}`. The `-B ${bids_directory}:/bids:ro` makes the `${HOME}/xnat-exports/bnc/study-demodat2/bids` directory available read-only inside the container at the path `/bids`.

```bash
apptainer exec \
  --no-home \
  -B ${bids_directory}:/bids:ro \
  -B /oscar/scratch/${USER}:/scratch \
  ${simg} \
  env DENO_DIR=/scratch/deno deno run -A -qr jsr:@bids/validator /bids
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ccv.brown.edu/bnc-user-manual/xnat-to-bids-intro/bids-validation/oscar.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
