#!/bin/bash

set -ueo pipefail

BCFTOOLS=/gscmnt/gc2719/halllab/bin/bcftools
TABIX=/gscmnt/gc2719/halllab/bin/tabix

INVCF=$1
OUTVCF=$2

if [ -e $OUTVCF ]
then
    exit 0
fi

TMPVCF=$OUTVCF.temp
zcat $INVCF | awk '$5!="<*:DEL>" && $5!="*"' | bgzip -c > $TMPVCF \
    && ${TABIX} -p vcf -f $TMPVCF && mv $TMPVCF.tbi $OUTVCF.tbi && mv $TMPVCF $OUTVCF

#!/bin/bash

set -ueo pipefail

BCFTOOLS=/gscmnt/gc2719/halllab/bin/bcftools
TABIX=/gscmnt/gc2719/halllab/bin/tabix

INVCF=$1
OUTVCF=$2

if [ -e $OUTVCF ]
then
    exit 0
fi

TMPVCF=$OUTVCF.temp
${BCFTOOLS} view -e '%TYPE="other"' $INVCF --output-type z --output-file $TMPVCF \
    && ${TABIX} -p vcf -f $TMPVCF && mv $TMPVCF.tbi $OUTVCF.tbi && mv $TMPVCF $OUTVCF

Revert "switch to awk to handle both <*:DEL> AND * ALT alleles"
Revert "switch to awk to handle both <*:DEL> AND * ALT alleles"

This reverts commit bac7e1f44603d723730d56fd27c416220c11f282.
