Entering edit mode
6.3 years ago
kani.kanchan
▴
10
Hi Everyone,
I am trying to run a mysql query and save output into a text file. The command works fine for 10 SNPs and the output file has entries for all 10 SNPs, however when I try to run the same for large list (100 K) of SNPs the output file only contains the entry for the last SNP only.
My command -
for i in $(cat /path/to/directory/listofSNPs.txt); do echo "select chrom,chromStart+1,name,alleles from snp150 where (name= \"$i\")" | mysql -N --user=genome --host=genome-mysql.cse.ucsc.edu -A -P 3306 -D hg38 done > '/path/to/directory/output.txt'
I would appreciate any advice on how can I do this?
Thanks, Kanika
why don't you use A: Need help with getting chromosomal positions of SNPs (your previous question...)
I tried to run this command for some SNPs and the code works well. But when I ran it for larger list it run indefinitely.
If you have 100K queries then you need to account for that number. Surely your patience ran out before the queries completed.