Borrar filtros
Borrar filtros

How to reverse scrambled DNA?

1 visualización (últimos 30 días)
M.A.Fathy
M.A.Fathy el 29 de En. de 2018
Respondida: Asha D. el 7 de Jul. de 2019
I have this function for scrambling DNA array in Matlab:
disp(x); disp(y);
figure,plot(x,y);
%%sorting
[lx,fx]=sort(x);
[ly,fy]=sort(y);
S=fx;
T=(fy)';
%%matrix generated for scrambling
[Tgrid, Sgrid] = meshgrid( T, S );
W = arrayfun( @(S,T) [S T], Sgrid, Tgrid, 'UniformOutput', false );
%%scrambled matrix
D=cellfun(@(x) C{x(1),x(2)},W,'un',0);
disp(D);
I can't figure out how I can reverse this scrambled function to get the decryption code. Would you please help me up?
Edit//
I am working on a gray scale image encryption(256*256), converted the values of this image into dna array(265*265), every pixel have 4 characters for an example ACGT TTCG AAGC ....etc. After that i scrambled this dna array by using two generated random chaotic sequences x,y which the length of each other is (1*256).
This is the code from beginning to make the above part be more clear, hope you can help me to get the inverse of scrambled function:
clc
clear all
close all
tic;
A=imread('C:\Users\Desktop\lena.jpg');
disp(A);
imshow(A);
for i=1:1:256
for j=1:1:256
B{i,j,1} = dec2bin(A(i,j),8); %%conversion of pixel values to 8 bit binary values from original image
end
end
disp(B);
codebook1 = containers.Map({'00','11','10','01'},{'G','C','T','A'}); %// Lookup-map values to key
%%DNA maping of binary values of original image
outputCell = cellfun(@(x) values(codebook1, {x(1:2),x(3:4),x(5:6),x(7:8)}),B, 'uni', 0);
C = cellfun(@cell2mat, outputCell, 'uni', 0);
disp(C);
%%Chaotic sequence generation
%the values of a, b, c, d, k here
a = 36;
b = 3;
c = 28;
d = 16;
k = 0.2;
%vector v0, which is a 4x1 vector of initial conditions
v0 = [0.3 -0.4 1.2 1];
fun = @(t,v) chenAssistentFun(t,v,a,b,c,d,k);
[t, v] = ode45(fun, [0 1.54], v0);
x = v(:,1);
x(257)=[];
y = v(:,2);

Respuestas (1)

Asha D.
Asha D. el 7 de Jul. de 2019
I am eager to know that whether you got the reverse code.
If yes then kindly share.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by