use a input file to a mysql query to retrieve genomic coordinates from a list of genes
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?
• 2,059 views
•
link
1 answer
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 ;
• 0 views
•
link
Log in to answer this question.