Created
December 8, 2015 14:17
-
-
Save sgsfak/dae8be3cbf03902d3f21 to your computer and use it in GitHub Desktop.
Downloads the UniGene data from NCBI, parses them with awk to get the information about the UniGene cluster, the gene symbol and Entrez Gene identifier, and the Genbank sequences
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| wget ftp://ftp.ncbi.nih.gov/repository/UniGene/Homo_sapiens/Hs.data.gz | |
| gunzip Hs.data.gz | |
| <Hs.data awk -v OFS=',' 'BEGIN { print "unigene_id", "gene_id", "symbol", "gb_acc"} | |
| /^ID /{ug=$2} | |
| /^GENE_ID /{eg=$2} | |
| /^GENE /{s=$2} | |
| /^SEQUENCE /{ | |
| sub("ACC=", "", $2); | |
| sub(";", "", $2); | |
| print ug, eg, s, $2}' > Hs.data.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment