Question

I need to learn this in c# Requirements: For this exercise you are to implement a small bioinform...

I need to learn this in c#

Requirements:

For this exercise you are to implement a small bioinformatics library for operations with DNA sequences, which, in this exercise, are represented as strings of only the characters A, C, G, and T. Three methods are required for this exercise and they are each detailed below.

Kmers

The term k-mer refers to all the possible substrings of length k that are contained in a DNA sequence. For example, given the DNA sequence AGATCGAGTG the 3-mers are:

AGA GAT ATC TCG CGA GAG AGT GTG

This method, Kmers, must take the following parameters in the order specified:

  • an integer specifying k
  • an arbitrary number of DNA sequences each provided as individual arguments

In the form of a string array, this method must return all the k-mers contained in the assembled sequence  where  is formed by concatenating all the provided DNA sequences in the order they are provided to the method.

ReverseComplement

The reverse complement of a sequence is formed by exchanging all of its nucleobases with their base complements, and then reversing the resulting sequence. The reverse complement of a DNA sequence is formed by exchanging all instances of:

  • A with T
  • T with A
  • G with C
  • C with G

and then reversing the resulting sequence.

For example, given the DNA sequence AAGCT the reverse complement is AGCTT

This method, ReverseComplement, must take the following parameter:

  • a reference to a DNA sequence

This method should return void and mutate the referenced DNA sequence to its reverse complement.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

here I am showing you complete program for getting a substring of given string in given string.

instead of string you can put the DNA sequence.

here I am not putting limitation on different type of character that you can choose. As you said only four characters but you can anything in this code.

// C++ program to print all possible
// substrings of a given string
#include<bits/stdc++.h>
using namespace std;

// Function to print all k-len sub strings
void subString(string s,int len)
{
// Pick starting point in outer loop
// and lengths of different strings for
// a given starting point
int n = s.length();
for (int i = 0; i <= n-len; i++) //here we each time moving to next element and printing the substring upto provided length.
cout << s.substr(i, len) << endl;
}

// Driver program to test above function
int main()
{
  
string str;
cout << "Enter a string: ";
getline(cin, str);
  
int len;
cout << "Enter a length of substring: ";
cin >> len;
  
subString(str,len);
return 0;
}

Add a comment
Know the answer?
Add Answer to:
I need to learn this in c# Requirements: For this exercise you are to implement a small bioinform...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Requirements: For this exercise you are to implement a small bioinformatics library for operation...

    Requirements: For this exercise you are to implement a small bioinformatics library for operations with DNA sequences, which, in this exercise, are represented as strings of only the characters A, C, G, and T. Three methods are required for this exercise and they are each detailed below. Kmers The term k-mer refers to all the possible substrings of length k that are contained in a DNA sequence. For example, given the DNA sequence AGATCGAGTG the 3-mers are: AGA GAT ATC...

  • In this assignment, you will implement a deterministic finite automata (DFA) using C++ programming language to...

    In this assignment, you will implement a deterministic finite automata (DFA) using C++ programming language to extract all matching patterns (substrings) from a given input DNA sequence string. The alphabet for generating DNA sequences is {A, T, G, C}. Write a regular expression that represents all DNA strings that contains at least two ‘A’s. Note: assume empty string is not a valid string. Design a deterministic finite automaton to recognize the regular expression. Write a program which asks the user...

  • I need Summary of this Paper i dont need long summary i need What methodology they used , what is the purpose of this p...

    I need Summary of this Paper i dont need long summary i need What methodology they used , what is the purpose of this paper and some conclusions and contributes of this paper. I need this for my Finishing Project so i need this ASAP please ( IN 1-2-3 HOURS PLEASE !!!) Budgetary Policy and Economic Growth Errol D'Souza The share of capital expenditures in government expenditures has been slipping and the tax reforms have not yet improved the income...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT