필터 지우기
필터 지우기

Decoding DNA sequence into binary

조회 수: 38 (최근 30일)
Meghashree G
Meghashree G 2015년 9월 23일
편집: Khaled belkacemi 2022년 4월 4일
I have a sequence TGACTCAGTCGTTCAATCTATGCC, how to write code in matlab to convert it into binary? Please help me..Thank you
  댓글 수: 3
Meghashree G
Meghashree G 2015년 9월 23일
The output should be 01100011 01110010 01111001 01110000 01110100 01101111
( A=00 T=01 G=10 C=11)
Dabba Do
Dabba Do 2018년 2월 14일
편집: Dabba Do 2018년 2월 14일
IF: every A matches to a T, THEN: the output for an A or a T is the same. The same is true of G and C they are a pair. So there are only two pairs, why not try defining each pair as a 1 or a 0. So if A and T = 1 and G and C = 0 then: the sequence TGACTCAGTGTTCAATCTATGCC would be: 101010101001101110111000. By coding each codon with a 1 and a 0 you are going to con-volute the Bits in your code and they work as pairs representing a single genetic Bit.

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

채택된 답변

James Tursa
James Tursa 2015년 9월 23일
편집: James Tursa 2015년 9월 23일
One way:
s = 'TGACTCAGTCGTTCAATCTATGCC'; % Input DNA string
[~,x] = ismember(s,'ATGC'); % Convert the ATGC into indexes
c = {'00','01','10','11'}; % Numeric strings to convert the indexes into
result = cell2mat(c(x)); % Convert the indexes into the numeric strings

추가 답변 (4개)

Bastien Chardonnens
Bastien Chardonnens 2015년 9월 23일
You can use
str = ('TGACTCAGTCGTTCAATCTATGCC');
[~,~,ind] = unique(double(str)-65);
dec2bin(ind-1)

Suresma Jena
Suresma Jena 2017년 8월 27일
i want to how to convert a DNA sequence into binary. ex- if x = ATGCAT then its binary sequence will be xA = 100010 xT = 010001 xG = 001000 xC = 000100
  댓글 수: 6
Walter Roberson
Walter Roberson 2017년 9월 18일
s = fileread('NameOfTextFileGoesHere');
lakshmi boddu
lakshmi boddu 2018년 4월 8일
A pseudo random binary sequence of size 256 * 256 is generated with two 1 D logistic maps , from which 3-bit disjoint and consecutive binary sequences are extracted to choose DNA coding rule, as follows 000 ( 00-A,01-C 10-G,11-T) 001(00-A,01-G,10-C,11-T) 010(00-C,01-A,10-T,11-G) 011( 00-C ,01-T,10-A,11-G) 100( 00-G, 01-A,10-T,11-C) 101(00-G,01-T,10-A, 11-C) 110(00-T,01-C,10-G,11-A) 111( 00-T,01-G,10-C,11-A) . please help me sir how to implement in matlab

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


Siyab Khan
Siyab Khan 2019년 1월 15일
편집: Siyab Khan 2019년 1월 15일
Please also write code for DNA sequencig in 4 bits
via this given schema
4 2 1 0
N = 0 0 0 1 N represents the gap in DNA sequence
A = 0 1 0 0
T = 1 0 0 0
C = 0 0 1 0
G = 0 1 1 0

Khaled belkacemi
Khaled belkacemi 2022년 4월 4일
편집: Khaled belkacemi 2022년 4월 4일
Hello,can someone help me to do the code for this situation? example of input data:0121212002202021101110002
and i want to code my data as this array

카테고리

Help CenterFile Exchange에서 Genomics and Next Generation Sequencing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by