039188978e9faef534235afda7eb14aee6d6cda9 hiram Tue Oct 29 14:00:02 2024 -0700 handle the case of empty grep result on part.list refs #34685 diff --git src/hg/utils/automation/doCpgIslands.pl src/hg/utils/automation/doCpgIslands.pl index d621312..c6451f4 100755 --- src/hg/utils/automation/doCpgIslands.pl +++ src/hg/utils/automation/doCpgIslands.pl @@ -214,31 +214,31 @@ for L in parts/part*.lst do B=`basename \$L | sed -e 's/.lst//;'` sed -e 's/.*.2bit://; s/:0-.*//;' \${L} > \${B}.list twoBitToFa -seqList=\$B.list \${twoBit} stdout | maskOutFa stdin hard stdout \\ | faToTwoBit stdin partFa/\$B.t.2bit rm -f \${B}.list twoBitToFa partFa/\$B.t.2bit stdout | faCount stdin | egrep -v \"^total|^#seq\" | awk '\$2-\$7 > 200 { printf \"%s\\n\", \$1}' > \$B.list if [ -s \$B.list ]; then twoBitToFa -seqList=\$B.list partFa/\$B.t.2bit stdout | faToTwoBit stdin partFa/\$B.2bit fi rm -f partFa/\$B.t.2bit \$B.list done mkdir -p results chmod a+x runCpg.bash oneSplit.bash -grep -v "parts/part" part.list | xargs -L 1 --no-run-if-empty ./oneSplit.bash +(grep -v "parts/part" part.list || true) | xargs -L 1 --no-run-if-empty ./oneSplit.bash rm -f file.list find ./partFa -type f > file.list $gensub2 file.list single gsub jobList $paraRun catDir -r results | sort -k1,1 -k2,2n > cpglh.result _EOF_ ); } else { my $whatItDoes = "Run /hive/data/staging/data/cpgIslandExt/cpglh on masked sequence."; $bossScript = newBash HgRemoteScript("$runDir/doCpg.bash", $workhorse, $runDir, $whatItDoes); $bossScript->add(<<_EOF_ export twoBit=\"$maskedSeq\" twoBitToFa \$twoBit stdout | maskOutFa stdin hard stdout \\