To make a long story short, I have a bam file that is aligned to the human reference plus a specific contig (human gene + viral vector introduced into a mouse).  

The fasta file that was used for alignment got inadvertently deleted, but I have good coverage across the contig.  Is there a straightforward way to use the reads aligning to that contig to recreate the contig's fasta file?  (All the info should be there!)
Although reassembly seems the preferred option I thought if Pilon which polishes a  reference with standard illumina reads could work . Just for fun I tried following with an ecoli MG1655 bam file. 

 - Got the length and name of reference chromosome from bam header (in this case only one) 
 - Created a fake reference with the same name and same number of nucleotides (but all nucleotides were A ; I tried with N and it did not work) 
 - Then use [pilon][1]  and gave the input bam and the fake reference (composed of all A nucleotides) ( I gave as a single end bam but paired should produce better results) 

-  Pilon generated a fasta (pilon.fasta default name)
-  Ran blast2sequence (NCBI;Online) with actual ecoli MG1655 genome) 
-  Following were the results (99% coverage and 99% identity) 
-  Dot Plot (https://ibb.co/ifFzjS)

<a href="https://ibb.co/ifFzjS"><img src="https://preview.ibb.co/cPtVr7/two.png" alt="two" border="0" /></a>
-  Alignment details (https://ibb.co/hNCejS)
<a href="https://ibb.co/hNCejS"><img src="https://preview.ibb.co/n0yKjS/one.png" alt="one" border="0" /></a>


  [1]: https://www.broadinstitute.org/gaag/pilon
  [2]: https://ibb.co/ifFzjS