aligned reads count in a defined region of a genome

756 views
Skip to first unread message

xiaol...@gmail.com

unread,
Mar 30, 2022, 4:34:27 PM3/30/22
to igv-help
Hi, IGV community,

Is there a way to know the aligned reads count in a defined region of a genome?  For example, I have a genome of 9kb, I can load the sorted bam file and genome into IGV without problem, I would like to know how many mapped reads in the first 500bp of the genome, is there a way IGV could tell this information?

Best,

Xiao

igv-help

unread,
Mar 31, 2022, 2:47:50 PM3/31/22
to igv-help
No,  there is no way to do this with IGV.  

kpshgv

unread,
Mar 31, 2022, 9:25:07 PM3/31/22
to igv-...@googlegroups.com

There is indeed no way to do this in IGV directly, but from IGV you can export the reads in a certain region to a .sam file for each sample (right click on the alignment and select "export alignments") or all aligned samples to a .bed file (click on "Regions" in the menu bar and select "export regions"). The .sam files can then be converted to fasta files (e.g. by samtools fasta) and from that you can count the number of reads in the region. According to my friend "Google" there are also ways to convert the .bed file to fasta but I have not explored that further.

Let us know what method(s) work for you, because there might be others who would like to do similar things to analyse the alignment data.

Ciao,

Hugo

---
Hugo A. Volkaert
Center for Agricultural Biotechnology
Kasetsart University Kamphaengsaen Campus
Kamphaengsaen, Nakhonpathom
Thailand 73140
phone: +66 34353217
fax: +66 34353222


-------- Original Message --------

Subject: [SOCIAL NETWORK] [igv-help] Re: aligned reads count in a defined region of a genome
Date: 2022-04-01 01:47
From: igv-help <igv-...@googlegroups.com>
To: igv-help <igv-...@googlegroups.com>


--

---
You received this message because you are subscribed to the Google Groups "igv-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to igv-help+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/6b48cd93-3494-4a4f-8f88-b0427596b7e0n%40googlegroups.com.

Xiao Lei

unread,
Apr 1, 2022, 8:39:44 AM4/1/22
to igv-...@googlegroups.com
Hi, Hugo,

Thanks. From the info I received, I will not use IGV to do this kind of analysis. 

Xiao

You received this message because you are subscribed to a topic in the Google Groups "igv-help" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/igv-help/vk6oBbt96Gs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to igv-help+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/ef533117795a0292106e1c0e91228774%40nontri.ku.ac.th.

James Robinson

unread,
Apr 1, 2022, 11:29:46 AM4/1/22
to igv-...@googlegroups.com
Yes thanks Hugo.

I would recommend samtools for this.

xiaol...@gmail.com

unread,
Apr 10, 2022, 12:44:56 PM4/10/22
to igv-help
Hi, Hugo,

This is what I got from the IGB browser developer (Dr. Nowlan Freese), IGB browser could be used in this case although it seems tedious. 

Option 1:
Go to your region of interest in IGB.
Right-click on the track name and select Clear Data.
Now click the Load Data button.
Right-click on the track name again and select Save Track As...
Name the file and click Save.

The saved file will be a bed file that can be opened with any text editor (I use Sublime). You can also rename the file to .txt to open it if you have issues. Each line of the file should be a read, so the total number of lines will be the total number of reads for your region of interest.

Option 2:
Go to your region of interest in IGB.
Right-click on the track name and select Clear Data.
Now click the Load Data button.
Shift-click to select two of the reads in IGB.
Open the Selection Info tab.
Compare the reads to identify a common feature, for example, in my bam file each read has the same start to the name (HISEQ).
Open the Advanced Search tab.
Set the Search to Properties and search for the common name (such as HISEQ in my example).
The number of matches should be equal to the number of reads found.

Best,
Xiao

Reply all
Reply to author
Forward
0 new messages