I have a list of ~200 DNA sequences, representing probably 50 different genomic regions but they're all mixed up. For example, if I have `seq1, seq2.... seq10`, `sec1` might align to `seq3` and `seq8`, but be completely unrelated to the others. There are also some differences in the lengths sampled, so the above example might represent: `Seq1-------------------------------------------------` `Seq3---------------------- seq8----------------- ` Such that `seq3` and `seq8` don't align to each other, but both align to `seq1` So what I'd like to do is go through and somehow generate a list of groups of sequences that align to each other, as well as the alignments. eg: **Group 1** `Seq1-------------------------------------------------` `Seq3---------------------- seq8----------------- ` **Group 2** `seq2------------------------------------` `. seq6-----------------------------` `. seq7--------------------------xxxxxx` **Group 3**... etc Trying ClustalW or MUSSLE to align everything doesn't work (or takes an unreasonable amount of time), I'm guessing because there are so many sequences that don't align at all. I tried making a custom BLAST database and then BLASTed each sequence against it, but then I get multiple hits for the same alignment (with the group 2 example above, `seq2:seq6`, `seq2:seq7`, `seq6:seq2`, `seq6:seq7`, `seq7:seq2` and `seq7:seq6` all get returned as 6 unique hits, when they should be grouped together. My current coding knowledge is fairly basic, but I'm willing to read docs and figure stuff out, I just don't want to reinvent the wheel. **Edit2:** Really, the grouping is the important part - once I have the groups, I can do the alignment separately with little effort. I'd just like to have groups where each sequence is in a single group.