ABC-INT-Categorical features

From "A B C"
Jump to navigation Jump to search

Integrator Unit: Categorical Features

(Integrator unit: collect categorical features for human genes)


 


Abstract:

This page integrates material from the learning units and defines a task for defining and downloading categorical feature sets for human genes.


Deliverables:

  • Integrator unit: Deliverables can be submitted for course marks. See below for details.

  • Prerequisites:
    This unit builds on material covered in the following prerequisite units:


     


    This page is not currently being maintained since it is not part of active learning sections.


     



     


    Evaluation

    Your progress and outcomes of this "Integrator Unit" will be one of the topics of the first oral exam for BCB420/JTB2020. That oral exam will be worth 20% of your term grade.[1].

    • Work through the tasks described below.
    • Note that there are several tasks that need to be coordinated with your teammates and classmates. This is necessary to ensure the feature sets can be merged in the second phase of the course. Be sure to begin this coordination process in time.
    • Remember to document your work in your journal concurrently with your progress. Journal entries that are uploaded in bulk at the end of your work will not be considered evidence of ongoing engagement. Note that this is a team task, and your contribution to the task must be clearly documented in your journal for evaluation.
    • Your task will involve submitting documentation on a sub-page of the Teams and Tasks page. (Details below) This documentation will be jointly authored and I expect every team member to be able to speak to all of it.
    • Schedule an oral exam (if you haven't done so already) by editing the signup page on the Student Wiki. You must have signed-up for an exam slot before 20:00 on the day before your exam.[2]
    • Your work must be complete before 20:00 on the day before your exam.


     

    Contents

    Most interesting data that describes function in living cells is not numerical, but categorical. Moreover, it is data with large numbers of categories - "high cardinality categorical data". Such data is problematic for machine learning for reasons of principle and practicality. Such data is sparse, and the many dimensions of noise make overfitting of data a strong concern, in particular if we do not have very large numbers of examples in our training sets. The data suffers from the "curse of dimensionality", i.e. all examples look similarly similar or different. And the datastructures that hold such data may become impractically large, and model training may take impractically long. In this integrator unit we will download and prepare different types of categorical data to explore later how to use feature engineering to optimize it for machine learning tasks.

    Your tasks as a team are:

    • to choose one of the datasets of interest for human systems biology specified below;
    • to download the source data;
    • to determine the necessary steps for processing and to distribute the necessary tasks among the team members;
    • to format the data for use as categorical features as specified below;
    • to document what you have achieved, including your scripts and tools and one annotaded subset of 20 genes.


    To begin, you need to choose - as a team - one of the following five data sources of categorical functional data. Rank the units in terms of preference (or write "random"). Your team spokesperson should eMail me your team's preferences. I will assign the choices. (Done)


     

    (1) Graph data mining on STRING (Aaardvark)

     

    The STRING database publishes a network of gene nodes and edges that represent functional interactions: these integrate various experimental observations and computational inference, such as protein-protein interactions and literature data mining - or they can be decomposed by individual categories of evidence. A summary score is given as a probability of an edge to be functionally relevant. Network data mining for ML features is a very interesting topic in and of itself, here we will simply take the neighbours of a gene as categorical features that describe its environment. Task: using a suitable score cutoff, produce a table of STRING neigbours for each human gene that is defined in our HUGO symbol table. Upload the annotation for the miniHUGOsymbols list to your documentation.

    Example row:

    TNFRSF4 TNFRSF9|CTLA4|TNFSF4|TRAF5|IL2|IL2RA|FOXP3
    


     

    (2) GO and GOA (Chihuahua)

     

    Gene Ontology Annotations (GOA) provide the cornerstone of functional annotations for genes. Build a pipeline to annotate each HUGO symbol with the Gene Ontology (GO) terms found in the relevant GOA tables. Task: produce a table of GO terms annotated for each human gene defined in our HUGO symbol table. Do this separately for the three GO ontologies. Upload the annotation for the miniHUGOsymbols list to your documentation.

    Example header and row:

    symbol MF  BP  CC
    TNFRSF4 GO:0001618|GO:0005031|GO:0005515 GO:0006954|GO:006955|GO:0007275  GO:0005886|GO:0005887|GO:0009986
    


     

    (3) MSigDB sets (Cricket)

     

    The Broad Institute hosts an expert-curated database of gene sets: MSigDB - the Molecular Signature Database. Task: download the data and build a pipeline to annotate all HUGO gene symbols with all of the gene sets that contain them. Annotate the miniHUGOsymbols list and upload it to your documentation; also test how your pipeline will scale to the full dataset of more than 17,000 gene sets.

    Example row:

    TNFRSF4 M1739|M5947|M18255|M13664|M1644|M4248
    


     

    (4) Enrichment (Owl)

     

    A common aspect of systems biology wet-lab experiments is that they produce a set-of-genes result: genes that co-precipitate, genes that are co-regulated, genes that are phosporylated by the same kinase, etc. etc. Enrichment algorithms ask: what do such genes have in common, i.e. what feature appears more frequently in the set than one would expect in a randomly chosen set of genes. Any type of annotation can be chosen, but existing packages usually use GO annotations. Candidate tools include topGO, and other tools in the Gene Set Enrichment biocView[3]. Task: build a pipeline that takes as input a set of HUGO symbols - such as the sets derived from the MSigDB above, and outputs an annotation of enriched GO terms for each of the set elements. Develop this for the miniHUGOsymbols list and a few other gene sets and upload the results for the miniHUGOsymbols list to your documentation.

    Example row:

    TNFRSF4 GO:0097190|GO:0051024|GO:0033209|GO:0032496
    


     

    (5) InterPro (Python)

     

    InterPro provides rich sequence and domain annotation - and the domain composition of a protein is a categorical feature set. Download of InterPro data is available. Task: produce a table of InterPro domains in each human gene as defined by our HUGO symbol table. Upload the annotation for the miniHUGOsymbols list to your documentation. Example row:

    TNFRSF4 IPR034022|IPR001368|IPR001368
    


     
    Do not upload your full datasets to the Github repository!


     

    Process Details

     

    Below are the general details for the tasks as they apply to four of the five alternatives. "Enrichment" is different because it does not produce a set of category annotations, but a pipeline to prodcue data for such a set. Apply the details in spirit.


     

    Study your Data Source

     

    Task:

     
    Navigate to the source database and clarify the format and semantics of the data ...

    For example: you need to understand what the data is, and how it can annotate individual genes. You need to understand which gene identifiers are used and how they map to the HUGO symbols. You need to know what download formats are available, and what the downloads contain. You also need to understand how the data was curated, if and when it is being updated, what its copyright status is and and what the reference citation is. (This list is not necessarily exhaustive.)


     


     


     

    Download your Data

     

    Task:

     
    In your process script, develop code to download the source data; then assess what you have and load it into R ...
    • If possible, identify both an URL for the most recent version of the downloadable data (for future updates), and a stable URL for the exact version you have used (best practice for reproducible research);
    • Some of the datasets require registration: in that case it may be better to manually download, rather than pass credentials in a script. If you feel you must pass login credentials in a download script, ask me about best-practice for that.
    • Once your data is downloaded, uncompress and untar it. Identify the structure of the data. Usually this will be a tsv or csv plain text file, possibly with column headers, possibly with meta information. Identify the columns you need.
    • Read your data into R. You need to know whether your data has headers, and how many extra lines need to be skipped. I highly recommend using the readr package functions - they are very flexible and much faster than R's standard functions. readr functions allow you to only read the columns you actually need. The only downside (if indeed that is one) is that they produce "tibbles", not data frames. You may need to convert your results later.


     

    (You are encouraged to discuss questions about these processes on the mailing list and share experiences!)


     


     

    Map identifiers

     

    Task:

     
    Develop code to map source IDs to HUGO symbols ...

    There are two points to consider:

    • Map source data IDs to HUGO symbols. If your source data does not include HUGO symbols, you may need to map ... e.g. STRING uses ensembl IDs, but they also have a table of mappings for download.
    • Once you have HUGO symbols, you may need to update them as they may contain previous symbols or aliases. This is the same process that you have gone through when you worked with your expression data sets.


     

    (Contact me in case this process does not seem completely starightforward and you need advice.)


     


     

    Define your datastructure

     

    Task:

     
    Define the datastructure to hold the category data
    • Your datastructure should be a dataframe with two columns of character data. The "GO and GOA" structure will have four columns..
    • The first column should contain the HUGO symbols and be named symbols.
    • The rownames should be set to the HUGO symbols. Therefore you can access specific rows with syntax like
    sel <- which(cats$symbol == "TNFRSF4") or
    cats["TNFRSF4", "signatures"], and the latter is much faster.
    • The category column should be named neighbours (STRING), MF,BP, and CC (GOA), signatures (MSigDB), or domains (InterPro).
    • Each element of the category column should be a string of category identifiers separated with a "|" (pipe) character. Consider the following code:
    myCats <- c("M1739", "M5947", "M18255", "M13664", "M1644", "M4248")
    (x <- paste0(myCats, collapse = "|"))
    strsplit(x, "\\|")   # Note: this produces a list - use unlist() or [[1]] if required


     


     


     

    Build your category table

     

    Task:

     

    Building the actual table is going to be specific for each set. Try this first with a small number of entries to get a sense of how long the full dataset will take. If it appears to take longer than an hour or so, contact me. We can either optimize the code, or split the task, or defer it. Minimally, you must annotate the 20 genes in the miniHUGOsymbols set.


     


     

    Assess your results

     

    Task:

     
    Develop code to compile annotation statistics ...

    Minimally you should report -

    • Number of source data items;
    • Number of unique genes in the source data;
    • Number of source genes that could not mapped to HUGO symbols;
    • Number and percentage of HUGO symbols annotated;
    • Number of unique annotations (i.e. cardinality of categories).

    (This list is not exhaustive and I expect that you will be able to define additional, informative statistics.)


     
    • Can you validate that your results are correct and complete?


     
    Discuss with me how to proceed if a full annotation can't be computed with reasonable resources.


     


     


     

    Refactor your script

     

    Task:

     
    When you are done, review and refactor your script ...
    • Does the script include all the required information items suggested by the script template in the zu repository ?
    • Does your code conform to the Coding style requirements for this course?
    • Is the script fully commented?
    • Did you load all required libraries?
    • Did you comment and justify all parameters?
    • Are there any "magic numbers" left in the code?
    • Is the code parsimonious in its activities and efficient in its program flow (e.g. doesn't grow large datastructures dynamically, takes advantage of vectorized functions wherever possible, doesn't perform activities inside of loops that don't depend on the loop variable, etc. etc.)?


     

    (This list is not exhaustive.)


     

    For the evaluation of your results: Form matters!


     


     

    Document your work

     

    Task:

     
    Every category task has a subpage for documentation linked from the teams and tasks page ...

    Documentation needs to be brief and complete and describe the final result unambiguously. You don't need to document your activities here - this goes into your respective Course Journals. Describe your results, and include your miniHUGOsymbols annotations, and your complete script (with proper GeSHi highlighting). A SPN diagram may help to make the dataflow clear.

    Form matters.


     


     

    Further reading, links and resources

    • HUGO Gene Nomenclature Committee - the authoritative information source for gene symbols. Includes search functions for synonyms. aliases and other information, as well as downloadable data.


    Notes

     
    1. Note: oral exams will focus on the content of Integrator Units, but will also cover material that leads up to it. All exams in this course are cumulative.
    2. For clarification: You sign up for only one oral exam for February.
    3. Note GSEA (Gene Set Enrichment Analysis) is not the same as gene feature enrichment.


     


     


    About ...
     
    Author:

    Boris Steipe <boris.steipe@utoronto.ca>

    Created:

    2018-02-01

    Modified:

    2018-02-03

    Version:

    1.2.1

    Version history:

    • 1.2.1 Sleeping ...
    • 1.2 Tasks are assigned to teams
    • 1.1 Added task details
    • 1.0 Category tasks defined
    • 0.1 New unit under development

    CreativeCommonsBy.png This copyrighted material is licensed under a Creative Commons Attribution 4.0 International License. Follow the link to learn more.

    This page is not currently being maintained since it is not part of active learning sections.