Question: DNA sequences are often stored in a text file having a specific format called FASTA file. FASTA format is a text-based format for representing either

DNA sequences are often stored in a text file having a specific format called FASTA file. FASTA format is a text-based format for representing either nucleotide or amino acid sequences. The format allows for sequence names and comments to precede each sequence. Figure 2 shows a simple example of a fasta file.

>First sequence ACACAGGAA

>Second sequence

ACGTCAGGTC

sequence

TACTGACEC

Figure 2: Example of a FASTA file

Your program should be able to read all sequences from a FASTA file and compute the k-mer usage bias from all sequences in the file.

3 Requirements

In this phase, you are required to implement the following classes:

// This class represents a set of sequences. public class SequenceSet { // Constructor.

public SequenceSet ( ) ;

// Load sequences from FASTA file.

public static SequenceSet load (String fileName) ;

// Return the global usage over al L sequences in the set. The word Length is k and window step size is w. public Usage getUsage (int k, int w) ;

// Return al L sequences in the set in the same order they appear in the file. public LinkedList getSequences ( ) ;

// This class represents a single sequence. public class Sequence { // Constructor.

public Sequence (String header, String seq) ; // Return the header of the sequence. public String getHeader() ; public String getSeq() ;

// Return the usage for word Length k and window step size w. public Usage getUsage (int k, int w) ;

// This class represents usage data at the sequence or sequence set Level. public class Usage { // Constructor. public Usage ( ) ;

// Add a kmer with the corresponding number of occurrences. public add (String kmer, int count) ;

// Return the number of occurrences of kmer. public int getCount (String kmer) ; // Return al L kmers with their count.

public LinkedList> getCounts ( ) ;

// This class represents a pair. This class must be used as it is without modifications .

public class Pair { public U first; public V second; public Pair (U first, V second) { this. first = first; this. second = second;

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!