use a input file to a mysql query to retrieve genomic coordinates from a list of genes
1
0
Entering edit mode
8.1 years ago
jfertaj ▴ 110

Hi, I have a really silly question but my brain is a bit lazy today, and google is not helping at all. I want to retrieve, using a mysql query, genomic coordinates from a list of genes, I already have the query to get the information I want:

mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg19 -P 3306   -e "select chrom,txStart,txEnd,name2 as name,strand,exonStarts,exonEnds from refGene;"

However how I use my file gene.list as an input to the mysql query?

genome bed • 1.7k views
ADD COMMENT
1
Entering edit mode
8.1 years ago
Zaag ▴ 870

Something along the lines of:

for i in $(cat gene.list) ; do echo "select chrom,txStart,txEnd,name2  from refGene where (name2=\"$i\")"  |\
mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -D hg19 -P 3306 > $i.out  ;
done ;
ADD COMMENT

Login before adding your answer.

Traffic: 1693 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6