Bienvenido al Renacimiento

Bienvenidos al nuevo Renacimiento, espero que os ayude

martes, 24 de enero de 2012

Aquí tenéis resuelto los ejercicios de la práctica 7:



%1.Realice una función (codon2aa) que reciba como parámetro una cadena de tres nucleótidos(un codón), y lo transforme al aminoácido correspondiente. Dicho aminoácido será el valor devuelto por la función
function aa=codon2aa(codon)
if codon== 'GAT'|codon== 'GAC'
aa='D'
end
if codon== 'CGT'|codon== 'CGC'|codon== 'CGA'|codon== 'CGG'|codon== 'AGA'|codon== 'AGG'
aa= 'R'
end
if codon== 'GGT'|codon== 'GGC' |codon== 'GGA'|codon== 'GGG'
aa='G'
end
if codon== 'GCT'|codon== 'GCC'|codon== 'GCA'|codon== 'GCG'
aa= 'A'
end
if codon== 'TGT'|codon== 'TGC'
aa='C'
end
if codon== 'CAA'|codon== 'CAG'
aa='Q'
end
if codon== 'AAT'|codon== 'AAC'
aa='N'
end
if codon== 'GAA'|codon== 'GAG'
aa='E'
end
if codon== 'CAT'|codon== 'CAC'
aa='H'
end
if codon== 'ATT'|codon== 'ATC'|codon== 'ATA'
aa='I'
end
if codon== 'TTA'|codon== 'TTG'|codon== 'CTT'|codon== 'CTC'|codon== 'CTA'|codon== 'CTG'
aa='L'
end
if codon== 'AAA'|codon== 'AAG'
aa='K'
end
if codon== 'ATG'
aa='M'
end
if codon== 'TTT'|codon== 'TTC'
aa='F'
end
if codon== 'CCT'|codon== 'CCC'|codon== 'CCA'|codon== 'CCG'
aa='P'
end
if codon== 'TCT'|codon== 'TCC'|codon== 'TCA'|codon== 'TCG'|codon== 'AGT'|codon== 'AGC'
aa='S'
end
if codon== 'GTT'|codon== 'GTC'|codon== 'GTA'|codon== 'GTG'
aa='V'
end
if codon== 'TGG'
aa='W'
end
if codon== 'TAT'|codon== 'TAC'
aa='Y'
end
if codon== 'ACT'|codon== 'ACC'|codon== 'ACA'|codon== 'ACG'
aa='T'
end
end

%2.Realice un programa que transforme la cadena de nucleótidos de la parte codificante del gen correspondiente en una cadena aminoácidos (AASEQ).
AASEQ=[]
for i=1:3:length(CDS)
codon(1)=CDS(i)
codon (2)= CDS(i+1)
codon(3)=CDS(i+2)
AASEQ= [AASEQ,codon2aa(codon)]
End


%3.Haga un histograma de los aminoácidos que componen la secuencia AASEQ.
function vect=aacounter(n)
vect=[]
for c=1:20
vect=[vect,0]
end
for c=1:length(n)
if n(c)=='M'
vect(1)=vect(1)+1
end
if n(c)=='L'
vect(2)=vect(2)+1
end
if n(c)=='P'
vect(3)=vect(3)+1
end
if n(c)=='Y'
vect(4)=vect(4)+1
end
if n(c)=='V'
vect(5)=vect(5)+1
end
if n(c)=='S'
vect(6)=vect(6)+1
end
if n(c)=='K'
vect(7)=vect(7)+1
end
if n(c)=='D'
vect(8)=vect(8)+1
end
if n(c)=='L'
vect(9)=vect(9)+1
end
if n(c)=='W'
vect(10)=vect(10)+1
end
if n(c)=='T'
vect(11)=vect(11)+1
end
if n(c)=='N'
vect(12)=vect(12)+1
end
if n(c)=='G'
vect(13)=vect(13)+1
end
if n(c)=='H'
vect(14)=vect(14)+1
end
if n(c)=='E'
vect(15)=vect(15)+1
end
if n(c)=='F'
vect(16)=vect(16)+1
end
if n(c)=='Q'
vect(17)=vect(17)+1
end
if n(c)=='R'
vect(18)=vect(18)+1
end
if n(c)=='I'
vect(19)=vect(19)+1
end
if n(c)=='C'
vect(20)=vect(20)+1
end
end
end
bar(aacounter(AASEQ))



