This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to convert dnsnp in UCSC to gtf

Hi,

I am trying to use a software require full dbsnp annotation from UCSC with gtf format.

The uscs table browser offer a online server, so that we can export its with gtf format, but Its not work when file size is large

I also try to download dbsnp from UCSC, eg: https://hgdownload.cse.ucsc.edu/goldenpath/hg38/database/snp151.txt.gz, and convert it by genePredToGtf, but its also not work because of

invalid unsigned integer: "A"

So, how can I get the gtf format dbsnp data from UCSC?

ucsc dnsnp gtf

Gtf is usually for genes. It’s not a very efficient solution for SNPs. Which software requires gtf for SNPs ?

REDItools, a software for detect RNA editing, see: https://github.com/BioinfoUNIBA/REDItools/blob/master/README_1.md#filtertablepy for more detail

1 answer

genePredToGtf cannot work, as it convertes the genePred format to GTF so the input must be in genePred format. The dbSNP tables are not in genePred format as they are not gene predictions. GTF is a bad match for this type of data, REDItools made a weird choice, as GTF has fields for exons and frames that don't make sense for SNPs. Either way you can use awk to convert the file to a very bare-bones GTF file which is probably good enough for this software:

curl -s https://hgdownload.cse.ucsc.edu/goldenpath/hg38/database/snp151.txt.gz | zcat | awk '{OFS="\t"; print ($2,"ucsc", "snp", $3,$4, "1", "+", "0", "")}' > snp151.gtf

Its seems work, Thanks for help, I also think that using GTF format to complete these filtering steps is strange, so I am considering whether to write a program to use VCF or BED files to perform the filtering work on the results.

Log in to answer this question.