Skip to content

Instantly share code, notes, and snippets.

@Fnyasimi
Fnyasimi / BCFtools cheat sheet
Created January 10, 2023 20:08 — forked from elowy01/BCFtools cheat sheet
BCFtools cheat sheet
*bcftools filter
*Filter variants per region (in this example, print out only variants mapped to chr1 and chr2)
qbcftools filter -r1,2 ALL.chip.omni_broad_sanger_combined.20140818.snps.genotypes.hg38.vcf.gz
*printing out info for only 2 samples:
bcftools view -s NA20818,NA20819 filename.vcf.gz
*printing stats only for variants passing the filter:
bcftools view -f PASS filename.vcf.gz
#! /usr/bin/env Rscript
suppressWarnings(suppressMessages(library(dplyr)))
fn_remove_ver_from_names = function(df)
{
ind = substr(names(df),1,4) == "ENSG"
names(df)[ind] = substr(names(df)[ind],1,15)
df
}