I am sorry about leaving out code, I was confused by the discourse format and wasn't sure how my text would show up in a new topic as opposed to a new post (one and the same I see). Also, the BioTutorial is helpful, although it doesn't seem to have an example of BAMWriter usage in there.
What I intended to post after my topic was put up:
"I'm a big fan of Julia and Bio.jl but as a biologist sometimes I need a little example code to get me started. I have successfully been able to read and write files, including reading BAM files, but writing BAM files has stumped me. How does one "wrap with a BGZFStream object provided from BGZFStreams.jl", and when opening the file with the BAMWriter, where does the SAM header come into play?
Thank you for your help! My current sorry state of pseudo-code below (rough outline to illustrate):"
stream = BGZFStream("aNewBamFile.bam")
writer = open(BGZFStream(BAMWriter), SAMHeader)