I have to write BAM files my group can use for testing.
I need to write files that have read alignments with various combinations of bit flags, quality scores, and so on. My plan is to use an existing set of BAM files, read in the data, and then extract examples I can use "as is" or modify slightly to get what I want.
Has anyone done this type of thing and if yes, what tool(s) would you recommend I look at?
If no such simple tool already exists, can you recommend a python library for reading and writing BAM files?
If I need to write something myself to do this, I would prefer to use python because I'm comfortable with python and like the interactive interpreter, but perl (second choice) or some other easy-to-script language would be fine.