Question: bed file with indels and SNVs
0
gravatar for joselu
5 months ago by
joselu60
joselu60 wrote:

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.

snp bed • 361 views
ADD COMMENTlink modified 5 months ago • written 5 months ago by joselu60

Hello joselu ,

and where should these data come from? Do you have a vcf of your sample and want to convert it to a bed? 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

ADD REPLYlink written 5 months ago by finswimmer11k
  1. Down load dbsnp chromosome 6 records
  2. Use bedops vcf2bed function to convert vcf to bed
ADD REPLYlink written 5 months ago by cpad011211k

ok. Please, Can you specify how I download all records of chromosome 6 in dbSNP? Than you.

ADD REPLYlink written 5 months ago by joselu60

ok. Solved. Thanks everybody.

ADD REPLYlink written 5 months ago by joselu60

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.
Upvote|Bookmark|Accept

Please do the same for your previous posts as well.

ADD REPLYlink written 5 months ago by genomax63k
1
gravatar for Alex Reynolds
5 months ago by
Alex Reynolds27k
Seattle, WA USA
Alex Reynolds27k wrote:

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.

ADD COMMENTlink modified 5 months ago • written 5 months ago by Alex Reynolds27k
1
gravatar for finswimmer
5 months ago by
finswimmer11k
Germany
finswimmer11k wrote:

You can get a bed file of dbSNP for each chromosome directly on the ftp server.

ADD COMMENTlink written 5 months ago by finswimmer11k

Please move it to answer finswimmer.

ADD REPLYlink written 5 months ago by cpad011211k

OK. Thank you very much!!

ADD REPLYlink written 5 months ago by joselu60
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1615 users visited in the last hour