From 56f1056b493fd60e1a30e2b1bfff76a1c5a5969f Mon Sep 17 00:00:00 2001 From: Heng Li Date: Tue, 18 Nov 2014 23:28:46 -0500 Subject: [PATCH] don't type empty files This causes errors. --- README-alt.md | 2 +- extras/typeHLA.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README-alt.md b/README-alt.md index 6476c63..7d3a3c7 100644 --- a/README-alt.md +++ b/README-alt.md @@ -13,7 +13,7 @@ bwa.kit/run-bwamem -o out hs38d6.fa read1.fq read2.fq | sh # skip "|sh" to show This will generate the following files: -* `out.aln.sam.gz`: unsorted alignments with ALT-aware mapping quality. In this +* `out.aln.bam`: unsorted alignments with ALT-aware mapping quality. In this file, one read may be placed on multiple overlapping ALT contigs at the same time even if the read is mapped better to some contigs than others. This makes it possible to analyze each contig independent of others. diff --git a/extras/typeHLA.sh b/extras/typeHLA.sh index 8b40d85..b5a2b4e 100755 --- a/extras/typeHLA.sh +++ b/extras/typeHLA.sh @@ -16,6 +16,11 @@ preres="resource-human-HLA" root=`dirname $0` pre=$1.$2 +if [ ! -s $pre.fq ]; then + echo '** Empty input file. Abort!' >&2 + exit 0 +fi + if [ $is_ctg -eq 0 ]; then echo "** De novo assembling..." >&2 len=`$root/seqtk comp $pre.fq | awk '{++x;y+=$2}END{printf("%.0f\n", y/x)}'`