This is a test version of Biostars. For the public version, visit https://www.biostars.org.
IGV with subset of bam file

Hi Biostars,

Is it possible to visualize only the subset of reads from a bam file using IGV?

Thanks,

EDIT:

Let's try to find completely universal way of doing this:

Is it possible to visualize only the subset of reads (1 mln random reads) from a bam file using IGV?

igv bam

from the original bam file I extract some reads, write them to a new file and want to visualize it.

Make a bed file with the regions you are interested in.

samtools view -bh -L regions.bed -o new.bam old.bam && samtools index new.bam

Then load new.bam into IGV.

Thanks, but I am interested in opposite thing - I want to find the regions where these particular reads are alligned to.

You can search for specific reads using the headers in IGV (as long as this is a small number). Is that you want want?

Then rephrase your original question, because "from the original bam file I extract some reads, write them to a new file and want to visualize it" is exactly what my command does.

well, I extract them not from the particular region of interest or the region that I know in advance.

Then how do you know that they ARE the reads of interest?

Edit: Looking at the edit of your original question that does not seem to be a requirement.

Is it possible to visualize only the subset of reads (1 mln random reads) from a bam file using IGV?

It should be possible to sample the BAM. Visualize as usual with IGV. Use reformat.sh in=original.bam out=subset.bam samplereadstarget=1000000 sampleseed=1000 from BBMap suite. Pay particular attention to SAM/BAM and sampling parameters.

0 answers

No answers yet.

Log in to answer this question.