Skip to content

Commit

Permalink
Remove use of the file command (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwalker174 authored Jul 26, 2023
1 parent 12e4562 commit a35ad88
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ if ! [ -s ${PESR} ]; then
usage
exit 0
fi
if [ $( file ${PESR} | fgrep "gzip" | wc -l ) -lt 1 ]; then
echo -e "\nERROR: input PESR VCF must be bgzipped\n"
usage
exit 0
fi
if [ -z ${RD} ]; then
echo -e "\nERROR: input RD VCF not specified\n"
usage
Expand All @@ -71,11 +66,6 @@ if ! [ -s ${RD} ]; then
usage
exit 0
fi
if [ $( file ${RD} | fgrep "gzip" | wc -l ) -lt 1 ]; then
echo -e "\nERROR: input RD VCF must be bgzipped\n"
usage
exit 0
fi
if [ -z ${OUT} ]; then
echo -e "\nERROR: path to output VCF not specified\n"
usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ if ! [ -s ${INVCF} ]; then
usage
exit 0
fi
if [ $( file ${INVCF} | fgrep "gzip" | wc -l ) -lt 1 ]; then
echo -e "\nERROR: input VCF must be bgzipped\n"
usage
exit 0
fi
if [ -z ${OUT} ]; then
echo -e "\nERROR: path to output BED not specified\n"
usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ if ! [ -s ${INVCF} ]; then
usage
exit 0
fi
if [ $( file ${INVCF} | fgrep "gzip" | wc -l ) -lt 1 ]; then
echo -e "\nERROR: input VCF must be bgzipped\n"
usage
exit 0
fi
if [ -z ${OUTVCF} ]; then
echo -e "\nERROR: path to output VCF not specified\n"
usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ if ! [ -s ${INVCF} ]; then
usage
exit 0
fi
if [ $( file ${INVCF} | fgrep "gzip" | wc -l ) -lt 1 ]; then
echo -e "\nERROR: input VCF must be bgzipped\n"
usage
exit 0
fi
if [ -z ${OUTVCF} ]; then
echo -e "\nERROR: path to output VCF not specified\n"
usage
Expand Down
8 changes: 2 additions & 6 deletions src/sv-pipeline/scripts/vcf_qc/collectQC.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,8 @@ if ! [ -e ${OUTDIR}/data ]; then
fi
cd ${QCTMP}
mkdir ${QCTMP}/perSample
#Unzip VCF, if gzipped
if [ $( file ${VCF} | fgrep " gzip " | wc -l ) -gt 0 ]; then
zcat ${VCF} > ${QCTMP}/input.vcf
else
cp ${VCF} ${QCTMP}/input.vcf
fi
#Unzip VCF
zcat ${VCF} > ${QCTMP}/input.vcf
#Gather SV types to process
cut -f1 ${SVTYPES} | sort | uniq > ${QCTMP}/svtypes.txt

Expand Down
8 changes: 2 additions & 6 deletions src/sv-pipeline/scripts/vcf_qc/collectQC.vcf_wide.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,8 @@ if ! [ -e ${OUTDIR}/data ]; then
mkdir ${OUTDIR}/data
fi
mkdir ${QCTMP}/perSample
#Unzip VCF, if gzipped
if [ $( file ${VCF} | fgrep " gzip " | wc -l ) -gt 0 ]; then
zcat ${VCF} > ${QCTMP}/input.vcf
else
cp ${VCF} ${QCTMP}/input.vcf
fi
#Unzip VCF
zcat ${VCF} > ${QCTMP}/input.vcf
#Gather SV types to process
cut -f1 ${SVTYPES} | sort | uniq > ${QCTMP}/svtypes.txt

Expand Down
6 changes: 2 additions & 4 deletions src/sv-pipeline/scripts/vcf_qc/compare_callsets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ fi
###PREP INPUT FILES
OVRTMP=`mktemp -d`
#Unzip SET1, if gzipped, restrict to contigs in $CONTIGS, rewrite non-conventional SVTYPES, and automatically set SVs with size <1 to 1
if [ $( file ${SET1} | fgrep " gzip " | wc -l ) -gt 0 ] || \
[ $( echo ${SET1} | awk -v FS="." '{ if ($NF ~ /gz|bgz/) print "TRUE" }' ) ]; then
if [ $( echo ${SET1} | awk -v FS="." '{ if ($NF ~ /gz|bgz/) print "TRUE" }' ) ]; then
zcat ${SET1} | fgrep "#" > ${OVRTMP}/set1.bed
zcat ${SET1} | fgrep -v "#" | awk -v OFS="\t" '{ if ($3<$2) $3=$2; print }' \
| grep -f <( awk '{ print "^"$1"\t" }' ${CONTIGS} ) \
Expand All @@ -141,8 +140,7 @@ if [ ${CARRIER} == 1 ]; then
mv ${OVRTMP}/set1.bed2 ${OVRTMP}/set1.bed
fi
#Unzip & format SET2, if gzipped
if [ $( file ${SET2} | fgrep " gzip " | wc -l ) -gt 0 ] || \
[ $( echo ${SET2} | awk -v FS="." '{ if ($NF ~ /gz|bgz/) print "TRUE" }' ) ]; then
if [ $( echo ${SET2} | awk -v FS="." '{ if ($NF ~ /gz|bgz/) print "TRUE" }' ) ]; then
zcat ${SET2} | fgrep "#" | awk -v OFS="\t" \
'{ print $1, $2, $3, "VID", $4, $5, $6 }' > ${OVRTMP}/set2.bed
zcat ${SET2} | fgrep -v "#" \
Expand Down
8 changes: 2 additions & 6 deletions src/sv-pipeline/scripts/vcf_qc/external_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,8 @@ fi
cd ${QCTMP}
mkdir ${QCTMP}/perSample
mkdir ${QCTMP}/perFamily
#Unzip VCF, if gzipped
if [ $( file ${VCF} | fgrep " gzip " | wc -l ) -gt 0 ]; then
zcat ${VCF} > ${QCTMP}/input.vcf
else
cp ${VCF} ${QCTMP}/input.vcf
fi
#Unzip VCF
zcat ${VCF} > ${QCTMP}/input.vcf
#Gather SV types to process
cut -f1 ${SVTYPES} | sort | uniq > ${QCTMP}/svtypes.txt

Expand Down

0 comments on commit a35ad88

Please sign in to comment.