IGV with subset of bam file
0
0
Entering edit mode
7.5 years ago

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 • 2.7k views
ADD COMMENT
0
Entering edit mode

what do you mean with "subset" ?

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

yeah, but there are a couple of million reads:)

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 1939 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6