필터 지우기
필터 지우기

Binary to DNA sequence encoding - matlab

조회 수: 11 (최근 30일)
Meghashree G
Meghashree G 2015년 9월 20일
댓글: Image Analyst 2021년 2월 5일
I am implementing DNA encryption algorithm.
For that, I have a vector containing binary values such as:
01100011 01110010 01111001 01110000 01110100 01101111.
Now, these values should be mapped to DNA sequence. How do I do that in MATLAB?
  댓글 수: 2
Star Strider
Star Strider 2015년 9월 20일
DNA has four bases (two complementary sets, A-T and C-G) and you have a binary sequence ...
Meghashree G
Meghashree G 2015년 9월 20일
yeah..i know To use ATGC concept,but i don't know how to code..Like how do i extract only 2 digits from the binary vector and assign it to either A,T,G,C..

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2015년 9월 20일
Perhaps this:
% Assign sample data.
binaryArray = [0,1,1,0,0,0,1,1, 0,1,1,1,0,0,1,0, 0,1,1,1,1,0,0,1, 0,1,1,1,0,0,0,0, 0,1,1,1,0,1,0,0, 0,1,1,0,1,1,1,1];
% Define base letters to choose from.
bases = 'ATGC';
for k = 1 : 2 : length(binaryArray)
% Convert these two digits into a number 1 - 4.
index = 2 * binaryArray(k) + binaryArray(k+1) + 1;
% Use that index to assign a letter to our result.
result((k+1)/2) = bases(index);
end
% Display in command window:
result
It shows:
result =
TGACTCAGTCGTTCAATCTATGCC
  댓글 수: 12
Shiva Reddy
Shiva Reddy 2021년 2월 5일
Pls Can I get the decryption code
Image Analyst
Image Analyst 2021년 2월 5일
Shiva, I'm not sure who you're asking, but personally I don't have any to give you.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by