Genboree BCM
Help Genboree Home
(This is a recently added feature. Report issues to Genboree Admin.)
19-01-2011: Writing Programs to Aid Analysis & Discovery
Part 1: Basic Ruby Programming

Mr. Andrew Jackson - andrewj@bcm.edu


Project News:
2011/01/20:
 Lecture 1 - Exercises

The exercises for Lecture 1 are available under Quick Links to the left. And here, for convenience.
2011/01/19:
 Example Ruby File

The Ruby code in the file "probesPerGene.rb" below is an example of putting a bunch of Ruby code into a file so it can be run on demand. I ran it by doing this at the command line:

ruby ./probesPerGene.rb

It will look for a file named "methylationProbeInfo.lff" in the same dir (you can get this by uncompressing methylationProbeInfo.lff.gz provided below). Then it does this:

  1. Reads each line of the file, which is a probe definition record
  2. Extracts the gene name associated with the probe
  3. Keeps track, using a Hash, how many probes are associated with each gene
  4. Once the file has been processed, it writes a tab-delimited text file with two columns: (a) the gene name and (b) the number of probes associated with the gene.
  5. (the output file is called "probesPerGene.txt" and is included below; running the program should generate this file).
The code is commented using lines beginning with "#". Ruby will ignore such lines, allowing you to comment code to explain to yourself and others what the code is doing.


Documents & Files:
probesPerGene.txt
File date: Wed Jan 19 2011 14:49:19
probesPerGene.rb
File date: Wed Jan 19 2011 14:49:10
probeDataExample.txt.gz
File date: Wed Jan 19 2011 07:10:34
methylationProbeInfo.lff.gz
File date: Wed Jan 19 2011 07:10:32
Ruby1_full.pdf
File date: Wed Jan 19 2011 06:35:57

Archived Documents & Files:



Basic Programming in Ruby

  • Introdcution
  • Fundamental Ruby data types, "operators", methods
  • Outputting text
  • Flow control
  • Basic I/O
  • Intro to regular expression syntax
  • Writing & Running Ruby programs

 

 


Bioinformatics Research Laboratory © 2001-2026 Baylor College of Medicine
Bioinformatics Research Laboratory
(400D Jewish Wing, MS:BCM225, 1 Baylor Plaza, Houston, TX 77030)