Hello. How can I get a bed file with IDs of indels and SNVs from chromosome 6 of hg38? I need it to use it in IGV.
Hello. How can I get a bed file with IDs of indels and SNVs from chromosome 6 of hg38? I need it to use it in IGV.
One way to get common SNPs, assuming sufficient disk space:
$ wget -qO- ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606_b151_GRCh38p7/VCF/common_all_20180418.vcf.gz | gunzip -c - > snps.vcf
Or all SNPs:
$ wget -qO- ftp://ftp.ncbi.nih.gov/snp/organisms/human_9606_b151_GRCh38p7/VCF/All_20180418.vcf.gz | gunzip -c - > snps.vcf
Either option will likely need a fair bit of disk space. The common subset will use less space.
Convert the VCF to BED, separating by variant classes, assuming 8GB of available system memory for sorting:
$ vcf2bed --insertions --max-mem=8G --sort-tmpdir=${PWD} < snps.vcf > snps.insertions.bed
$ vcf2bed --deletions --max-mem=8G --sort-tmpdir=${PWD} < snps.vcf > snps.deletions.bed
$ vcf2bed --snvs --max-mem=8G --sort-tmpdir=${PWD} < snps.vcf > snps.snvs.bed
Then extract a chromosome of interest from the BED files via a fast binary search:
$ bedextract chr6 snps.insertions.bed > snps.insertions.chr6.bed
$ bedextract chr6 snps.deletions.bed > snps.deletions.chr6.bed
$ bedextract chr6 snps.snvs.bed > snps.snvs.chr6.bed
This assumes UCSC chromosome naming scheme. This may or may not be the case depending on where you get your SNPs from. Replace chr6
with plain ole 6
if using NCBI as the source, as in the example wget
calls shown above.
You can get a bed
file of dbSNP for each chromosome directly on the ftp server.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Hello joselu ,
and where should these data come from? Do you have a
vcf
of your sample and want to convert it to abed
? You like to take data from a (public) database like dbSNP?Please add some more information to your question.
And BTW: IGV can visualize
vcf
as well.fin swimmer
ok. Please, Can you specify how I download all records of chromosome 6 in dbSNP? Than you.
ok. Solved. Thanks everybody.
Hello joselu ,
If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one if they work.
Please do the same for your previous posts as well.