User:Jeffrey

From FreeBio

Jeffrey


Contents

Biophysics 101 Assignments

101 Week 6

  • From Slashdot.org: Scientists Complete Map of Human Genetic Variation
  • Pharmacogenetics/genomics and personalized medicine by Wolfgang Sadée and Zunyan Dai
  • Measuring the value of pharmacogenomics by Phillips KA, Van Bebber SL.
    • "Pharmacogenetics and pharmacogenomics offer the potential of developing DNA-based tests to help maximize drug efficacy and enhance drug safety. Major scientific advances in this field have brought us to the point where such tests are poised to enter more widespread clinical use. However, many questions have been raised about whether such tests will be of significant value, and how to assess this. Here, we review the application of economics-based resource-allocation frameworks to assess the value of pharmacogenomics, and the findings so far. We then develop a resource-allocation framework for assessing the potential value of pharmacogenomic testing from a population perspective, and apply this framework to the example of testing for variant alleles of CYP2D6, an important drug-metabolizing enzyme. This review provides a framework for analysing the value of pharmacogenomic interventions, and suggests where further research and development could be most beneficial."
  • Note: We need to get a good omnidirectional microphone for conferencing on Google Talk with Jeremy when he is away. A decent set of speakers would be helpful as well.

101 Week 7

  • Perl DNA script...

101 Week 8

The biodiesel industry in this country is expanding exponentially," says Greg Pahl, author of Biodiesel: Growing a New Energy Economy. Pahl has used biodiesel in his oil furnace at home in Vermont for four years.
But he points out that if biodiesel catches on as predicted, the waste vegetable oil that individuals like Parris are using could become a commodity, and it would no longer be easily obtained for free. And there's another problem. :"We probably won't be able to replace more than 10 percent to 15 percent of our current petrodiesel usage with biodiesel," he says. "Ultimately, the answer is relying on a broad range of renewable-energy strategies including biofuels of all types."
"Biodiesel is not the panacea for lower oil prices, but it is hopefully a bridge towards becoming a little bit more dependent on ourselves rather than others," says Nazzaro. "If this is going to go beyond a niche, you have to break into a major market, and I believe the heating-oil market will be that market."
Summaries (forthcoming):

Issues in Implementation - Public Health, Access to Care, Insurance Policy:

My Perl Environment:
  • ActivePerl using perl, v5.8.7 built for MSWin32-x86-multi-thread running on my Thinkpad X41 Tablet (512MB, 50GB, 1.5GHz).
Lecture Notes:

101 Week 9

  • Added to coding arsenal: Dell Optiplex GX620 (3GHz, 80GB, 512MB) running UBUNTU.
  • A simple Random DNA sequence generator.
#!perl -w
#______________________________________________________________________
# Random DNA sequence generator
# by Jeff Yip
#______________________________________________________________________

open(OUTDNA, ">outdna.txt")||
    die "Sorry, I couldn't create outdna.txt\n";

print "Random DNA sequence generator. \n";
print "Please enter length of DNA sequence: ";
$length = <STDIN>;

$i = 0;
while ($i < $length) {
	$roll = int(rand 4) + 1;       # $roll is now an integer between 1 and 4
	
	if ($roll == 1) {$base = A;}
	elsif ($roll == 2) {$base = T;}
	elsif ($roll == 3) {$base = C;}
	elsif ($roll == 4) {$base = G;};
	
	print OUTDNA $base;
}
continue {
	$i++;
}

close(OUTDNA) || die "can't close outdna.txt";

101 Week 10

101 Week 11

#!perl -w
#______________________________________________________________________
# Random DNA sequence generator Parts A and B
# 2005-11-29
# 
#______________________________________________________________________

#declare rates of mutation:
$realistic = 2000; #this means 1/1000000000 base pairs mutates
$unrealistic = 10;	 #this means 1/20 base pairs mutates

#declare number of mutation genomes to create:
$MutantNum = 100;

#declare name of input file
$input = "dodo.txt";

#declare strings
$length = "";
$seq = "";


open(INDNA, "<$input")||die "Sorry, I couldn't open input file: $input\n";

print "Realistic mutation rate: ";
print $realistic;
print "\n";
print "Unrealistic mutation rate: ";
print $unrealistic;
print "\n";
print "Number of mutant copies: ";
print $MutantNum;
print "\n";

$length = <INDNA>;
$seq = <INDNA>;

print "Genome length: ", $length;
#print "Sequence: ", $seq;
#print the first 100 characters:
print "First 100 base pairs of input sequence: ", substr($seq, 0, 100), "\n\n";

