I am trying to assign a new set of alphabets to a strand of alphabet matrix that I already have

1 回表示 (過去 30 日間)
B = {'a' 'u'
'c' 'g'
'g' 'c'
't' 'a'};
for i = 1:length(template3_5)
DNA_base = [];
row_B = strcmp(DNA_base,B(:,1));
RNA_base = [];
[];
end
template 3_5 is supposed to be the sequence text attached. I am supposed to write a code and modify the parts in [];. Using the matrix B, I have to assign a new set of alphabets to the current template(text file) that I have.
  5 件のコメント
SANGBIN LEE
SANGBIN LEE 2024 年 2 月 20 日
@Stephen23 i have to modify the for loop in order to get the alphabet strand from the text file to match up and transition into a new sequence of alphabets based on the matrix B. so for example, if i have a 'a', it should match up with 'u', 'c' shoudl match with 'g' so on.
Stephen23
Stephen23 2024 年 2 月 20 日
編集済み: Stephen23 2024 年 2 月 20 日
"i have to modify the for loop in order to get the alphabet strand from the text file to match up and transition into a new sequence of alphabets based on the matrix B. so for example, if i have a 'a', it should match up with 'u', 'c' shoudl match with 'g' so on."
No, that is your task or goal. What is your question? So far you have not asked us anything.
I have to go to Beijing. How do I get to Beijing?
^^^^ GOAL/TASK ^^^^^^^^ ^^^^^^^ QUESTION ^^^^^^^
There are many things that you might be trying to ask, but making us guess is not an efficient way to transfer this information.

サインインしてコメントする。

回答 (1 件)

sai charan sampara
sai charan sampara 2024 年 2 月 26 日
Hello Lee,
I understand that you are trying to replace every letter of the sequence by a specific letter based on the mapping given by the matrix.
You have mentioned that “template3_5” is the sequence attached. It can be defined by opening the text file using “fopen” and reading its content as a string using “fscanf”. Then in the “for” loop each letter can be accessed as “DNA_base” and compared with the matrix to find the suitable mapping. From the mapping, the corresponding “RNA_base” can be found out. These “RNA_base” can be put together to form the required complete sequence. It can be done as follows:
seq_file = fopen('insulinDNAseq.txt');
template3_5 = fscanf(seq_file,'%s')
template3_5 = 'gctggttcaagggctttattccatctctctcggtgcaggaggcggcgggtgtggggctgcctgcgggctgcgtctagttgcagtagttctccagctggtagagggagcagatgctggtacagcattgttccacaatgccacgcttctgcagggacccctccagggccaagggctgcaggctgcctgcaccagggcccccgcccagctccacctgccccacctgcaggtcctctgcctcccggcgggtcttgggtgtgtagaagaagcctcgttccccgcacactaggtagagagcttccaccaggtgtgagccgcacaggtgttggttcacaaaggctgcggctgggtcaggtccccagagggccagcagcgccagcaggggcaggaggcgcatccacagggccatggcagaaggacagtgatctgcttgatggcctcttctgatgcagcctgtcctggagggct'
B = {'a' 'u'
'c' 'g'
'g' 'c'
't' 'a'};
RNA='';
for i = 1:length(template3_5)
DNA_base = template3_5(i);
row_B = strcmp(DNA_base,B(:,1));
RNA_base = B{row_B,2};
RNA(i)=RNA_base;
end
RNA
RNA = 'cgaccaaguucccgaaauaagguagagagagccacguccuccgccgcccacaccccgacggacgcccgacgcagaucaacgucaucaagaggucgaccaucucccucgucuacgaccaugucguaacaagguguuacggugcgaagacgucccuggggaggucccgguucccgacguccgacggacguggucccgggggcgggucgagguggacgggguggacguccaggagacggagggccgcccagaacccacacaucuucuucggagcaaggggcgugugauccaucucucgaaggugguccacacucggcguguccacaaccaaguguuuccgacgccgacccaguccaggggucucccggucgucgcggucguccccguccuccgcguaggugucccgguaccgucuuccugucacuagacgaacuaccggagaagacuacgucggacaggaccucccga'

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by