Situation:
refA.fasta one reference sequence
refB.fasta a different reference sequence
A.bam one type of reads mapped against the first reference
B.bam another type of reads mapped against the 2nd ref
Some time after these are constructed one discovers that the sequences in refA and refB overlap and can be merged to refC, with one or at most two cut and splice operations. For the sake of a specific example, let's say that refA is 10kb long, refB is 12kb long, and base 1 of refA is the same as base 1000 of refB, with refA in the opposite orientation (because it will be, half the time) and that there are no base changes in the shared region.
refC.fasta can be constructed with any number of tools.
How though, does one merge the bam files? It would seem to require the application of "invert" and "offset" operators to one of the bam files, and only then the use of the existing "merge". However neither "invert" nor "offset" seem to exist in samtools, notably, they are not in "view" which is where I would have put them.
Does some other piece of software have this option?
You would be better off by 1) first get the fastq from individual bams, say A.fastq and B.fastq 2) merge and align these fastq to the new reference refC.fasta