text: user13909: I need some help getting started on this project.
  To simplify we want to be able to quantify the occurrence of 3 variants on each sequencing read in an alignment file as a proxy measurement for recombination.
  The possible combinations we have are A, B or AB.
  For example, variant A is at position 100 and variant B is at position 300 of the reference and AB would have both.
  We have alignment files against a reference sequence, and then I get stuck. I could technically look by eye in tablet or IGV for example but is there a way to extract each read then query by expected base at the reference position then bin these reads into the categories; A, B, AB and unclassified then calculate the total occurrences of each?
  Thanks for your time and suggestions!
  
  user2108: Related question: Access base aligned to particular reference position
  After an initial effort posted here, I ended up rewriting this and testing it a little, and posted the script here. It still has some drawbacks (handling indels intelligently) but now it more or less works.
  
original_text: 13909: <p>I need some help getting started on this project.</p>
  <p>To simplify we want to be able to quantify the occurrence of 3 variants on each sequencing read in an alignment file as a proxy measurement for recombination.</p>
  <p>The possible combinations we have are A, B or AB.</p>
  <p>For example, variant A is at position 100 and variant B is at position 300 of the reference and AB would have both.</p>
  <p>We have alignment files against a reference sequence, and then I get stuck. I could technically look by eye in tablet or IGV for example but is there a way to extract each read then query by expected base at the reference position then bin these reads into the categories; A, B, AB and unclassified then calculate the total occurrences of each?</p>
  <p>Thanks for your time and suggestions!</p>
   2108: <p>Related question: <a href="https://bioinformatics.stackexchange.com/questions/7401/access-base-aligned-to-particular-reference-position">Access base aligned to particular reference position</a></p>
  <p>After an initial effort posted here, I ended up rewriting this and testing it a little, and posted the script <a href="https://github.com/maximilianpress/teaching_code/blob/master/variant_cooccurrence.py" rel="nofollow noreferrer">here</a>. It still has some drawbacks (handling indels intelligently) but now it more or less works.</p>
  