Question: bed file with indels and SNVs
0
gravatar for joselu
12 months ago by
joselu90
joselu90 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 • 494 views
ADD COMMENTlink modified 12 months ago • written 12 months ago by joselu90

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 12 months ago by finswimmer12k
  1. Down load dbsnp chromosome 6 records
  2. Use bedops vcf2bed function to convert vcf to bed
ADD REPLYlink written 12 months ago by cpad011212k

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

ADD REPLYlink written 12 months ago by joselu90

ok. Solved. Thanks everybody.

ADD REPLYlink written 12 months ago by joselu90

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 12 months ago by genomax71k
1
gravatar for Alex Reynolds
12 months ago by
Alex Reynolds28k
Seattle, WA USA
Alex Reynolds28k 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 12 months ago • written 12 months ago by Alex Reynolds28k
1
gravatar for finswimmer
12 months ago by
finswimmer12k
Germany
finswimmer12k wrote:

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

ADD COMMENTlink written 12 months ago by finswimmer12k

Please move it to answer finswimmer.

ADD REPLYlink written 12 months ago by cpad011212k

OK. Thank you very much!!

ADD REPLYlink written 12 months ago by joselu90
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: 1973 users visited in the last hour