How can we extract all snps associated to a gene from 1000 genome browser using plink???
Hello! I am using plink from https://www.cog-genomics.org/plink2/ I would like to extract all genes from chr1 to different gene files (each file is the data of one gene). I write a loop for --from-bp and --to-bp according to the pos of different gene. Each time I run command (for example)
plink --vcf chr1.vcf.gz --keep keep_indv --chr 1 --from-bp 76291501 --to-bp 76294500 --recode A --maf 0.000000001 --geno 0.2 --out chr1_MSH4.
But I found it is too slow. Each time, plink loads all variants and then extract the gene I want. Is there a way to extract all genes at one time and write them into separate files?
1 answer
It might be better to have all the genes in a bed-files, extract the genes as per their location, and then split the files according to your need. This would involve the use of bedtools getfasta (or) seqtk subseq, followed by split with kent-utils faSplit (or) GenomeThreader splitfasta
Log in to answer this question.