As of May 31, 2023, we have updated our Code of Conduct.

Hot answers tagged

19 votes
Accepted

Converting a BAM file into VCF

It's not really possible to convert bam to vcf. bam is a mapping file, it does not contain ...
Kamil S Jaron's user avatar
16 votes
Accepted

What's the difference between VCF spec versions 4.1 and 4.2?

This is easy to check, you can download both specs in .tex format and do diff. Changes to the v4.2 compared to v4.1: Information field format: adding source and ...
Iakov Davydov's user avatar
13 votes

How to subset samples from a VCF file?

Bcftools has sample/individual filtering as an option for most of the commands. You can subset individuals by using the -s or -S ...
gringer's user avatar
  • 13k
11 votes
Accepted

How to concatenate "by chromosome"-VCFs?

I would recommend bcftools concat. You can't just cat them together because each file has a header section. The bcftools command will handle all that for you. ...
Bioathlete's user avatar
  • 2,574
9 votes

Is there an easy way to create a summary of a VCF file (v4.1) with structural variations?

According to the bcftools man page, it is able to produce statistics using the command bcftools stats. Running this myself, the ...
gringer's user avatar
  • 13k
9 votes

Tools to create annotated table of variants from VCF

Hail might be an option for you. It is actively developed by a growing team at the Broad. It is rigorously tested (continuous integration, continuous deployment, bug reports get regression tests, ...
Cotton Seed's user avatar
9 votes
Accepted

Are variant calling files personally identifiable information?

TLDR: yes! be careful with someone's genomic data! There are two aspects to this question: can I find a match for a random VCF in a database of genomes (YES) or can I identify a subject who is not in ...
Wouter De Coster's user avatar
8 votes
Accepted

GRCh38 vcf file with common cancer mutations

Your question doesn't give enough information for a specific answer but this should do for a start. Get the VCF file describing all variants in Clinvar from NCBI: ...
terdon's user avatar
  • 9,352
8 votes
Accepted

How to read structural variant VCF?

I just received a reply from 1000Genomes regarding this. I'll post it in its entirety below: Looking at the example you mention, I find it difficult to come up with an interpretation of the ...
Devon Ryan's user avatar
  • 19.5k
8 votes

GRCh38 vcf file with common cancer mutations

If you are looking for cancer mutations, the primary resource is COSMIC and they provide GRCh38 VCFs. The download page is here: http://cancer.sanger.ac.uk/cosmic/download It'll be up to you how you ...
burger's user avatar
  • 2,139
8 votes
Accepted

Using Python, how to convert a pandas DataFrame into a VCF?

You will have to define the header either from an existing VCF file or hardcoded into you python script. Then write the header the the output VCF file then write the dataframe to the same file with ...
Bioathlete's user avatar
  • 2,574
8 votes

ethnicity check either from bam or vcf files

The main difficulty here is the use of GRCh38. Unfortunately, despite the fact that it's more than four years old, the major ethnicity-labeled public datasets (1000 Genomes, gnomAD when allele ...
Christopher Chang's user avatar
8 votes
Accepted

How to subset a VCF by chromosome and keep the header?

This seems to work for me with bcftools filter and the -r or -R argument. ...
gringer's user avatar
  • 13k
8 votes
Accepted

Converting VCF file to PLINK bed/bim/fam files

Given that Plink reads in VCF files natively, and Plink is your desired output format, I expect that plink --vcf <file> would be the best option. As mentioned ...
gringer's user avatar
  • 13k
8 votes

Are variant calling files personally identifiable information?

Yes, definitely identifiable. The combination of ~80 unlinked common SNPs can be fairly unique in the entire human population, let alone the whole VCF file. EDIT: 30 in the original answer is an ...
user172818's user avatar
  • 6,295
7 votes

How to manipulate a reference FASTA or bam to include variants from a VCF?

GATK has a solution that might work for you: FastaAlternateReferenceMaker, which : "Given a variant callset, this tool replaces the reference bases at variation sites with the bases supplied in the ...
Greg's user avatar
  • 841
7 votes
Accepted

Given a VCF of a human genome, how do I assess the quality against known SNVs?

To achieve (at least some of) your goals, I would recommend the Variant Effect Predictor (VEP). It is a flexible tool that provides several types of annotations on an input .vcf file. I agree that ...
Kevin's user avatar
  • 366
7 votes
Accepted

How to represent a deletion at position 1 in a VCF file?

From the latest VCF specs (page 8): REF - reference base(s): Each base must be one of A,C,G,T,N (case insensitive). Multiple bases are permitted. The value in the POS field refers to the position of ...
Emily_Ensembl's user avatar
7 votes
Accepted

Are duplicate variants against the VCF standard?

No. The only point the specification makes is that: It is permitted to have multiple records with the same POS I suspect this is intended to let the file list different variants occurring at the ...
Migwell's user avatar
  • 360
7 votes
Accepted

How is the GT field in a VCF file defined?

You can get most of the info from this paper. See Fig. 1 and the surrounding text. Quoting from there, "GT, genotype, encodes alleles as numbers: 0 for the reference allele, 1 for the first ...
Timur Shtatland's user avatar
7 votes

Extract lines from a file based on a range of coordinates listed on a second file

If you have a VCF file with an intact header, you can use bcftools for this. All you need to do first is to bgzip and index your VCF: ...
Steve's user avatar
  • 2,714
6 votes
Accepted

Is there an easy way to create a summary of a VCF file (v4.1) with structural variations?

The "my own parser" solutions. The information I was searching for in part of column INFO, namely in variables SVLEN ...
Kamil S Jaron's user avatar
6 votes

How to check if indels in VCF files are left or right aligned?

One possibility is to run bcftools norm on the file. At the end it will print out a statistic about how many variants were realigned. I did this for dbSNPv151 (GRCh38) only for chromosome 22 like this:...
finswimmer's user avatar
  • 1,332
6 votes
Accepted

Fix dash/empty ALT alleles for deletions in VCF

According to the specs the ALT is not allowed to contain -. While technically supported, 'N' as the alternative allele is sometimes used unnecessarily and this ...
finswimmer's user avatar
  • 1,332
5 votes

Given a VCF of a human genome, how do I assess the quality against known SNVs?

The greatest protein coding variant catalogue is definitely ExAC (>65k individuals). They also published a blogpost where they describe how to reproduce figures in the paper (it is a good start how to ...
Kamil S Jaron's user avatar
5 votes
Accepted

How do I carry out an ancestry/admixture test on a single VCF file?

A modified implementation of Vivek's answer. peddy is a Python package that samples an input .vcf at ~25000 sites and projects onto a principal component space ...
Kevin's user avatar
  • 366
5 votes

How to convert the .vcf (imputed) file with GT:GP format to GT:DS?

You can do this in Hail. Here's the rough code to do it (0.1 versions). Setup: from hail import * hc = HailContext() Import the .gen file. VCF works too: <...
Tim's user avatar
  • 151
5 votes

How can I extract only insertions from a VCF file?

Just to highlight that all the steps can be done within bcftools capabilities, and since I can't just comment on @blmoore 's answer: ...
JRodrigoF's user avatar
  • 705
5 votes

Selecting sites from VCF which have an alt AD > 10

using vcfilterjs and the following script: ...
Pierre's user avatar
  • 1,481
5 votes
Accepted

Tools to create annotated table of variants from VCF

I have used FEATnotator and I think it can provide all of the columns you would like to see. There are many output files generated, but the consolidated output has the following columns: Chromosome ...
dkainer's user avatar
  • 128

Only top scored, non community-wiki answers of a minimum length are eligible