bch441-work-abc-units/BIN-YFO.R

86 lines
3.0 KiB
R
Raw Normal View History

2017-09-12 20:09:20 +00:00
# BIN-YFO.R
#
# Purpose: A Bioinformatics Course:
# R code accompanying the BIN-YFO unit
#
2017-09-21 21:49:55 +00:00
# Version: 1.0
2017-09-12 20:09:20 +00:00
#
2017-09-21 21:49:55 +00:00
# Date: 2017 09 21
2017-09-12 20:09:20 +00:00
# Author: Boris Steipe (boris.steipe@utoronto.ca)
#
2017-09-21 21:49:55 +00:00
# V 1.0 Final code, after rewriting BLAST parser and creating current YFOlist
2017-09-12 20:09:20 +00:00
# V 0.1 First code copied from BCH441_A03_makeYFOlist.R
#
# TODO:
#
#
# == HOW TO WORK WITH LEARNING UNIT FILES ======================================
#
# DO NOT SIMPLY source() THESE FILES!
2017-09-21 21:49:55 +00:00
#
2017-09-12 20:09:20 +00:00
# If there are portions you don't understand, use R's help system, Google for an
# answer, or ask your instructor. Don't continue if you don't understand what's
# going on. That's not how it works ...
#
# ==============================================================================
2017-09-21 21:49:55 +00:00
#TOC> ==========================================================================
#TOC>
#TOC> Section Title Line
#TOC> ---------------------------------------
#TOC> 1 Preparations 38
#TOC> 2 Suitable YFO Species 50
#TOC> 3 Adopt "YFO" 64
#TOC>
#TOC> ==========================================================================
# = 1 Preparations ========================================================
#
2017-09-12 20:09:20 +00:00
2017-09-21 21:49:55 +00:00
# Execute the two conditionals below:
if (! file.exists(".myProfile.R")) {
stop("PANIC: profile file does not exist. Fix problem or ask for help.")
}
if (! exists("myStudentNumber")) {
stop("PANIC: profile data wasn't loaded. Fix problem or ask for help.")
}
2017-09-12 20:09:20 +00:00
2017-09-21 21:49:55 +00:00
# = 2 Suitable YFO Species ================================================
2017-09-12 20:09:20 +00:00
2017-09-21 21:49:55 +00:00
# In this unit we will select one species from a list of genome sequenced fungi
# and write it into your personalized profile file. This species will be called
# "YFO" (Your Favourite Organism) for other learning units and exercises.
2017-09-12 20:09:20 +00:00
2017-09-21 21:49:55 +00:00
# A detailed description of the process of compiling the list of genome
2017-09-12 20:09:20 +00:00
# sequenced fungi with protein annotations and Mbp1 homologues is in the file
2017-09-21 21:49:55 +00:00
# ABC-makeYFOlist.R
# Task: Study ABC-makeYFOlist.R, it implements a rather typical workflow of
# selecting and combining data from various public-domain data resources.
# = 3 Adopt "YFO" =========================================================
# In the code below, we load the resulting vector of species name, then pick one
# of them in a random but reproducible way, determined by your student number.
2017-09-12 20:09:20 +00:00
load("data/YFOspecies.RData") # load the species names
set.seed(myStudentNumber) # seed the random number generator
YFO <- sample(YFOspecies, 1) # pick a species at random
# write the result to your personalized profile data so we can use the result in
# other functions
cat(sprintf("YFO <- \"%s\"\n", YFO), file = ".myProfile.R", append = TRUE)
YFO # so, which species is it ... ?
biCode(YFO) # and what is it's "BiCode" ... ?
2017-09-21 21:49:55 +00:00
# Task: Note down the species name and its five letter label on your Student
# Wiki user page. Use this species whenever this or future assignments refer
# to YFO. In code, we will automatically load it from your.myProfile.R file.
2017-09-12 20:09:20 +00:00
# [END]