Question

Requirements: For this exercise you are to implement a small bioinformatics library for operations with DNA...

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.

Dyad

A sequence exhibits dyad symmetry if the beginning of the sequence (the upstream sequence) is followed by the reverse complement of itself at the end of the sequence (the downstream sequence). For example, with n as a placeholder for any arbitrary DNA letter, the DNA sequence TTACGnnnnnnCGTAA exhibits dyad symmetry because the downstream sequence CGTAA is equal to the reverse complement of the upstream sequence TTACG. The substring between the complementary upstream and downstream sequences is referred to as the intervening sequence. It is not a requirement for the intervening sequence to have a length greater than zero for the whole sequence to exhibit dyad symmetry. In the above example, removing the intervening sequence would leave the sequence as TTACGCGTAA, which still exhibits dyad symmetry.

For this exercise, a DNA sequence only exhibits dyad symmetry if:

  • the upstream sequence is equal to the reverse complement of the downstream sequence
  • the two complementary upstream and downstream sequences are both at least some minimum length, referred to as the dyad minimum (only with a dyad minimum of does the example TTACGnnnnnnCGTAA exhibit dyad symmetry)

This method, Dyad, must take the following parameters:

  • a DNA sequence
  • an optional integer representing the dyad minimum, which has a default value of 5 if no argument is provided for this parameter

This method must return a Boolean true if and only if the sequence exhibits dyad symmetry and false otherwise.

You should call ReverseComplement as part of your implementation.

Skeleton

Use the following skeleton as a basis for your program:

 
using System;
    
class Sequence
{
    
}

I have been struggling to find a way to implement these actions in C#. Any help would be much appeciated.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp8
{
    class Sequence
    {
        static void Main(string[] args)
        {
            var dict = new Dictionary<char, char>()
            {
                ['A'] = 'T',
                ['T'] = 'A',
                ['G'] = 'C',
                ['C'] = 'G',
            };

            var input = "AAGCT";
            var output = string.Concat(input.Select(c => dict[c]).Reverse()); // AGCTT

            Console.WriteLine(input);
            Console.WriteLine(output);
        }
    }
}
Add a comment
Know the answer?
Add Answer to:
Requirements: For this exercise you are to implement a small bioinformatics library for operations with DNA...
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...

  • 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...

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