don't type empty files

This causes errors.
This commit is contained in:
Heng Li 2014-11-18 23:28:46 -05:00
parent 61ab329639
commit 56f1056b49
2 changed files with 6 additions and 1 deletions

View File

@ -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.

View File

@ -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)}'`