I understand how to assemble genome from error-free reads. I implemented like this:
Construct directed overlap graph with reads as vertices and edges as maximum overlap between two vertices. Edges represent the length of overlapping maximum substring of one read suffix with other read prefix. Find the path that visits all vertices only once in overlap graph. With small graph we can use greedy approach : Starting from first pattern always choose egde of maximum weight and store shortest common superstring spelled by this path in resulting string. Resulting string spelled by path is shortest common superstring of all reads, that is assembled genome.
For example
AACTAG
CTAGAT
Gives the AACTAGAT
as a result
Now let's say that two error-prone reads have at most one error (mismatch):
AACTAG
CTCGAT
As you can see second read has one substitution in third character from 'A' to 'C'.
So how assembled genome should look like for the error-prone reads? Do I take A or C to resulting string? Or I'm missing something?
Note: I used short reads for example because of simplicity. I work with much larger number of reads which are 100 nucleotides long and have at most one substitution of character. So that's a big overlap graph. I know I can use De Bruijn graph, but can I use some greedy approach (like in error-free example)?