Question: why? DNA N-Gram Distribution (string scalar) In DNA analysis unique sequences of three bases need to be identified any point in the gene sequence. The

why?why? DNA N-Gram Distribution (string scalar) In DNA analysis unique sequences ofthree bases need to be identified any point in the gene sequence.The bases could be combinations of either T, C, A or G.Write a function nGramFrequency to identify the unique n-grams (n letter sequence)

DNA N-Gram Distribution (string scalar) In DNA analysis unique sequences of three bases need to be identified any point in the gene sequence. The bases could be combinations of either T, C, A or G. Write a function nGramFrequency to identify the unique n-grams (n letter sequence) in a given string scalar stringin and the number of times an n-gram occurs. In addition to the input stringln, the number n speficies the length of the n-gram. The identified unique n-gram sequences should be sorted alphabetically. The outputs should be empty if i) there are no n-grams, ii) the input is not a string scalar, or ii) the length of the ngram is not a positive integer. Restriction: The nGramFrequency function should use the internal function extractBetween. For example >>S"AACTGAACG"; lengthnGram 3; >>uniquegrams, count] nGramFrequency (s,lengthnGram) uniquegrams- 1x6 string array "AAC" "ACG""ACT""CTG""GAA""TGA" countE 1 The unique 3-grams are "AAC" "ACG" "ACT" "CTG" "GAA" "TGA". The sequence AAC that appears twice, and all appear once >>s"AACTGAACG";lengthnGram-10; [uniquegrams, count] nGramFrequency(s,lengthnGram) uniquegrams- [l countE [l Your Function Save C Reset E MATLAB Documentation 1 function [uniqueGrams, countGrams] nGramFrequency(instring, lengthnGram) 3 uniqueGrams [1; 4 count-[]; 5 SinString: 6 if (isStringScalar(s) &&lengthnGram > 0 && lengthnGramstrlength(s)) uniquegramsstrings; countTemp-0; k 1; 2while( (i+lengthnGram-1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!