#Output A: Generate 100 copy genomes with an realistic mutation rate

$k = 0; #counter

while ($k < $MutantNum) {
	$curr_file = "OutputA" . $k . ".txt";
	#print $curr_file, "\n";
	open(OUTDNA, ">$curr_file")||die "Sorry, I couldn't open output file: $curr_file\n";
	print OUTDNA $length; #print the sequence length on the first line.

	#traverse the sequence
	$j = 0; #index of point on the sequence
	
	while ($j < $length) {
		$roll = int(rand $realistic) + 1;	# $roll is now an integer between 1 and $realistic
		if ($roll == 1) {			# if $roll is 1, then we mutate
			print OUTDNA $j, "\n";		# index of mutation point
			#print OUTDNA "current ref bp: ", substr($seq, $j, 1), " ";	#the reference base pair
			
			$ref_bp = substr($seq, $j, 1);
			
			#convert the base pair into a number:
			if ($ref_bp eq "A") {$ref_num = 0;}
			elsif ($ref_bp eq "T") {$ref_num = 1;}
			elsif ($ref_bp eq "C") {$ref_num = 2;}
			elsif ($ref_bp eq "G") {$ref_num = 3;};
			#print OUTDNA $ref_num, "\n";

			$mutation_num = (($ref_num + int(rand 3) + 1) % 4); #add a random number from 1 to 3, take mod 4

			if ($mutation_num == "0") {$mutation_bp = A;}
			elsif ($mutation_num == "1") {$mutation_bp = T;}
			elsif ($mutation_num == "2") {$mutation_bp = C;}
			elsif ($mutation_num == "3") {$mutation_bp = G;};

			print OUTDNA $mutation_bp, "\n";	#output mutation base pair

		}
	}
	continue {
		$j++;
	}
	close(OUTDNA) || die "can't close input file: $curr_file";
}
continue {
	$k++;
}

close(INDNA) || die "can't close input file: $input";
#!perl -w
#______________________________________________________________________
# Random DNA sequence generator Part C
# 2005-11-29
# 
#______________________________________________________________________

#declare rates of mutation:
$realistic = 2000; #this means 1/1000000000 base pairs mutates
$unrealistic = 10;	 #this means 1/20 base pairs mutates

#declare number of mutation genomes to create:
$MutantNum = 100;

#declare name of input file
$input = "dodo.txt";

#declare strings
$length = "";
$seq = "";

open(INDNA, "<$input")||die "Sorry, I couldn't open input file: $input\n";

print "Realistic mutation rate: ";
print $realistic;
print "\n";
print "Unrealistic mutation rate: ";
print $unrealistic;
print "\n";
print "Number of mutant copies: ";
print $MutantNum;
print "\n";

$length = <INDNA>;
$seq = <INDNA>;

#declare 1% of length
$hot_length = (.01 * $length);

print "Genome length: ", $length;
#print "Sequence: ", $seq;
#print the first 100 characters:
print "First 100 base pairs of input sequence: ", substr($seq, 0, 100), "\n\n";

#Output A: Generate 100 copy genomes with an realistic mutation rate

$k = 0; #counter

while ($k < $MutantNum) {
	$curr_file = "OutputC" . $k . ".txt";
	#print $curr_file, "\n";
	open(OUTDNA, ">$curr_file")||die "Sorry, I couldn't open output file: $curr_file\n";
	print OUTDNA $length; #print the sequence length on the first line.

	#traverse the sequence
	$j = 0; #index of point on the sequence
	
	while ($j < $hot_length) {
		$roll = int(rand 5) + 1;	# $roll is now an integer between 1 and $realistic
		if ($roll == 1) {				# if $roll is 1, then we mutate
			print OUTDNA $j, "\n";			# index of mutation point
			#print OUTDNA "current ref bp: ", substr($seq, $j, 1), " ";	#the reference base pair
			
			$ref_bp = substr($seq, $j, 1);
			
			#convert the base pair into a number:
			if ($ref_bp eq "A") {$ref_num = 0;}
			elsif ($ref_bp eq "T") {$ref_num = 1;}
			elsif ($ref_bp eq "C") {$ref_num = 2;}
			elsif ($ref_bp eq "G") {$ref_num = 3;};
			#print OUTDNA $ref_num, "\n";

			$mutation_num = (($ref_num + int(rand 3) + 1) % 4); #add a random number from 1 to 3, take mod 4

			if ($mutation_num == "0") {$mutation_bp = A;}
			elsif ($mutation_num == "1") {$mutation_bp = T;}
			elsif ($mutation_num == "2") {$mutation_bp = C;}
			elsif ($mutation_num == "3") {$mutation_bp = G;};

			print OUTDNA $mutation_bp, "\n";	#output mutation base pair

		}
	}
	continue {
		$j++;
	}

}
continue {
	$k++;
}
close(INDNA) || die "can't close input file: $input";

