Skip to content

Commit 7e2b404

Browse files
slight text edits
1 parent d62948c commit 7e2b404

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

docs/src/rosalind/06-hamming.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# Counting Point Mutations
22

33
!!! warning "The Problem"
4-
Problem
54

6-
Given two strings s and t of equal length, the Hamming distance between s
7-
and t, denoted dH(s,t), is the number of corresponding symbols that differ in s and t.
5+
Given two strings s and t of equal length, the Hamming distance between s and t, denoted dH(s,t), is the number of corresponding symbols that differ in s and t.
86

97
Given: Two DNA strings s and t of equal length (not exceeding 1 kbp).
108

@@ -18,12 +16,13 @@
1816
```
1917

2018
***Sample Output***
19+
2120
```
2221
7
2322
```
2423

2524

26-
To calculate the Hamming Distance between two strings/sequences, the two strings/DNA sequences must be the same length. Therefore, we can calculate the Hamming Distance by looping over one of the strings and checking if the corresponding character in the other string matches. Each mismatch will cause 1 to be added to a `counter` variable. At the end of the loop, we can return the total value of the `counter` variable.
25+
To calculate the Hamming Distance between two strings/sequences, the two strings/DNA sequences must be the same length. We can calculate the Hamming Distance by looping over the characters in one of the strings and checking if the corresponding character at the same index in the other string matches. Each mismatch will cause 1 to be added to a `counter` variable. At the end of the loop, we can return the total value of the `counter` variable.
2726

2827
Let's give this a try!
2928

@@ -41,7 +40,6 @@ function calcHamming(SeqA, SeqB)
4140

4241
mismatches = 0
4342
for i in 1:SeqLength
44-
# print(i)
4543
if SeqA[i] != SeqB[i]
4644
mismatches += 1
4745
end
@@ -77,11 +75,11 @@ BioAlignmentsHamming[1]
7775
```
7876

7977

80-
The BioAlignments `hamming_distance` function requires three input variables -- the first of which allows the user to control the `type` of the returned hamming distance value. In the above example, `Int64` is provided as the input variable, but `Float64` or `UInt8` are also acceptable inputs.
78+
The BioAlignments `hamming_distance` function requires three input variables -- the first of which allows the user to control the `type` of the returned hamming distance value. In the above example, `Int64` is provided as the input variable, but `Float64` or `Int8` are also acceptable inputs.
8179

8280
The second two input variables are the two sequences that are being compared.
8381

84-
There are two outputs of this function: the actual Hamming Distance value and the Alignment Anchor. The Alignment Anchor is a a one-dimensional array (vector) that is the same length as the length of the input strings. Each value in the vector is a also an AlignmentAnchor with three fields: sequence position, reference position, and an operation code ('0' for start, '=' for match, 'X' for mismatch).
82+
There are two outputs of this function: the actual Hamming Distance value and the Alignment Anchor. The Alignment Anchor is a a one-dimensional array (vector) that is the same length as the length of the input strings. Each value in the vector is also an AlignmentAnchor with three fields: sequence position, reference position, and an operation code ('0' for start, '=' for match, 'X' for mismatch).
8583

8684
The Alignment Anchor for the above example is
8785
```

0 commit comments

Comments
 (0)