I want to write a bash script that reads in a BAM file and performs several processing steps with that input file.
Can you recommend some ideas to write such a script? I am a beginner and would be very happy for some input. We want to extract mapped and unmapped reads of the BAM files. I have already written the commands for these purposes, but I don't know how to write such a read in function. Otherwise, I would have to type in all commands again and again for each BAM file.