%4. Realice una función (aa2form) que reciba un aminoácido y devuelva su fórmula molecular. Es decir, si por ejemplo realizamos la siguiente llamada aa2form('R'); debe devolver 'C6H14N4O2'
function formula=aa2form(aa)
if aa=='A'
formula=('C3H7N1O2')
end
if aa=='S'
formula=('C3H7N1O3')
end
if aa=='Y'
formula=('C9H11N1O3')
end
if aa=='C'
formula=('C3H7N1O2S')
end
if aa=='W'
formula=('C11H12N2O2')
end
if aa=='G'
formula=('C2H5N1O2')
end
if aa=='P'
formula=('C5H9N1O2')
end
if aa=='M'
formula=('C5H11N1O2S')
end
if aa=='R'
formula=('C6H14N4O2')
end
if aa=='H'
formula=('C6H9N3O2')
end
if aa=='L'
formula=('C6H13N1O2')
end
if aa=='Q'
formula=('C5H10N2O3')
end
if aa=='D'
formula=('C4H7N1O4')
end
if aa=='K'
formula=('C6H14N2O2')
end
if aa=='T'
formula=('C4H9N1O3')
end
if aa=='E'
formula=('C5H9N1O4')
end
if aa=='N'
formula=('C4H8N2O3')
end
if aa=='V'
formula=('C5H11N1O2')
end
if aa=='I'
formula=('C6H13N1O2')
end
end


% 5.Utilizando la función disponible en la plataforma numatoms, calcule el peso molecular de la proteína que forma la secuencia AASEQ
weight=0;
for i=1:length(AASEQ)
formula=aa2form(AASEQ(i))
weightC=numatoms(formula,'C')*12;
weightH=numatoms(formula,'H')*1;
weightO=numatoms(formula,'O')*16;
weightS=numatoms(formula,'S')*32;
weightN=numatoms(formula,'N')*14;
weight=weight+weightC+weightO+weightS+weightN+weightH;
end
disp(weight);

%6.Busque en las bases de datos disponibles en la red, la secuencia de aminoácidos de la proteína homóloga a la que codifica AASEQ en al menos otra especie al homo sapiens y cárguela en la variable AASEQNHS.
%Canis lupus
AASEQNHS='MSVELEEALPLTTAEGAAKKAAKAGGSAALSPSKKKKNNKKKNQPGKYSQLVVETIRRLGERNGSSLAKIYTEAKKVAWFDQQNGRTYLKYSIKALVQNDTLLQVKGTGANGSFKLNRKKLEGGSERRGATAAATAPAPAAHKAKKAAPGPPGPRRADKKPPKGPKAEKRSHKKGAASKKDKGSKAKKAAAAAGKKVKKAAKPSVPKVPKGRK'
%Gallus gallus
AASEQNHS2='MSVDLEEADLPLTEAEEAPLAAEKKGASKKAKAGGSSLSPSKKRKNNKKKNQPGKYSQLVVETIRKLGERNGSSLAKIYNEAKKVAWFDQQNGRTYLKYSIKALVQNDTLLQVKGTGANGSFKLNRKKLEGGGDGAAGG'
%Mus musculus
AASEQNHS3='MSVELEEALPPTSADGTARKTAKAGGSAAPTQPKRRKNRKKNQPGKYSQLVVETIRKLGERGGSSLARIYAEARKVAWFDQQNGRTYLKYSIRALVQNDTLLQVKGTGANGSFKLNRKKLEGGAERRGASAASSPAPKARTAAADRTPARPQPERRAHKSKKAAAAASAKKVKKAAKPSVPKVPKGRK'
% Bos taurus
AASEQNHS4='MSVELEEALPLTTAEGAAKKAAKAGGSAALSPSKKRKNSKKKNQPGKYSQLVVETIRRLGERNGSSLAKIYAEAKKVAWFDQQNGRTYLKYSIKALVQNDTLLQVKGTGANGSFKLNRKKLEGGGGERRGAPAPASAPAPAAHKAKKAAPGAAAPRRADKKPAKGPQPEKRSHKKGAASKKDKGSKAKKAAAAGGKKVKKAAKPSVPKVPKGRK'
%Macaca fascicularis
AASEQNHS5='MSVELEEALPVTTAEGMAKKVTKAGGSAALSPSKKRKNSKKKNQPGKYSQLVVETIRRLGERNGSSLAKIYTEAKKVPWFDQQNGRTYLKYSIKALVQNDTLLQVKGTGANGSFKLNRKKLEGGGERRGAPAAATAPAPTAHKAKKAAPGAAGSRRADKKPARGQKPEQRSHKKGAAAKKDKGGKTKKTAAAGGKKVKKAAKPSVPKVPKGRK'


%7.Realice una función (dotplot) que reciba dos secuencias de aminoácidos y muestre una gráfica de puntos en la que se compare ambas proteínas.
function grafica=dotplot(r,s)
x=[ ];
y=[ ];
for i=1:length(r)
for j=1:length(s)
if r(i)==s(j)
x=[x,i];
y=[y,j];
end
end
end
plot(x,y,'.');
end

No hay comentarios:

Publicar un comentario