0

In the current directory, I have a list of multi-resolution .mcool files. I want to run the following code using EagleC and store the output (including the .stderr and .log files) in the ./../EagleC_output directory.

Code:

for mcool_file in *.mcool; do

  OUTPUT=$(echo $mcool_file | grep -oE "[A-Z0-9]*\.hg38" | cut -d '.' -f 1)

  cooler ls $mcool_file | grep -E '\/[1][0]{4}$|\/[5][0]{3,4}$' \
  | tr '\n' '\t' \
  | parallel --colsep '\t' --link -j16 \
  --eta --progress --bar --joblog $mcool_file'_parallel.log' \
  predictSV --hic-5k {1} --hic-10k {2} --hic-50k {3} \
  -O './../EagleC_output/'$OUTPUT -g hg38 --balance-type ICE --output-format full \
  --prob-cutoff-5k 0.8 --prob-cutoff-10k 0.8 --prob-cutoff-50k 0.99999 2> $mcool_file'.stderr'
  # | tr -d "'"

done

Traceback:

sh: /dev/tty: No such device or address
0% 0:1=0s A001C007.hg38.nodups.pairs.mcool::/resolutions/5000 A001C007.hg38.nodush: /dev/tty: No such device or address
0% 0:1=0s A001C007.hg38.nodups.pairs.mcool::/resolutions/5000 A001C007.hg38.nodush: /dev/tty: No such device or address

A single .mcool file has:

cooler ls ./../input/A001C007.hg38.nodups.pairs.mcool

./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/200
./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/500
./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/1000
./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/2000
./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/5000
./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/10000
./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/20000
./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/50000
./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/100000
./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/250000
./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/500000
./../input/A001C007.hg38.nodups.pairs.mcool::/resolutions/1000000
(EagleC) 
Cyrus
  • 84,225
  • 14
  • 89
  • 153
melolili
  • 1,237
  • 6
  • 16
  • 2
    Are you running this from an environment that doesn't have a terminal connection, like `cron`? – Barmar Jul 28 '23 at 19:25
  • 2
    Probably not related to the problem, but remember to always quote your variables. – Barmar Jul 28 '23 at 19:26
  • Hmm. Try the exact most-recent bash script code I had at: https://stackoverflow.com/questions/76740954/iteratively-run-a-software-on-multi-resolution-files/76741286#76741286 (and where yes, as noted above, the variables are properly double-quoted (although that, in this particular case, doesn't result in any errors if left out, but is bad form)). That is an odd error to receive implying something sort of fundamental is not right. What happens when you enter the command `tty`? – John Collins Jul 28 '23 at 19:38
  • I added some messages to our previous same chat (linked in comments of linked answer above) – John Collins Jul 28 '23 at 20:22
  • Please add a valid shebang (`#!/bin/bash`) to your script, then paste it at http://www.shellcheck.net/ and try to implement all the recommendations made there. – Cyrus Jul 28 '23 at 23:17
  • `tty` command returns `/dev/pts/9` – melolili Jul 29 '23 at 02:42
  • @Barmar I'm running it as a normal `sbatch` file – melolili Jul 29 '23 at 02:44
  • I'm not very familiar with Slurm, but since it's running the batch jobs in the background I wouldn't expect them to have controilling terminals. Can you run them through `Expect`? This will create a pty as the controlling terminal. – Barmar Jul 29 '23 at 17:06

0 Answers0