diff --git a/Dockerfile b/Dockerfile index 6542bdc..4411cc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,6 +50,7 @@ ADD dendR/nomenclature_builder.R $WORKSPACE/dendR ADD dendR/install_packages.R $WORKSPACE/dendR ADD dendR/required_scripts.R $WORKSPACE/dendR ADD scripts/run.sh $WORKSPACE/scripts +ADD scripts/run.bat $WORKSPACE/scripts ADD scripts/import.py $WORKSPACE/scripts ADD scripts/configurations.py $WORKSPACE/scripts diff --git a/docs/Build.md b/docs/Build.md index 58ae9cc..512a831 100644 --- a/docs/Build.md +++ b/docs/Build.md @@ -21,8 +21,7 @@ docker rmi $(docker images 'ghcr.io/brain-bican/taxonomy-development-tools:lates docker pull ghcr.io/brain-bican/taxonomy-development-tools:latest ``` - -# Install requirements +# Install Requirements ## Docker @@ -34,16 +33,20 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ## Git -1. Setup your GitHub user configs +1. Make sure you have [Git installed](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). + +2. Set up your GitHub user configs ``` git config --global user.name "your_github_user" git config --global user.email "your_github_email" ``` -2. Create a GitHub [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic). +3. Create a GitHub [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic). + +4. Set `GH_TOKEN` environment variable. -3. Set `GH_TOKEN` environment variable. +**_For Linux and MacOS:_** - You can use `nano` or any other editor to edit the files. @@ -67,16 +70,27 @@ export GH_TOKEN=my_github_personal_access_token_here` `source ~/.bashrc` or `source ~/.zshrc` -- Test your new config: +- Test your new config open a new Terminal and run: ``` echo $GH_TOKEN ``` +**_For Windows:_** +``` +setx GH_TOKEN my_github_personal_access_token_here +``` + +- To test your new config open a new Command Prompt (Terminal) and run: +``` +echo %GH_TOKEN% +``` ## Build Taxonomy Development Tools (Optional) -Users are suggested to use the [Get Taxonomy Development Tools](#get-taxonomy-development-tools) step to have a TDT Docker Image. But, alternatively, you can build TDT docker image in your local. Checkout the project and run given command in the project root folder: +This step is optional and specifically aimed at users interested in utilizing the development branch of the TDT. Please note that the development branch may exhibit instability. + +For those looking to use the TDT, it's recommended to follow the [Get Taxonomy Development Tools](#get-taxonomy-development-tools) section to obtain a TDT Docker Image. However, as an alternative, you have the option to build the TDT Docker image locally. To do this, clone the project repository and execute the provided command within the root directory of the project: ``` docker build --no-cache -t "ghcr.io/brain-bican/taxonomy-development-tools" . diff --git a/docs/Curation.md b/docs/Curation.md index 993cb2b..e42114b 100644 --- a/docs/Curation.md +++ b/docs/Curation.md @@ -12,11 +12,21 @@ docker pull ghcr.io/brain-bican/taxonomy-development-tools:latest bash ./run.sh make load_data ``` +> For Windows: +> ``` +> run.bat make load_data +> ``` + 4- Run following command to run the online data editor: ``` bash ./run.sh make serve ``` +> For Windows: +> ``` +> run.bat make serve +> ``` + This command will print a set of logs including a log like `nanobot::serve: listening on 0.0.0.0:3000`. This means your web editor is ready, and you can start editing your data. 5- You can start browsing web taxonomy editor from: [http://localhost:3000/table](http://localhost:3000/table) @@ -29,4 +39,9 @@ Once you complete your editing, you can run the following command to save your o bash ./run.sh make save ``` +> For Windows: +> ``` +> run.bat make save +> ``` + Your data will be saved into `curation_tables` folder \ No newline at end of file diff --git a/docs/NewRepo.md b/docs/NewRepo.md index 474cff2..a269e89 100644 --- a/docs/NewRepo.md +++ b/docs/NewRepo.md @@ -18,9 +18,9 @@ We will walk you though the steps to make a new ontology project `docker pull ghcr.io/brain-bican/taxonomy-development-tools:latest` -**NOTE** The very first time you run this it may be slow, while docker downloads necessary images. Don't worry, subsequent runs should be much faster! +**NOTE:** The very first time you run this it may be slow, while docker downloads necessary images. Don't worry, subsequent runs should be much faster! -**NOTE** Windows users, occasionally it has been reported that files downloaded on a Windows machine get a wrong file ending, for example `seed-via-docker.bat.txt` instead of `seed-via-docker.bat`, or, as we will see later, `project.yaml.txt` instead of `project.yaml`. If you have problems, double check your files are named correctly after the download! +**NOTE:** Windows users, occasionally it has been reported that files downloaded on a Windows machine get a wrong file ending, for example `seed-via-docker.bat.txt` instead of `seed-via-docker.bat`, or, as we will see later, `project.yaml.txt` instead of `project.yaml`. If you have problems, double check your files are named correctly after the download! ## 3. Run the wrapper script @@ -39,7 +39,7 @@ Using the predefined [CCN20230601_project_config.yaml](https://github.com/brain- seed-via-docker.bat -C CCN20230601_project_config.yaml This will create your starter files in -`target/human_m1`. It will also prepare an initial +`target/nhp_basal_ganglia_taxonomy`. It will also prepare an initial release and initialize a local repository (not yet pushed to your Git host site such as GitHub or GitLab). ### Problems? diff --git a/docs/index.md b/docs/index.md index 8938125..00ea73d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,12 +1,11 @@ # Taxonomy Development Tools Guide -This guide is intended for maintainers and editors of CCN2 Taxonomies. +This guide is designed for the maintainers and editors responsible for managing CCN2 Taxonomies. -The first part of the guide is how to set up a new taxonomy -project. This requires some technical steps. +Initially, the guide provides instructions on preparing your system and initiating a new taxonomy project, which involves several technical procedures. -The second part of the guide is for curating the CCN2 taxonomies. +Subsequently, it delves into the process of curating the CCN2 taxonomies, offering detailed guidance on the necessary steps and considerations. +- [Get Your System Ready](Build.md) - [Create a New Repo](NewRepo.md) -- [Get TDT Docker Image](Build.md) - [Start Curating Taxonomies](Curation.md) diff --git a/scripts/run.bat b/scripts/run.bat new file mode 100644 index 0000000..11a62b5 --- /dev/null +++ b/scripts/run.bat @@ -0,0 +1,3 @@ +if not exist "%homedrive%%homepath%\tdt_datasets" mkdir "%homedrive%%homepath%\tdt_datasets" + +docker run -v "%cd%:/work" -v "%homedrive%%homepath%\tdt_datasets:/tdt_datasets" -w /work --rm -ti -p 3000:3000 -p 8000:8000 -e "GITHUB_AUTH_TOKEN=%GH_TOKEN%" --env "GITHUB_USER=%GITHUB_USER%" --env "GITHUB_EMAIL=%GITHUB_EMAIL%" ghcr.io/brain-bican/taxonomy-development-tools %* \ No newline at end of file diff --git a/tdt/tdt.py b/tdt/tdt.py index dea8155..acbfc7b 100644 --- a/tdt/tdt.py +++ b/tdt/tdt.py @@ -358,6 +358,11 @@ def create_run_script(outdir, tgts): tgts.append(run_script_target) copy(run_script_source, run_script_target) + run_script_source_win = WORKSPACE + "/scripts/run.bat" + run_script_target_win = "{}/run.bat".format(outdir) + tgts.append(run_script_target_win) + copy(run_script_source_win, run_script_target_win) + def create_output_file(outdir, project, tgts): output_file = "{}/{}.json".format(outdir, project.id)