Decoding DNA sequence into binary
古いコメントを表示
I have a sequence TGACTCAGTCGTTCAATCTATGCC, how to write code in matlab to convert it into binary? Please help me..Thank you
3 件のコメント
James Tursa
2015 年 9 月 23 日
Please give an example of what exact output you would like for the above sequence.
Meghashree G
2015 年 9 月 23 日
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.
採用された回答
その他の回答 (4 件)
Bastien Chardonnens
2015 年 9 月 23 日
You can use
str = ('TGACTCAGTCGTTCAATCTATGCC');
[~,~,ind] = unique(double(str)-65);
dec2bin(ind-1)
Suresma Jena
2017 年 8 月 27 日
0 投票
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 件のコメント
James Tursa
2017 年 8 月 29 日
編集済み: James Tursa
2017 年 8 月 29 日
x = 'ATGCAT';
xA = x == 'A';
xT = x == 'T';
xG = x == 'G';
xC = x == 'C';
Results will be logical. If you want character results then you can add '0' to the above lhs variables and convert to char. E.g.,
xA = char((x == 'A') + '0');
xT = char((x == 'T') + '0');
xG = char((x == 'G') + '0');
xC = char((x == 'C') + '0');
SUBHAJIT KAR
2017 年 9 月 17 日
I have a DNA sequence in FASTA format. I want to convert this DNA sequence into two bit binary sequence such that a sequence reading x=' ATCGA' will be converted into '0001101100'. the coding will be A=00, C=01,G=10 and G=11. please send suggestions.
Walter Roberson
2017 年 9 月 17 日
Use the method James showed https://www.mathworks.com/matlabcentral/answers/244696-decoding-dna-sequence-into-binary#answer_193507
SUBHAJIT KAR
2017 年 9 月 18 日
Can I replace a text file which contain the string with s ?
Walter Roberson
2017 年 9 月 18 日
s = fileread('NameOfTextFileGoesHere');
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
2019 年 1 月 15 日
編集済み: Siyab Khan
2019 年 1 月 15 日
0 投票
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
2022 年 4 月 4 日
編集済み: Khaled belkacemi
2022 年 4 月 4 日
0 投票
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 

カテゴリ
ヘルプ センター および File 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!