Good Afternoon Rich: Here are two different methods of fetching a genePred table from UCSC and converting it to a GTF file. This assumes you have the kent source utility: genePredToGtf. Most of the UCSC gene tracks are genePred tables and require a conversion to GTF.
>From the database text dump file for the refGene track: (the 'cut -f2-' eliminates the 'bin' column from the database table) wget --timestamping -O /dev/stdout \ 'ftp://hgdownload.cse.ucsc.edu/goldenPath/mm9/database/refGene.txt.gz' \ | gunzip -d | cut -f2- | genePredToGtf file stdin stdout \ | sort -k1,1 -k4,4n > mm9.refGene.gtf Or, directly from the public MySQL server, assuming you have your $HOME/.hg.conf file set to use the public MySQL server: genePredToGtf mm9 refGene stdout | sort -k1,1 -k4,4n > mm9.db.refGene.gtf Therefore, given a database, i.e. mm9, and a genePred table name, i.e. refGene, you can use either of these command line operations to fetch the GTF file. --Hiram > Hi there , is there anyway to download gtf files off the ucsc site > without the table browser like with a tool like wget? > I am running things from the command line. I would like to automate the > downloading of gtf files every few months and write a cron job but can't > seem to find a way . I also looked into connecting to ucsc via mysql but > that didn't seem to work either . Any suggestions you have are > appreciated. > Thanks > -Rich _______________________________________________ Genome maillist - [email protected] https://lists.soe.ucsc.edu/mailman/listinfo/genome