101 Week 12

LWP - The World-Wide Web library for Perl

#!perl -w
# note: w turns on warnings.
#______________________________________________________________________
# Random DNA sequence generator
# 2005-12-06
#______________________________________________________________________

use strict;

#declare rates of mutation:
my $realistic = 2000;	#this means 1/n base pairs mutates
my $unrealistic = 10;	#this means 1/n base pairs mutates

#declare number of mutation genomes to create:
my $MutantNum = 100;

#declare name of input file
my $input = "dodo.txt";

#declare strings
my $length = "";
my $seq = "";

open(INDNA, "<$input")||die "Sorry, I couldn't open input file: $input\n";

print "Realistic mutation rate: ";
print $realistic;
print "\n";
print "Unrealistic mutation rate: ";
print $unrealistic;
print "\n";
print "Number of mutant copies: ";
print $MutantNum;
print "\n";

$length = <INDNA>;
$seq = <INDNA>;

print "Genome length: ", $length;
#print "Sequence: ", $seq;
#print the first 100 characters:
print "First 100 base pairs of input sequence: ", substr($seq, 0, 100), "\n\n";

#Output A: Generate 100 copy genomes with an realistic mutation rate

my $k = 0; #counter

my %one_mutant;

while ($k < $MutantNum) {
	%one_mutant = ();

	#traverse the sequence
	my $j = 0; #index of point on the sequence
	
	while ($j < $length) {
		my $roll = int(rand $realistic) + 1;	# $roll is now an integer between 1 and $realistic		
		if ($roll == 1) {			# if $roll is 1, then we mutate
			
			#__Write the location of mutation__
			
			my $ref_bp = substr($seq, $j, 1);
			my $ref_num;

			#convert the base pair into a number:
			if ($ref_bp eq "A") {$ref_num = 0;}
			elsif ($ref_bp eq "T") {$ref_num = 1;}
			elsif ($ref_bp eq "C") {$ref_num = 2;}
			elsif ($ref_bp eq "G") {$ref_num = 3;};
			
			my $mutation_num = (($ref_num + int(rand 3) + 1) % 4); #add a random number from 1 to 3, take mod 4
			
			my $mutation_bp;

			if ($mutation_num == "0") {$mutation_bp = "A";}
			elsif ($mutation_num == "1") {$mutation_bp = "T";}
			elsif ($mutation_num == "2") {$mutation_bp = "C";}
			elsif ($mutation_num == "3") {$mutation_bp = "G";};
			
			$one_mutant{$j} = $mutation_bp;
			#print $one_mutant{$j};


		}
	}
	continue {
		$j++;
	}
	
	#==This prints the current mutant hash==	
	my ($key, $value);
	while ( ($key, $value) = each %one_mutant ) {
		print "$key => $value\n";
	}

	print "processing...\n";
}
continue {
	$k++;
}

close(INDNA) || die "can't close input file: $input";

101 Week 13

#!perl -w
# note: w turns on warnings.
#______________________________________________________________________
# Random DNA sequence generator, modified for web database.
# 2005-12-06
# 
# JHYIP 2005.
#______________________________________________________________________

use strict;
use LWP::UserAgent;	#allows web interaction

my $ua = LWP::UserAgent->new;

# Team Matt and Jeff - this is static for the whole project
my $group = "b";

#declare rates of mutation:
my $realistic = 100;	#this means 1/n base pairs mutates

#declare number of mutation genomes to create:
my $MutantNum = 100;

#declare strings
my $length = "";

my $k = 0;	#counter
my $id = 0;	#id for the table
my $contig = 1;

my %one_mutant;

#####################################################################################
# this section gets a contig from the database
#####################################################################################
use Text::ParseWords;
sub parse_csv0 {
    return quotewords("," => 0, $_[0]);
}

my $ua1 = LWP::UserAgent->new;

my $contig_id = 1;
my $query = "http://personalgenome.org/101/contig.php?group=$group&id=$contig_id";
              
my $req = HTTP::Request->new(GET => "$query");
$req->header(Accept => 'text/html');
        
# send request to server and get response back
my $res = $ua1->request($req);
            
# check the outcome
if ($res->is_success) {
   #print $res->content;  # for instance
} else {
   print "Error: " . $res->status_line . "\n";
}

