Skip to content

Instantly share code, notes, and snippets.

@wbgalvao
wbgalvao / hg38_to_hg19.py
Last active August 14, 2020 18:07
Transform .bed files genomic coordinates from hg38 to hg19
import os
import sys
import pandas as pd
from pyliftover import LiftOver
target = sys.argv[1]
@wbgalvao
wbgalvao / fix-multianno-header.sh
Created August 13, 2020 18:10
Given a multianno file (annovar's output) fix its header by adding the vcf columns (CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO, FORMAT and SAMPLE)
#!/bin/bash
multianno=${1}
header=$(head -1 ${multianno})
fixedHeader=$(echo "${header}" \
| sed 's/Otherinfo/VCF_CHROM/' \
| awk '{print $0"\tVCF_POS\tVCF_ID\tVCF_REF\tVCF_ALT\tVCF_QUAL\tVCF_FILTER\tVCF_INFO\tVCF_FORMAT\tVCF_SAMPLE"}' \
)