#!perl.exe # # # # lovseq.txt integer A or ALA, &c. integer integer #./quickchanger.pl # # # Sequence file should contain only the nucleotide sequence no header or bullshit # # My quickchange primers from IDT have always worked by adding 1uL of a 1:20,000 dilution to a 50uL PCR reaction # I always use 7 codons or 21 bases on each side of the mutation this is the default also for the program # You can change this by a command line argument but make sure if you do you also specify # a sequence offset or 0 as the program reads in the arguments in a specific order # If you choose a mutation 6 codons from the end it will use only 6 codons # If you chose a mutation 5 codons from the end it will not work unless you specifically specify # I run the quickchange at 56.5C with pfu and have 95% efficiency # # # # use Bio::Tools::CodonTable; $d = 0; $e = 0; $x = 0; my %val = (); my %seqer = (); if(!$ARGV[0] || !$ARGV[1] || !$ARGV[2]) { print "Usage: ./quickchanger.pl \n\n"; die;} open(FILE, $ARGV[0]); @file=; # #load up sequence and separate it by codons # @seq = $file[0] =~ /(...)/g; $numt = @seq; #print "$numt\n\n"; die; #$seq = $ARGV[0]; $num = $ARGV[1]; $aa2 = $ARGV[2]; if($ARGV[4]){ $primer = $ARGV[4];} else { $primer = 7; } $offset = $ARGV[3] + 0; if($primer > 5){ if(($num - $offset) < 6 || ($num - $offset) > (@seq - 7)){ print "Mutation to close to ends need more sequence\n";die; } elsif(($num - $offset) eq 6 || (($num - $offset) - (@seq)) eq -7) { $primer = 6; } } # # If we need to define a sequence offset # foreach $seqcod (@seq) { $seqer{$offset + $x} = $seqcod; #print "$seqer{$offset + $x}\n"; $x++; } # # Find our mutation codons # $table = Bio::Tools::CodonTable->new(); $mut = $table->translate($seqer{$num}); $unmut = $table->translate($seqer{$num}); @codons = $table->revtranslate($aa2); @orig = $seqer{$num} =~ /(.)/g; # # Find best mutation codon match to # original sequence # foreach $cod (@codons) { $val{$d} = 0; @co = $cod =~ /(.)/g; for($c=0;$c<3;$c++) { if($orig[$c] eq $co[$c]) { $val{$d}++; } } #print "@cod $val{$d}\n"; $d++; } # # Sort to find best mutation codon match # foreach $codonsers (sort {$val{$b} <=> $val{$a}} keys %val){ $final[$e] = $codons[$codonsers]; $e++; } #print "@orig\n@codons\n$final[0]\n"; # # print out forward primer and mutation # print "$num $aa2\n"; for($z=$primer;$z>=1;$z--) { print $seqer{$num-$z}; } print " $final[0] "; for($z=1;$z<=$primer;$z++) { print $seqer{$num+$z}; } print "\n";