my $fh;

open($fh, "+<", \$res->content);   # read and write, preserve original contents

my $dbname = <$fh>;
my $desc = <$fh>;
my $seq = <$fh>;

my $i = 0;
my @fields = parse_csv0($seq);
for ($i = 0; $i < @fields; $i++) {
    #print "$i : $fields[$i]\n";
}

my $contig1 = $fields[1];
#####################################################################################
# end of contig query section
#####################################################################################

$length = length $contig1;
$seq = $contig1;
$id = 1;

#############################################################
#Assign a mutation to 50% of the genotypes at a given index.
#############################################################
my $index_of_mutation = 1492;
my $z = 0; #counter

my $association_id = 1;
my $phenotype_id = 23;

while ($z < $MutantNum) {
	my $roll = int(rand 4) + 1;
	if ($roll == 1) {
		print "controlled mutation #: $z, $id\n";
		my $ref_bp1 = substr($seq, $index_of_mutation, 1);
		my $ref_num1;

		#==Convert the base pair into a number:
		if ($ref_bp1 eq "A") {$ref_num1 = 0;}
		elsif ($ref_bp1 eq "T") {$ref_num1 = 1;}
		elsif ($ref_bp1 eq "C") {$ref_num1 = 2;}
		elsif ($ref_bp1 eq "G") {$ref_num1 = 3;};
		
		#add a random number from 1 to 3, take mod 4
		my $mutation_num1 = (($ref_num1 + int(rand 3) + 1) % 4);
			
		my $mutation_bp1;

		if ($mutation_num1 == "0") {$mutation_bp1 = "A";}
		elsif ($mutation_num1 == "1") {$mutation_bp1 = "T";}
		elsif ($mutation_num1 == "2") {$mutation_bp1 = "C";}
		elsif ($mutation_num1 == "3") {$mutation_bp1 = "G";};

		#==Create a substitution at the given index
		my $insert1 = 'http://personalgenome.org/101/insert-substitution.php?'. 
             					"genotype_id=$z".
             					"&contig_id=$contig".
             					"&pos=$index_of_mutation".  
             					"&bp=$mutation_bp1".
             					"&group=$group".
             					"&id=$id";
		print "genotype_id: ", $z, "\n";

		#print "visiting url: $insert1\n";

		my $req1 = HTTP::Request->new(GET => "$insert1");
		$req1->header(Accept => 'text/html');
        
		# send request to server and get response back
		my $res1 = $ua->request($req1);
		
		#increment the id counter
		$id++;

		print "adding association to genotype: ", $z , "\n";
		#==Update the Associations Table==#
		my $insert_as = 'http://personalgenome.org/101/insert-association.php?'. 
     			"group=$group".
             		"&id=$association_id".
             		"&genotype_id=$z".
             		"&phenotype_id=$phenotype_id";

		my $req_as = HTTP::Request->new(GET => "$insert_as");
		$req_as->header(Accept => 'text/html');
        
		# send request to server and get response back
		my $res_as = $ua->request($req_as);
            
  		# check the outcome
  		if ($res_as->is_success) {
  		print $res_as->content;  # for instance 
		} else {
  		   print "Error: " . $res_as->status_line . "\n";
		}
		
		$association_id++;
		#==End of Association Table Update==#
		
	}
}
continue {
	$z++;
}


#########################################################################
## Generate n = MutantNum of genotypes at the $realistic mutation rate ##
#########################################################################
while ($k < $MutantNum) {
	%one_mutant = ();

	#traverse the sequence
	my $j = 0; #index of point on the sequence
	
	while ($j < $length) {
		my $roll = int(rand $realistic) + 1;	# $roll is now an integer between 1 and $realistic		
		if ($roll == 1) {			# if $roll is 1, then we mutate
			
			#__Write the location of mutation__
			
			my $ref_bp = substr($seq, $j, 1);
			my $ref_num;

			#convert the base pair into a number:
			if ($ref_bp eq "A") {$ref_num = 0;}
			elsif ($ref_bp eq "T") {$ref_num = 1;}
			elsif ($ref_bp eq "C") {$ref_num = 2;}
			elsif ($ref_bp eq "G") {$ref_num = 3;};
			
			my $mutation_num = (($ref_num + int(rand 3) + 1) % 4); #add a random number from 1 to 3, take mod 4
			
			my $mutation_bp;

			if ($mutation_num == "0") {$mutation_bp = "A";}
			elsif ($mutation_num == "1") {$mutation_bp = "T";}
			elsif ($mutation_num == "2") {$mutation_bp = "C";}
			elsif ($mutation_num == "3") {$mutation_bp = "G";};
			
			$one_mutant{$j} = $mutation_bp;
		}
	}
	continue {
		$j++;
	}
	#=========================================================================#	
	#==This prints the current mutant hash and uploads value to the database==#
	#=========================================================================#	
	my ($key, $value);
	while ( ($key, $value) = each %one_mutant ) {
		print "$key => $value\n";
		my $insert = 'http://personalgenome.org/101/insert-substitution.php?'. 
             					"genotype_id=$k".
             					"&contig_id=$contig".
             					"&pos=$key".  
             					"&bp=$value".
             					"&group=$group".
             					"&id=$id";
		#print "visiting url: $insert\n";

		my $req = HTTP::Request->new(GET => "$insert");
		$req->header(Accept => 'text/html');
        
		# send request to server and get response back
		my $res = $ua->request($req);

		$id++; #increment the individual genotype_id 
	}
	print "processing genotype: ", $k, "\n";
}
continue {
	$k++;
}

