One simple way to make the alignment file satisfying RSEM's requirements (assuming the aligner used put mates in a paired-end read adjacent) is to use 'convert-sam-for-rsem' script. This script only accept SAM format files as input. If a BAM format file is obtained, please use samtools to convert it to a SAM file first.
There is an inconsistency between RSEM online documentation and the binary utility man page for convert-sam-for-rsem.
The RSEM website documentation for rsem-calculate-expression says that
convert-sam-for-rsem
only accepts SAM format:however, the man page obtained via:
./convert-sam-for-rsem -h
says that BAM or SAM is allowed.