[Biojava-l] DNA sequence alignment - class AlignmentPair

Katerina Stillou kstillou at gmail.com
Thu Jun 17 23:38:35 UTC 2010


Hello,
I would like to ask a question concerning the class AlignmentPair. My goal
is to align two DNA sequences in order to find their percent identity. I
know that the latest version of the alignment module found in SVN offers
this function.  So, I downloaded the latest snapshot of the alignment module
found in http://www.biojava.org/download/maven/ , specifically I used the
file alignment-3.0-SNAPSHOT.jar . The code in my program is the following:

      FiniteAlphabet alphabet = (FiniteAlphabet)
AlphabetManager.alphabetForName("DNA");

      short match = 1;
      short replace = 0;
      File simple=new File("genome/NUC.4.4.txt");

      SubstitutionMatrix matrix = new SubstitutionMatrix(alphabet, simple);

      Sequence query  = DNATools.createDNASequence(seq1, "query");
      Sequence target = DNATools.createDNASequence(seq2, "target");

       NeedlemanWunsch nw =  new NeedlemanWunsch(
        (short) 0,  // match
        (short) 3, // replace
        (short) 2,      // insert
        (short) 2, // delete
        (short) 1,      // gapExtend
        matrix  // SubstitutionMatrix
      );

      AlignmentPair aligner =   nw.pairwiseAlignment(
        query, // first sequence
        target // second one
      );

     System.out.println("Align Results:
"+aligner.getPercentIdentitySubject());

 First, I want to ask if there is any problem with my code because I get the
this error when I build it:

  cannot access org.biojava.bio.alignment.SimpleAlignment
  class file for org.biojava.bio.alignment.SimpleAlignment not found
  System.out.println("Align Results: "+aligner.getPercentIdentitySubject());

It seems to me that the problem is in the class AlignmentPair. I have also
downloaded all the source files from SVN and noticed that the class
AlignmentPair is supposed to extend the class SimpleAlignment which doesn't
exist in the alignment module from SVN. Is this actually where the problem
lies or am I doing something wrong?

 I would really appreciate any help! Thanks in advance,

Katerina



More information about the Biojava-l mailing list