print "Summary:\n";
print "Number of substitutions added: ", $id, "\n";
print "Number of associations added: ", $association_id, "\n";
print "...End of summary.  Goodbye.\n";

101 Week 14

Moved to Personalized medicine Readings page

The Future of Drug Development: The Economics of Pharmacogenomics by John A. Vernon and W. Keener Hughen

Abstract: This paper models how the evolving field of pharmacogenomics (PG), which is the science of using genomic markers to predict drug response, may impact drug development times, attrition rates, costs, and the future returns to research and development (R&D). While there still remains an abundance of uncertainty around how PG will impact the future landscape of pharmaceutical and biological R&D, we identify several likely outcomes. We conclude PG has the potential to significantly reduce both expected drug development costs (via higher probabilities of technical success, shorter clinical development times, and smaller clinical trials) and returns. The impact PG has on expected returns is partially mitigated by higher equilibrium prices, expedited product launches, and longer effective patent lives. Our conclusions are, of course, accompanied by numerous caveats.

Miscellaneous


These resources might be interesting/useful/thought provoking:

Personalized Medicine:

Moved to The readings page

Biodiesel:

  • Biodiesel Vehicle Fuel: GHG Reductions, Air Emissions, Supply and Economic Overview by Lawrence Schmidt, March 11, 2004
    "Economic Viability: Research shows that biodiesel is not currently cost competitive with petroleum diesel. However, at a B20 blend with some form of tax exemption on the biodiesel portion of the fuel, per litre costs range close to or slightly less than the retail cost of fully taxed petroleum diesel. Furthermore, assuming a trend toward higher costs for petroleum diesel and decreased costs of biodiesel production (increased technology efficiencies), economic viability of biodiesel as a niche fuel seems probable over the short term, relying on some for of modest tax exemption."
  • A WORLD WIDE REVIEW OF THE COMMERCIAL PRODUCTION OF BIODIESEL – A technological, economic and ecological investigation based on case studies©by Mag. Stephan Friedrich, Wien 2004 "INTRODUCTION: As early as the beginning of the 20th century Rudolf Diesel proposed vegetable oil as fuel for his engine. A short time later, before and during World War Two, vegetable oil was examined in “up-to-date‿ diesel engines. In 1940 first trials with vegetable oil methyl and ethyl esters were carried out in France and, at the same time, scientists in Belgium were using palm oil ethyl ester as a fuel for buses.2 In 1973, the oil crisis refocused attention on and interest for local energy sources. In recent decades, research concerning and knowledge about the external benefits of renewable raw materials have intensified the efforts for sustainable energy sources. Biodiesel plays a major role in this field because of the world wide research, development and deployment activities of this sustainable energy source. Due to this recent increased awareness and development, the objective of this thesis is to provide a world-wide review of the production of Biodiesel. For the description of the Biodiesel scene a three-stage development is referred to
    • Phase I consists of the very first ideas and thoughts of Biodiesel being used as a fuel until the actual adaptation of the ideas on the part of the decision makers who are then motivated to put these ideas into practice. The end of Phase I (=beginning of Phase II) is the political decision to invest money and other resources to Biodiesel research.
    • Phase II is characterised by research efforts, pilot projects, setting of frame conditions and financially supported technical trials.
    • Countries in Phase III show a Biodiesel economy based primarily on a feasible economic production, distribution and use of Biodiesel, and a self supportive Biodiesel economy."
  • COSTS OF BIODIESEL PRODUCTION Prepared for: Energy Efficiency and Conservation Authority By: John Duncan May 2003