My current work.
This commit is contained in:
parent
25249108ca
commit
b51476f5a0
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#TOC> ==========================================================================
|
#TOC> ==========================================================================
|
||||||
#TOC>
|
#TOC>
|
||||||
#TOC> Section Title Line
|
#TOC> Section Title Line
|
||||||
#TOC> -----------------------------------------------------------------------
|
#TOC> -----------------------------------------------------------------------
|
||||||
#TOC> 1 A Relational Datamodel in R: review 63
|
#TOC> 1 A Relational Datamodel in R: review 63
|
||||||
@ -56,7 +56,7 @@
|
|||||||
#TOC> 3.3 Create an R script to create your own database 572
|
#TOC> 3.3 Create an R script to create your own database 572
|
||||||
#TOC> 3.3.1 Check and validate 600
|
#TOC> 3.3.1 Check and validate 600
|
||||||
#TOC> 3.4 Task: submit for credit (part 2/2) 645
|
#TOC> 3.4 Task: submit for credit (part 2/2) 645
|
||||||
#TOC>
|
#TOC>
|
||||||
#TOC> ==========================================================================
|
#TOC> ==========================================================================
|
||||||
|
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ str(philDB)
|
|||||||
# go back, re-read, play with it, and ask for help. These are the foundations.
|
# go back, re-read, play with it, and ask for help. These are the foundations.
|
||||||
|
|
||||||
|
|
||||||
# === 1.1.1 completing the database
|
# === 1.1.1 completing the database
|
||||||
|
|
||||||
|
|
||||||
# Next I'll add one more person, and create the other two tables:
|
# Next I'll add one more person, and create the other two tables:
|
||||||
@ -293,6 +293,47 @@ for (ID in pID) {
|
|||||||
# BUT COPY THE EXACT, COMPLETE OUTPUT, PASTE IT INTO YOUR SUBMISSION,
|
# BUT COPY THE EXACT, COMPLETE OUTPUT, PASTE IT INTO YOUR SUBMISSION,
|
||||||
# AND FORMAT IT CORRECTLY.
|
# AND FORMAT IT CORRECTLY.
|
||||||
|
|
||||||
|
# == Submission - Code to add another philosopher to the datamodel:
|
||||||
|
|
||||||
|
pID <- autoincrement(philDB$person)
|
||||||
|
immanuelKant <- data.frame(id = pID,
|
||||||
|
name = "Immanuel Kant",
|
||||||
|
born = "1724",
|
||||||
|
died = "1804",
|
||||||
|
school = "Enlightenment Philosophy")
|
||||||
|
philDB$person <- rbind(philDB$person, immanuelKant)
|
||||||
|
|
||||||
|
bID = autoincrement(philDB$books)
|
||||||
|
immanuelKantWork <- data.frame(id = bID,
|
||||||
|
title = "Critique of Pure Reason",
|
||||||
|
published = "1781")
|
||||||
|
philDB$books <- rbind(philDB$books, immanuelKantWork)
|
||||||
|
philDB$works <- rbind(philDB$works, data.frame(id = autoincrement(philDB$works), personID = pID, bookID = bID))
|
||||||
|
|
||||||
|
bID = autoincrement(philDB$books)
|
||||||
|
immanuelKantWork <- data.frame(id = bID,
|
||||||
|
title = "Critique of Judgement",
|
||||||
|
published = "1790")
|
||||||
|
philDB$books <- rbind(philDB$books, immanuelKantWork)
|
||||||
|
philDB$works <- rbind(philDB$works, data.frame(id = autoincrement(philDB$works), personID = pID, bookID = bID))
|
||||||
|
|
||||||
|
# == Submission: Code to list the philosophical schools in alphabetical order as well as their respective books in alphabetical order.
|
||||||
|
|
||||||
|
schools <- unique(philDB$person$school)
|
||||||
|
schools <- sort(schools)
|
||||||
|
|
||||||
|
for (s in schools) {
|
||||||
|
cat(sprintf("%s\n", s))
|
||||||
|
authors = which(philDB$person$school == s)
|
||||||
|
for (author in authors) {
|
||||||
|
works = which(philDB$works$personID == author)
|
||||||
|
for (work in works) {
|
||||||
|
bookId = which(philDB$books$id == philDB$works$bookID[work])
|
||||||
|
cat(sprintf("\t%s - (%s)\n", philDB$books$title[bookId], philDB$books$published[bookId]))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# = 2 Implementing the protein datamodel ==================================
|
# = 2 Implementing the protein datamodel ==================================
|
||||||
|
|
||||||
@ -385,7 +426,7 @@ dbSanitizeSequence(x)
|
|||||||
|
|
||||||
# == 2.3 Create a protein table for our data model =========================
|
# == 2.3 Create a protein table for our data model =========================
|
||||||
|
|
||||||
# === 2.3.1 Initialize the database
|
# === 2.3.1 Initialize the database
|
||||||
|
|
||||||
|
|
||||||
# The function dbInit contains all the code to return a list of empty
|
# The function dbInit contains all the code to return a list of empty
|
||||||
@ -397,7 +438,7 @@ myDB <- dbInit()
|
|||||||
str(myDB)
|
str(myDB)
|
||||||
|
|
||||||
|
|
||||||
# === 2.3.2 Add data
|
# === 2.3.2 Add data
|
||||||
|
|
||||||
|
|
||||||
# fromJSON() returns a dataframe that we can readily process to add data
|
# fromJSON() returns a dataframe that we can readily process to add data
|
||||||
@ -444,7 +485,7 @@ source("./scripts/ABC-createRefDB.R")
|
|||||||
str(myDB)
|
str(myDB)
|
||||||
|
|
||||||
|
|
||||||
# === 2.4.1 Examples of navigating the database
|
# === 2.4.1 Examples of navigating the database
|
||||||
|
|
||||||
|
|
||||||
# You can look at the contents of the tables in the usual way we access
|
# You can look at the contents of the tables in the usual way we access
|
||||||
@ -597,7 +638,7 @@ if (file.exists(sprintf("./myScripts/%staxonomy.json", biCode(MYSPE)))) {
|
|||||||
# "break" them with a code experiment. But always have a script with
|
# "break" them with a code experiment. But always have a script with
|
||||||
# which you can create what you need.
|
# which you can create what you need.
|
||||||
|
|
||||||
# === 3.3.1 Check and validate
|
# === 3.3.1 Check and validate
|
||||||
|
|
||||||
|
|
||||||
# Is your protein named according to the pattern "MBP1_MYSPE"? It should be.
|
# Is your protein named according to the pattern "MBP1_MYSPE"? It should be.
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# options(stringsAsFactors = FALSE)
|
# options(stringsAsFactors = FALSE)
|
||||||
|
|
||||||
myEMail <- "<your-e-mail-address-here>" # e.g. "u.franklin@utoronto.ca"
|
myEMail <- "yh.deng@mail.utoronto.ca" # e.g. "u.franklin@utoronto.ca"
|
||||||
myStudentNumber <- <your-student-number-here> # e.g. 1003141592
|
myStudentNumber <- 1005845285 # e.g. 1003141592
|
||||||
|
MYSPE <- "Cutaneotrichosporon oleaginosum"
|
||||||
|
|
||||||
# [END]
|
# [END]
|
4
myScripts/CUTOLTaxonomy.json
Normal file
4
myScripts/CUTOLTaxonomy.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[{
|
||||||
|
"ID": 879819,
|
||||||
|
"species": "Cutaneotrichosporon oleaginosum"}
|
||||||
|
]
|
19
myScripts/MBP1_CUTOL.json
Normal file
19
myScripts/MBP1_CUTOL.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[
|
||||||
|
{ "name" : "MBP1_CUTOL",
|
||||||
|
"RefSeqID" : "XP_018278493.1",
|
||||||
|
"UniProtID" : "A0A0J0XLN0",
|
||||||
|
"taxonomyID" : 879819,
|
||||||
|
"sequence" : [
|
||||||
|
"MGKKAAAAGDGGPNTIYKATYSGVPVFEFICRNVAVMRRRSDAYLNATQILKVAGFDKPQRTRVLEREVQ",
|
||||||
|
"KGEHEKVQGGYGKYQGTWVPIERGLALAKQYNVEDLLRPIIDFVPRESVSPPPAPKHAVAPPTKRNKEPK",
|
||||||
|
"PKEGLVPIKSAGVLSGTGRHQTPDSVGEDVESEVMDDMSESQTPSPLNGTSLLPAVDERSIDGMDIDGFS",
|
||||||
|
"MMNGGGHARKRSAAMMDDEDEYEQLKRARGNSAVHTPPPPGQSPRYGGMQHPLTQDEYNDIVLNYFVSEA",
|
||||||
|
"TQIPAVMTNPPYNWDPNGIIDDDHHTALHWAAAMGRTRVIKLLLSAGARIFDKNNLDQTPLMRSVMFTNN",
|
||||||
|
"YDLRKFPEVFELLHRSTLNIDKNNRTVFHHIANLALYKGKTHAARYYMEVILSRLADYPQELADVINFAD",
|
||||||
|
"EDGETALTLAARARSKRIVKALLDHGADPKLRNRDHKSAEDYILEDERFRSSPDVMLNRTQPSAAPRNPT",
|
||||||
|
"SLGAAVFSQGLPPQLYNSEAARLASGPHSSDILQQMQALARSFEAEKLNKERDVLEAKAMLTSIHTEVND",
|
||||||
|
"AGRTLHNLGEQMKPLEAKQGELDGLVERLQSKLQKDLARGARKWKAADEGRENRWKNGDDPSQAGEDYSD",
|
||||||
|
"LPELTAIPDNAEAEEERLRGEIEKMRARRGELVTRLVKAQTQTGTTDKMAQYRRLITAGCGGDINPGEID",
|
||||||
|
"DIVGQLLDMLENEAQSGRPAPPPQAAPSWVTS"]
|
||||||
|
}
|
||||||
|
]
|
4
myScripts/makeProteinDB.R
Normal file
4
myScripts/makeProteinDB.R
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
source("./scripts/ABC-createRefDB.R")
|
||||||
|
|
||||||
|
myDB <- dbAddProtein(myDB, jsonlite::fromJSON("./myScripts/MBP1_CUTOL.json"))
|
||||||
|
myDB <- dbAddTaxonomy(myDB, jsonlite::fromJSON("./myScripts/CUTOLtaxonomy.json"))
|
38
myScripts/myScript.R
Normal file
38
myScripts/myScript.R
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# myScript.R
|
||||||
|
#
|
||||||
|
# --- As you work with this file, you can delete the instructions below --------
|
||||||
|
# Write your notes and code experiments into this document. Save it
|
||||||
|
# from time to time - however I recommend that you do not _commit_
|
||||||
|
# your saved version.
|
||||||
|
#
|
||||||
|
# As long as you do not _commit_ this script to version control,
|
||||||
|
# you can _pull_ updated versions of the entire project from GitHub
|
||||||
|
# by using the RStudio version control interface. However, once
|
||||||
|
# you _commit_ any file in your local version, RStudio will require
|
||||||
|
# you to resolve conflicts before you can _pull_ updates.
|
||||||
|
# --- As you work with this file, you can delete the instructions above --------
|
||||||
|
#
|
||||||
|
## Purpose: <...>
|
||||||
|
#
|
||||||
|
# Version: <...>
|
||||||
|
#
|
||||||
|
# Date: <...>
|
||||||
|
# Author: <Name> (<namee@mail.utoronto.ca>)
|
||||||
|
#
|
||||||
|
# Versions:
|
||||||
|
#
|
||||||
|
# <number> <Features>
|
||||||
|
#
|
||||||
|
# TODO:
|
||||||
|
# <...>
|
||||||
|
#
|
||||||
|
# ====================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [END]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user