Question

In: Computer Science

A) Develop a function GC(seq) using MATLAB that takes in as input parameter a nucleotide sequence seq returns the computed (G+C) content for the inputted seq.

A)    Develop a function GC(seq) using MATLAB that takes in as input parameter a nucleotide sequence seq returns the computed (G+C) content for the inputted seq.

B)    Develop a function GCSlidingWindow (seq, winsize, overlap) that takes three input parameters, a biological seq, a sliding window size winsize and the extent of overlap between successive sliding windows { overlap. It calls the function GC and plots the G+C property measured along the span of the argument seq.

Solutions

Expert Solution

Sliding Window Algorithm

             Given a larger integer buffer/array (say size, x), window size (say, n) and a number (say, k). Windows starts from the first element and by one element keeps shifting right. The objective is to find the minimum k numbers present in each window. Sliding window problem or algorithm is commonly.

            This problem regularly features in programming interview questions. Basic concept is very simple, but some more variables thrown into question, that makes it more interesting.

  1. First way is to use quick sort, pivot is Kth position, all elements on the right side are greater than pivot, hence, all elements on the left side automatically become K smallest elements of give array.
  2. Keep an array of K elements, fill it first K elements of given input array. Now K + 1 element, check if the current element is less than the maximum element in the auxiliary array, add this element into array.

Related Solutions

in c++ Write a function that takes a C string as an input parameter and reverses...
in c++ Write a function that takes a C string as an input parameter and reverses the string. The function should use two pointers, front and rear. The front pointer should initially reference the first character in the string, and the rear pointer should initially reference the last character in the string. Reverse the string by swapping the characters referenced by front and rear, then increment front to point to the next character and decrement rear to point to the...
Develop a function DNF that takes as input a proposition and returns as output a logically...
Develop a function DNF that takes as input a proposition and returns as output a logically equivalent proposition in DNF. Hint: Adapt the CNF function.
Write a function that takes a C string as an input parameter and reverses the string.
in c++ Write a function that takes a C string as an input parameter and reverses the string. The function should use two pointers, front and rear. The front pointer should initially reference the first character in the string, and the rear pointer should initially reference the last character in the string. Reverse the string by swapping the characters referenced by front and rear, then increment front to point to the next character and decrement rear to point to the...
USING PYTHON, write a function that takes a list of integers as input and returns a...
USING PYTHON, write a function that takes a list of integers as input and returns a list with only the even numbers in descending order (Largest to smallest) Example: Input list: [1,6,3,8,2,5] List returned: [8, 6, 2]. DO NOT use any special or built in functions like append, reverse etc.
Write a C function called weighted_digit_sum that takes a single integer as input, and returns a...
Write a C function called weighted_digit_sum that takes a single integer as input, and returns a weighted sum of that numbers digits. The last digit of the number (the ones digit) has a weight of 1, so should be added to the sum "as is". The second from last digit (the tens digit) has a weight of 2, and so should be multiplied by 2 then added to the sum. The third from last digit should be multiplied by 1...
Using Matlab, write a function that takes numeric data as its input argument and prints a...
Using Matlab, write a function that takes numeric data as its input argument and prints a message to the Command Window stating if the number is positive, or negative, or 0. This function should transfer an output value to the Workspace ONLY when the input value is negative. Please include a copiable code and the associated screenshots.
Write a recursive function (using Matlab) moreFactors(a,b,fact) that does the following: 1. Takes as an input...
Write a recursive function (using Matlab) moreFactors(a,b,fact) that does the following: 1. Takes as an input 3 positive integers. 2. Of the two integers a and b, the function returns the integer that has the most factors fact. 3. If both integers a and b have the same amount of factors fact, the function will return the larger integer. Test your function with the following: >> result=moreFactors(24,32,3) result = 24 (24 = 3^1 · 2^3 , 32 = 2^5 )...
Using C++ Write a template function that accepts an integer parameter and returns its integer square...
Using C++ Write a template function that accepts an integer parameter and returns its integer square root. The function should return -1, if the argument passed is not integer. Demonstrate the function with a suitable driver program .
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT