Help with getting data about the gene size distribution
Hi,
I need to find the gene length distributions for multiple organisms. Can someone suggest me possible ways to get the information.
Ravi
• 2,189 views
•
link
1 answer
Grab gene annotations for your organism of interest, and get them into BED format with convert2bed. For example, here are recent (GRCh38) human annotations via GENCODE:
$ wget -qO- ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/release_21/gencode.v21.annotation.gff3.gz \
| gunzip --stdout - \
| awk '$3 == "gene"' \
| convert2bed -i gff - \
> genes.bed
Then map genes against themselves to get their lengths. For instance, with bedmap:
$ bedmap --exact --bases genes.bed > gene_lengths.txt
Or with awk:
$ awk '{print $3-$2;}' genes.bed > gene_lengths.txt
The file gene_lengths.txt can be brought into R or similar to make a histogram:
$ R
...
> d <- read.table("gene_lengths.txt", col.names=c("lengths"))
> hist(d$lengths)
• 0 views
•
link
Log in to answer this question.
Do you have annotations available for all the organisms of your interest ?
You can directly query ucsc genome browser. I mentioned a mysql command in this post How To Get A List Of All Human Genes Above A Certain Length.