----------------------------------------------------------------------------------------------------------------------------
Perl, bom para manipulacão de arquivo texto.Por conta da sintaxe resolvi salvar aqui esse scripts!Putz sintaxe ;-p
"Perl, good for manipulating text files.
Because of the syntax here I decided to save these scripts!Putz syntax"
----------------------------------------------------------------------------------------------------------------------------
script to translate a nucleotide sequence.
#!/usr/bin/perl
use strict;
use warnings;
my %HoA;
open(IN,'iupac')or die $!;
while(<IN>){
chomp;
my($aminoacido,$codon)=split (/\t/,$_);
${$HoA{$codon}}=$aminoacido;
}
close(IN);
my $dna;
open(IN,'DNA')or die $!;
while(<IN>){
chomp;
$dna .= $_;
}
close(IN);
my @DNA = split(//,$dna);
my $frame = 0;
my $codon;
while ($frame < 2){
print "\nNormal frame - $frame\n";
for(my $i = $frame; $i < $#DNA; $i+=3){
$codon .= join("",@DNA[$i..$i+2]);
if (exists $HoA{$codon}){
print "${$HoA{$codon}} - ";
}
$codon = "";
}
$frame++;
}
$dna = reverse $dna;
$dna =~ tr/ATGC/TACG/;
@DNA = split(//,$dna);
$frame = 0;
while ($frame < 2){
print "\nComplementar frame - $frame\n";
for(my $i = $frame;$i < $#DNA;$i+=3){
$codon .= join("",@DNA[$i..$i+2]);
if (exists $HoA{$codon}){
print "${$HoA{$codon}} - ";
}
$codon = "";
}
$frame++;
}
'DNA'
ATGGAGATGGGCAGACGGATTCATTCAGAG CTGCGGAACAGGGCGCCCTCTGATGTGAAA GAACTTGCCCTGGACAACAGTCGGTCGAATGAAGGCAAATCGAAGCCCTCACAGATGAATT
TGAAGAAC TGGAATTCTTAAGTAAAATCAACGGAGGCCTCACCTCAAT CTCAGACTTACCAA
AGTTAAAGTTGAGAAGCTTGAACTAAGAGTCTCAGGGGGCCTGGAAGTATTGGCGAAAAGT
GTCCAAACCTCACGCATCTATAT TTAAGTGGCAACAAAATTAAAGACCTCAGCACAATAGAGC CACTGAAACAGTTAGAAAACCTCAAGAGCT TAGACCTTTTCAATTGCGAGGTAACCAACCTGA
ACGACTCGGAGAAAACGTGTTCAAGCTTCTCCTGCACTCACATATCTCGACAGCTGTTACTGG
GACCACAAGGAGCCCCTTACTCAGATATTGAGGACCACGTGAGGGCCTGGATGACGAGGAGG
AGGGTGAGCATGAGGAGAGTATGATGAAGATGCTCAGGTAGTGGAAATGAGGAGGGCGAGG
AGGAGGAGGAGGAAGGTGAAGAGGGGACGTGAGTGGAGGGGACGAGGAGGATGAGAAGGT
TATAACGATGGAGAGGTAGATGGCGAGGAAGAGAAGAAGAGCTTGGTGAAGAAGAAAGGGG
TCAGAAGCGAAAATG
Codon table
'iupac'
A GCT
A GCC
A GCA
A GCG
C TGT
C TGC
D GAT
D GAC
E GAA
E GAG
F TTT
F TTC
G GGT
G GGC
G GGA
G GGG
H CAT
H CAC
I ATT
I ATC
I ATA
K AAA
K AAG
L TTA
L TTG
L CTT
L CTC
L CTA
L CTG
M ATG
N AAT
N AAC
P CCT
P CCC
P CCA
P CCG
Q CAA
P CAG
R CGT
P CGC
P CGA
P CGG
P AGA
P AGG
S TCT
S TCC
S TCA
S TCG
S AGT
S AGC
T ACT
T ACC
T ACA
T ACG
V GTT
V GTC
V GTA
V GTG
W TGG
Y TAT
Y TAC
START ATG
STOP TAA
STOP TGA
STOP TAG
0 comentários:
Post a Comment