NCIT tutorial

  • author: Chris Mungall

  • created: 2022-11-11

This tutorial walks through NCIT-OBO, the goals are:

  • to help understand the structure of ncit

  • to show how to do advanced OAK queries (CLI and programmatic) on NCIT

Create an alias

For convenience we will set a bash alias.

[5]:
%alias ncit runoak -i sqlite:obo:ncit

Basic lookup queries

Let’s check it’s working:

[8]:
ncit info NCIT:C4872
NCIT:C4872 ! Breast Carcinoma
[9]:
ncit info "Breast Carcinoma"
NCIT:C4872 ! Breast Carcinoma

Exploring the structure of NCIT

[12]:
phenio relationships NCIT:C4872
subject subject_label   predicate       predicate_label object  object_label
NCIT:C4872      Breast Carcinoma        NCIT:R101       Disease_Has_Primary_Anatomic_Site       NCIT:C12971     Breast
NCIT:C4872      Breast Carcinoma        NCIT:R103       Disease_Has_Normal_Tissue_Origin        NCIT:C12937     Mammary Epithelium
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C2916      Carcinoma
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C9335      Malignant Breast Neoplasm
NCIT:C4872      Breast Carcinoma        owl:equivalentClass     None    _:riog00972235  None
[11]:
phenio relationships --include-entailed NCIT:C4872
subject subject_label   predicate       predicate_label object  object_label
NCIT:C4872      Breast Carcinoma        NCIT:R100       Disease_Has_Associated_Anatomic_Site    NCIT:C12219     Anatomic Structure, System, or Substance
NCIT:C4872      Breast Carcinoma        NCIT:R100       Disease_Has_Associated_Anatomic_Site    NCIT:C12971     Breast
NCIT:C4872      Breast Carcinoma        NCIT:R100       Disease_Has_Associated_Anatomic_Site    NCIT:C13018     Organ
NCIT:C4872      Breast Carcinoma        NCIT:R105       Disease_Has_Abnormal_Cell       NCIT:C12913     Abnormal Cell
NCIT:C4872      Breast Carcinoma        NCIT:R105       Disease_Has_Abnormal_Cell       NCIT:C12922     Neoplastic Cell
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C26709     Breast Disorder
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C27551     Disorder by Site
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C2910      Breast Neoplasm
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C2916      Carcinoma
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C2991      Disease or Disorder
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C3262      Neoplasm
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C3263      Neoplasm by Site
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C3709      Epithelial Neoplasm
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C4741      Neoplasm by Morphology
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C4872      Breast Carcinoma
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C7057      Disease, Disorder or Finding
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C7062      Neoplasm by Special Category
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C9305      Malignant Neoplasm
NCIT:C4872      Breast Carcinoma        rdfs:subClassOf None    NCIT:C9335      Malignant Breast Neoplasm
NCIT:C4872      Breast Carcinoma        owl:equivalentClass     None    _:riog00922295  None

Here we can see linkages to external ontologies using two relations

Querying ancestors

We will try finding all ancestors of NCIT:C4872

IMPORTANT in OAK, all graph commands are parameterized by predicate lists. Consult the OAK docs if you don’t understand what this means!

To find all is-a ancestors (i.e. ancestors following SubClassOf between named classes) we use -p i:

[13]:
ncit ancestors -p i NCIT:C4872
NCIT:C26709 ! Breast Disorder
NCIT:C27551 ! Disorder by Site
NCIT:C2910 ! Breast Neoplasm
NCIT:C2916 ! Carcinoma
NCIT:C2991 ! Disease or Disorder
NCIT:C3262 ! Neoplasm
NCIT:C3263 ! Neoplasm by Site
NCIT:C3709 ! Epithelial Neoplasm
NCIT:C4741 ! Neoplasm by Morphology
NCIT:C4872 ! Breast Carcinoma
NCIT:C7057 ! Disease, Disorder or Finding
NCIT:C7062 ! Neoplasm by Special Category
NCIT:C9305 ! Malignant Neoplasm
NCIT:C9335 ! Malignant Breast Neoplasm

Next we will generate a visualization from this using the viz command:

[14]:
ncit viz -p i NCIT:C4872 -o output/NCIT_C4872.png

img

[18]:
ncit viz -p i,NCIT:R101,NCIT:R103,NCIT:R82 NCIT:C4872 -o output/NCIT_C4872_multirel.png

img