Commit c615f584 authored by Bo's avatar Bo
Browse files

Function for SequencDistance and Alignment distance

parent 5a0e6b70
...@@ -43,7 +43,7 @@ class SequenceDistance: ...@@ -43,7 +43,7 @@ class SequenceDistance:
for line in lines: for line in lines:
line = line.strip('\n') line = line.strip('\n')
pass # do something #pass # do something
# Create sequences to be aligned. # Create sequences to be aligned.
a = Sequence(testSequence.split()) a = Sequence(testSequence.split())
...@@ -55,13 +55,12 @@ class SequenceDistance: ...@@ -55,13 +55,12 @@ class SequenceDistance:
bEncoded = v.encodeSequence(b) bEncoded = v.encodeSequence(b)
# Create a scoring and align the sequences using global aligner. # Create a scoring and align the sequences using global aligner.
scoring = SimpleScoring(1, -1) scoring = SimpleScoring(10, -1)
aligner = GlobalSequenceAligner(scoring, -1) aligner = GlobalSequenceAligner(scoring, -1)
aligner2 = LocalSequenceAligner(scoring, -1)
score, encodeds = aligner.align(aEncoded, bEncoded, backtrace=True) score, encodeds = aligner.align(aEncoded, bEncoded, backtrace=True)
# Create a scoring and align the sequences using local aligner. # Create a scoring and align the sequences using local aligner.
scoring2 = SimpleScoring(1, -1) scoring2 = SimpleScoring(10, -1)
aligner2 = LocalSequenceAligner(scoring2, -1) aligner2 = LocalSequenceAligner(scoring2, -1)
score2, encodeds2 = aligner2.align(aEncoded, bEncoded, backtrace=True) score2, encodeds2 = aligner2.align(aEncoded, bEncoded, backtrace=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment