Entering edit mode
8.7 years ago
nivedita_sumi_m
•
0
How to get the alignment score? This is the code I am using:
DNASequence target = null; try { target = new DNASequence(seq1.toString(), AmbiguityDNACompoundSet.getDNACompoundSet()); } catch (CompoundNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); }
DNASequence query = null;
try {
query = new DNASequence(seq2.toString(), AmbiguityDNACompoundSet.getDNACompoundSet());
} catch (CompoundNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
SubstitutionMatrix<NucleotideCompound> matrix = SubstitutionMatrixHelper.getNuc4_4();
SimpleGapPenalty gapP = new SimpleGapPenalty();
gapP.setOpenPenalty((short)5);
gapP.setExtensionPenalty((short)2);
SequencePair<DNASequence, NucleotideCompound> psa =
Alignments.getPairwiseAlignment(query, target,
PairwiseSequenceAlignerType.LOCAL, gapP, matrix);
```
Is this BioJava? If so, you might want to tag your post with that.