Question: Gene length database
1
gravatar for chloe.p.oconnell
4.8 years ago by
United States
chloe.p.oconnell80 wrote:

Hi, 

I'm trying to do a pathways/enrichment analysis and in order to do so, I'm trying to divide the prevalence of a variant in a gene by the length of the gene. Is there a database online where I can easily download gene lengths? I'm working with gene symbols (i.e. KCNQ2) so anything that matched the gene symbol to a length would be preferable. 

 

Thanks!

gene length database ncbi • 5.4k views
ADD COMMENTlink modified 3.0 years ago by anp375160 • written 4.8 years ago by chloe.p.oconnell80
1
gravatar for Pierre Lindenbaum
4.8 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum121k wrote:

using mysql/ucsc:

 

$ mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg19 -e 'select X.geneSymbol,K.name as transcript, K.chrom,K.txEnd-K.txStart as transcriptLen from kgXref as X,knownGene as K where X.geneSymbol="KCNQ2" and X.kgId=K.name '
+------------+------------+-------+---------------+
| geneSymbol | transcript | chrom | transcriptLen |
+------------+------------+-------+---------------+
| KCNQ2      | uc002yex.3 | chr20 |          1804 |
| KCNQ2      | uc002yey.1 | chr20 |         66452 |
| KCNQ2      | uc002yez.1 | chr20 |         66452 |
| KCNQ2      | uc002yfa.1 | chr20 |         66452 |
| KCNQ2      | uc002yfb.1 | chr20 |         66452 |
| KCNQ2      | uc002yfc.1 | chr20 |         38962 |
| KCNQ2      | uc011aax.1 | chr20 |         48707 |
+------------+------------+-------+---------------+

 

ADD COMMENTlink written 4.8 years ago by Pierre Lindenbaum121k

Hi Pierre, sorry for my stupid question. Here, you showed an example with single gene 'KCNQ2", right? Could you please tell me how to do this with a batch of gene, for example, if I have a file with the gene symbols? Can I put the mysql command in a loop to iterate over the gene symbols?

Thanks

ADD REPLYlink written 3.1 years ago by taniasultana20040

remove the statement ' X.geneSymbol="KCNQ2" and'

ADD REPLYlink written 3.1 years ago by Pierre Lindenbaum121k
1
gravatar for Alex Reynolds
4.8 years ago by
Alex Reynolds28k
Seattle, WA USA
Alex Reynolds28k wrote:

You might look up the RefSeq accession and version name:

$ wget ftp://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/RefSeqGene/gene_RefSeqGene
...
$ grep 'KCNQ2' gene_RefSeqGene
9606    3785    KCNQ2   NG_009004.1

Then look up the alignment:

$ wget ftp://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/RefSeqGene/GCF_000001405.26_refseqgene_alignments.gff3
...
$ grep 'NG_009004.1' GCF_000001405.26_refseqgene_alignments.gff3
NC_000020.11    RefSeq  match   63404189        63477640        73452   +       .       ID=aln1679;Target=NG_009004.1 1 73452 -;bit_score=136701;e_value=0;gap_count=0;num_ident=73452;num_mismatch=0;pct_coverage=100;pct_identity_gap=100;pct_identity_gapopen_only=100;pct_identity_ungap=100;score=73452

The accession NC_000020.11 tells you KCNQ2 is mapped to chromosome 20 at bases 63404189 to 63477640. Note that this alignment is to assembly hg38, which you may or may not be using:

https://genome.ucsc.edu/cgi-bin/hgTracks?db=hg38&position=chr20%3A63404189-63477640

 

ADD COMMENTlink modified 4.8 years ago • written 4.8 years ago by Alex Reynolds28k

Is it possible to do this in python?

ADD REPLYlink written 4.8 years ago by chloe.p.oconnell80

There is a library to wget in python. You can do regular expressions in python with re. Pierre's answer is better, probably.

ADD REPLYlink modified 4.8 years ago • written 4.8 years ago by Alex Reynolds28k
0
gravatar for Devon Ryan
4.8 years ago by
Devon Ryan91k
Freiburg, Germany
Devon Ryan91k wrote:

I've not seen a convenient database of this (this isn't usually stored explicitly), but you can determine this given an annotation file easily enough. Here's an example of how to do that (and a bit more) in R: A: Normalization Of Rna Sequencing Counts (By Ercc / Gene Length)

ADD COMMENTlink written 4.8 years ago by Devon Ryan91k
0
gravatar for EagleEye
3.1 years ago by
EagleEye6.4k
Sweden
EagleEye6.4k wrote:

A: Length of transcripts of mm9

ADD COMMENTlink written 3.1 years ago by EagleEye6.4k
0
gravatar for anp375
3.0 years ago by
anp375160
anp375160 wrote:

This was a long, complicated, and tiring process. Getting the variant density is annoying as well if you don't know how to use R very efficiently. I'm just about done with it. If I'm allowed to later, I will post the methods up. However, if you don't care about distinguishing regions that are intron/exon/UTR/coding/etc., then just look at the gtf. Extract the whole genes. If you want a specific region, you'll have to extract that type and concatenate the results from the gtf. If you're dealing with targeted sequencing, then the process is more complicated.

ADD COMMENTlink written 3.0 years ago by anp375160

Hi, If you don't mind how can I extract the UTRs sequences using R?

ADD REPLYlink written 9 days ago by ezraamustafa30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1973 users visited in the last hour