I can run the following code in bash from my terminal.
$ samtools index --bai my.bam --output my.bai
However, when I attempt to run the same command from os.system()
cmd_sam = "samtools index --bai my.bam --output my.bai"
os.system(cmd_sam)
# index: invalid option -- '-'