This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to extract regions from BAM file on remote server and visualize long-read alignments in IGV?

Hello, I have code that indicates there are a number of SNP mutations at specific locations for different cell types and none for others. I need to align all the respective long reads at that coordinate to see if my code works. These BAM files are located on a remote server and are too large for me to download them locally to my computer. I am really stuck, can anyone help me out? It is my first time doing this and I've never used IGV before. Happy to answer any questions that might help clarify what I need.

bam igv

1 answer

if the remote server supports random access, you can use "load from URL": https://software.broadinstitute.org/software/igv/LoadData

otherwise, you could download only a part of the bam:

wget -O - "http://path/to/in.bam" | samtools view -O BAM -o subset.bam -L regions.bed && samtools index  subset.bam

Sorry to be a noob, but what does the -L region.bed do? As in could you provide an example? I feel in over my head.

Log in to answer this question.