Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed files that are repeated in obook #578

Merged
merged 4 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 1 addition & 82 deletions docs/CreateNewTerm.md
Original file line number Diff line number Diff line change
@@ -1,82 +1 @@
**NOTE** This documentation is incomplete, for now you may be better consulting the [GO Editor Docs](http://wiki.geneontology.org/index.php/Ontology_Editing_Guide)

# Creating a New Ontology Term

See [Daily Workflow](http://ontology-development-kit.readthedocs.io/en/latest/index.html#daily-workflow) for creating branches and basic Protégé instructions.

1. To create a new term, the 'Asserted view' must be active (not the 'Inferred view').

2. In the Class hierarchy window, click on the 'Add subclass' button at the upper left of the window.

3. A pop-up window will appear asking you to enter the Name of the new term. When you enter the term name, you will see your ID automatically populate the IRI box. Once you have entered the term, click 'OK' to save the new term. You will see it appear in the class hierarchy.

4. Navigate to the OBO annotation window.

5. In the OBO annotation window add:

1. Namespace
1. Begin typing one of the three branches (autocomplete will guide you to the correct term):
- ```biological_process```
- ```cellular _component```
- ```molecular_function```
2. For Type, select: ```xsd:string```

2. Definition
1. Click on the ```+``` next to the Definition box
2. Add the textual definition in the pop-up box.
3. For Type, select: ```Xsd:string```
4. Click OK.

3. Add Definition References
1. Click on the circle with the ‘Ref’ in it next to add Definition References and in the resulting pop-up click on the ```+``` to add a new ref, making sure they are properly formatted with a database abbreviation followed by a colon, followed by the text string or ID. Examples: ```GOC:bhm, PMID:27450630```.
2. Select Type: ```xsd:string```
3. Click OK.
4. Add each definition reference separately by clicking on the ```+``` sign.

4. Add synonyms and dbxrefs following the same procedure if they are required for the term.
6. If you have created a logical definition for your term, you can delete the asserted ```is_a``` parent in the ‘subclass of’ section. Once you synchronize the reasoner, you will see the automated classification of your new term. If the inferred classification doesn’t make sense, then you will need to modify the logical definition.

```
Protege tip: If you need to create a logical definition using a GO term name that does not begin
with an alphabetic character, e.g. GO:0004534 (5'-3' exoribonuclease activity), navigate to the
View menu in Protege and select 'Render by entity IRI short name (Id). This will allow you to
enter a logical definition by entering the relations and term as IDs, e.g. RO_0002215 some GO_0004534.
Note the use of the underscore instead of the colon in the ID. You can then return to the View
menu to switch back to Render by label (rdfs:label) to see the term names.
```

7. In some cases such as ```part_of``` relations based on external partonomies, it might be necessary to assert the ```part_of``` relationships. For example: ```‘heart valve development’ part_of some ‘heart development’```. In those cases, it is important to browse the external ontologies to be sure that nothing is missing.

8. When you have finished adding the term, you can hover over it in the class window to reveal its GO_id.

9. Save the file and ___return to your terminal window___. Then, type: ```git status```. This will confirm which file has been modified.

10. To see how the branch was modified, type: ```git diff```. In this case, go-edit.obo was modified. The text below is not the entire diff for this edit, but is an example. If the diff is very large, you will need to hit a space to continue to see it and then hit ‘q’ to get back to the prompt at the end of the diff file.

```
~/repos/MY-ONTOLOGY/src/ontology(issue-13390) $ git diff
diff --git a/src/ontology/go-edit.obo b/src/ontology/go-edit.obo
index 72ae7e9..8d47fa1 100644
--- a/src/ontology/go-edit.obo
+++ b/src/ontology/go-edit.obo
@@ -400751,6 +400751,85 @@ created_by: dph
creation_date: 2017-04-28T12:39:13Z

[Term]
+id: GO:0061868
+name: hepatic stellate cell migration
+namespace: biological_process
+def: "The orderly movement of a hepatic stellate cell from one site to another." [PMID:24204762]
+intersection_of: GO:0016477 ! cell migration
+intersection_of: results_in_movement_of CL:0000632 ! hepatic stellate cell
+created_by: dph
+creation_date: 2017-05-01T13:01:40Z
+
+[Term]
id: GO:0065001
name: specification of axis polarity
namespace: biological_process
~/repos/MY-ONTOLOGY/src/ontology(issue-13390) $
```

See [Daily Workflow](http://ontology-development-kit.readthedocs.io/en/latest/index.html#daily-workflow) section for commit, push and merge instructions.
Please refer to https://oboacademy.github.io/obook/howto/create-new-term/
165 changes: 1 addition & 164 deletions docs/CreatingRepo.md
Original file line number Diff line number Diff line change
@@ -1,164 +1 @@
# Creating a new Repository with the Ontology Development Kit

This is instructions on how to create an ontology repository in
GitHub. This will only need to be done once per project. You may need
assistance from someone with basic unix knowledge in following
instructions here.

We will walk you though the steps to make a new ontology project

## 1. Install requirements

* [docker](https://www.docker.com/get-docker): Install Docker and make sure its runnning properly, for example by typing `docker ps` in your terminal or command line (CMD). If all is ok, you should be seeing something like:

```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
```

* git, for example bundled with [GitHub Desktop](https://desktop.github.com/)

## 2. Download the wrapper script and pull latest ODK version

* Linux/Mac: [seed-via-docker.sh](https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/seed-via-docker.sh)
* PC: [seed-via-docker.bat](https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/seed-via-docker.bat)
* You should have git installed - for the repo command to work perfectly, it requires a `.gitconfig` file in your user directory!
* First, make sure you have Docker running (you will see the Docker whale in your toolbar on a Mac)
* To make sure you have the latest version of the ODK installed, run in the command line

`docker pull obolibrary/odkfull`

**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!

## 3. Run the wrapper script

You can either pass in a configuration file in YAML format that specifies your ontology project setup, or you can pass arguments on the command line.

### Unix (Max, Linux)

Passing arguments on the command line:

./seed-via-docker.sh -d po -d ro -d pato -u cmungall -t "Triffid Behavior ontology" triffo

Using a the predefined [project.yaml](https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/examples/triffo/project.yaml) file:

./seed-via-docker.sh -C examples/triffo/project.yaml

### Windows

Passing arguments on the command line:

seed-via-docker.bat -d po -d ro -d pato -u cmungall -t "Triffid Behavior ontology" triffo

Using a the predefined [project.yaml](https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/examples/triffo/project.yaml) config file:

seed-via-docker.bat -C project.yaml

### General instructions for both Linux and Windows

- Instead of `-u cmungall` you should be using your own username (i.e. `-u nico`), for example for your GitHub or GitLab hosting sites.
- You can add a -c (lowercase) just before the -C (capital c) in the command to first delete any previous attempt to generate your ontology with the ODK, and then replaces it with a completely new one. So, `-c` stands for `clean` or "clean up previous attempts before running again" and `-C` stands for "the next parameter is the relative path to my config file".
- In general, we now _always_ recommend the use of config files. The ODK has a rich set of configuration options, most of which can only be set through the config file, but in general the config also serves as documentation and will help with updating your ontology at later stages.
To create a config file, you can download for example [project.yaml](https://raw.githubusercontent.com/INCATools/ontology-development-kit/master/examples/triffo/project.yaml) by clicking on the link and then typing `command+s` on Mac or `ctrl+s` on Windows to save it in the same directory as your `seed-via-docker` script.
Then you can open the file with a text editor like Notepad++, Atom, Sublime or even nano, and adapt it to your project. Other more comprehensive examples can be found [here](https://github.com/INCATools/ontology-development-kit/tree/master/configs).

This will create your starter files in
`target/triffid-behavior-ontology`. 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?

There are three frequently encountered problems at this stage:

1. No `.gitconfig` in user directory
2. Spaces is user path
3. During download, your filenames got changed (Windows)

#### No `.gitconfig` in user directory

The seed-via-docker script requires a `.gitconfig` file in your user directory. If your `.gitconfig` is in a different directory, you need to change the path in the downloaded `seed-via-docker` script. For example on Windows (look at `seed-via-docker.bat`):

```
docker run -v %userprofile%/.gitconfig:/root/.gitconfig -v %cd%:/work -w /work --rm -ti obolibrary/odkfull /tools/odk.py seed %*
```

`%userprofile%/.gitconfig` should be changed to the correct path of your local `.gitconfig` file.

#### Spaces is user path

We have had reports of users having trouble if there paths (say, `D:\data`) contain a space symbol, like `D:/Dropbox (Personal)` or similar. In this case, we recommend to find a directory you can work in that does not contain a space symbol.

You can customize at this stage, but we recommend to first push the changes to you Git hosting site (see next steps).

#### During download, your filenames got changed (Windows)

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!


## 4. Push to Git hosting website

The development kit will automatically initialize a git project, add all files and commit.

You will need to create a project on you Git hosting site.

*For GitHub:*

1. Go to: https://github.com/new
2. The owner MUST be the org you selected with the `-u` option. The name MUST be the one you set with `-t`, just with lower case letters and dashes instead of spaces. In our example above, the name "Triffid Behavior Ontology" translates to `triffid-behavior-ontology`.
3. Do not initialize with a README (you already have one)
4. Click Create
5. See the section under "…or push an existing repository from the command line"

*For GitLab:*

1. Go to: https://gitlab.com/projects/new
2. The owner MUST be the org you selected with the `-u` option. The name MUST be the one you set with `-t`.
3. Do not initialize with a README (you already have one)
4. Click 'Create project'
5. See the section under "Push an existing Git repository"

Follow the instructions there. E.g. (make sure the location of your remote is exactly correct!).

```
cd target/triffo
git remote add origin https://github.com/matentzn/triffid-behavior-ontology.git
git branch -M main
git push -u origin main
```

Note: you can now mv `target/triffid-behavior-ontology` to anywhere you like in your home directory. Or you can do a fresh checkout from github.

### Alternative recommendation for GitHub by @matentzn

I generally feel its easier and less error prone to deviate from the standard instructions above. I keep having problems with git, passwords, typose etc, so I tend to do it, inofficially, as follows:

1. When my repo is created I go to my GitHub Desktop
2. I then do File > Add local repository, and select the directory which contains my newly created repo (e.g. `target/triffo`).
3. I then Click on "Publish repository".
4. If I want the code to be public, I deselect "Keep this code private". By default, the repo will be uploaded to my own user profile on GitHub, but I can also select another Organization I have access to in the respective Dropdown menu.
5. NOTE: there seem to be some issues with pushing a GitHub Workflow file recently - you may be asked by GitHub Desktop to provide an additional permission to push the Workflow file.

## Next Steps: Edit and release cycle

In your repo you will see a README-editors.md file that has been customized for your project. Follow these instructions.

## OBO Library metadata

The assumption here is that you are adhering to OBO principles and
want to eventually submit to OBO. Your repo will contain stub metadata
files to help you do this.

You can create pull requests for your ontology on the OBO Foundry. See the `src/metadata` file for more details.

For more documentation, see http://obofoundry.org

## Additional

You will want to also:

* enable GitHub actions

See the README-editors.md file that has been generated for your project.
Please refer to https://oboacademy.github.io/obook/howto/odk-create-repo/
Loading