This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to generate CIGAR like string?

Hi, I have two sequences and I would like to generate indels for them. As the alignment just gives the score, to represent the the alignment of the two sequence I would like to generate CIGAR .

next-gen assembly alignment

Just open the sequences with a text editor and insert/delete some bases? Maybe I'm missing something in your question...

Yes. I got confused with indel and cigar string. Just updated the question.

1 answer

  1. Use a random number generator to pick a position
  2. Use a random number generator to pick an InDel length
  3. Using the above, add (possibly random) sequence of the given length at the given position
  4. ?
  5. profit

Alternatively, just add some in manually if you just have two sequences and you don't need many indels. You can just randomly pick some positions.

I just updated the question. I had confused with indel and cigar string.i want to generate cigar string so that it explains alignment information better.

So in other words, you want to align two sequences and get the resulting CIGAR string? Are you aligning them manually or with a program. In the latter case, just use a program that will generate CIGAR strings. In the former case, you can just generate one yourself (CIGAR strings aren't exactly complicated things).

I align them using local alignment programs. Is there any program that just generates CIGAR? Generating CIGAR for small sequences is simple,but larger ones takes time.

Then use a local alignment program that will produce a CIGAR string (or at least something that you can then convert into one). Alternatively, if the programs output a formatted pairwise alignment, then just parse that (the only hard parts are the ends, which can be soft-clipped).

Log in to answer this question.