i am mapping some long reads to the human transcriptome:
Each transcript in this reference is one sequence, and the ID contains the genomic location of the transcript.
After i map my reads to this reference, i would like to visualize the resulting bam file in IGV. For that to happen, i would probably need to convert the coordinates in the bam file to the hg38 coordinate system (which is given in the id of each transcript).
What would be the best approach to change the bam file? Bam -> Bed + convert coordinates -> Bam?
Or is there a more elegant way to parse the bam with pysam directly, change the coordinates on the fly (by looking at the reference transcript id and computing the new coordinates of the aligned read in the hg38 space) and write a resulting (new) bam file?