Bracket issue in snakemake cluster command - amazon-ec2

I am using snakemake 4.0.0 on aws cfncluster with the following commands.
rule fastq_to_counts:
input: fastql="/shared/dbGAP/sras2/fastq.gz/{sample}_1.fastq.gz", fastqr="/shared/dbGAP/sras2/fastq.gz/{sample}_2.fastq.gz"
output: "/shared/counts/{sample}"
shell: '/shared/packages/sailfish-master/bin/sailfish quant -i /shared/packages/gencode26/gencode26 -l IU -p 1 -1 <(zcat {input.fastql}) -2 <(zcat {input.fastqr}) --output {output}'
It runs fine on the head node but when I submit to head node i get the following error.
/shared/packages/sailfish-master/bin/sailfish quant -i /shared/packages/gencode26/gencode26 -l IU -p 1 -1 <(zcat /shared/dbGAP/sras2/fastq.gz/xxx.fastq.gz) -2 <(zcat /shared/dbGAP/sras2/fastq.gz/xxx.fastq.gz) --output /shared/counts/SRR1075530
/bin/sh: 1: Syntax error: "(" unexpected
Error in job fastq_to_counts while creating output file /shared/counts/xxx.
RuleException:
The issue is that the "sh" command does not support "bashism" of the "("
is there any way to force snakemake to use /bin/bash ?
Thanks

found that the solution is adding the following to snakefile
shell.executable('bash')

Related

Apache JMeter error when running a test from CMD

I'm trying to run a JMeter test script from the CMD prompt but I keep getting this error:
An error occurred: The file C:\Users\xxxxx\Downloads\apache-jmeter-5.5\apache-jmeter-5.5\bin\templates\LoginPage.jmx -l C:\Users\xxxxx\Documents\Results\Jmeter.csv -e -o C:\Users\xxxxx\Documents\Results\report.csv doesn't exist or can't be opened
This is the command I'm running:
C:\Users\xxxxx\Downloads\apache-jmeter-5.5\apache-jmeter-5.5\bin>jmeter -n -t "C:\Users\xxxxx\Downloads\apache-jmeter-5.5\apache-jmeter-5.5\bin\templates\LoginPage.jmx -l "C:\Users\xxxxx\Documents\Results\Jmeter.csv" -e -o "C:\Users\xxxxx\Documents\Results\report.csv"
I'm just testing it out so ignore the folder location etc
Any ideas?
Here is the problem:
C:\Users\xxxxx\Downloads\apache-jmeter-5.5\apache-jmeter-5.5\bin>jmeter
^ ka-boom
you need to change the > to \ and the command should start working as expected
Full commmand just in case:
C:\Users\xxxxx\Downloads\apache-jmeter-5.5\apache-jmeter-5.5\bin\jmeter -n -t "C:\Users\xxxxx\Downloads\apache-jmeter-5.5\apache-jmeter-5.5\bin\templates\LoginPage.jmx" -l "C:\Users\xxxxx\Documents\Results\Jmeter.csv" -e -o "C:\Users\xxxxx\Documents\Results\report.csv"
More information:
How Do I Run JMeter in Non-GUI Mode?
Generating Reports
This is the command you provided:
C:\Users\xxxxx\Downloads\apache-jmeter-5.5\apache-jmeter-5.5\bin>jmeter -n -t "C:\Users\xxxxx\Downloads\apache-jmeter-5.5\apache-jmeter-5.5\bin\templates\LoginPage.jmx -l "C:\Users\xxxxx\Documents\Results\Jmeter.csv" -e -o "C:\Users\xxxxx\Documents\Results\report.csv"
If we break it up into multiple lines and strip off the prompt, for clarity, we get:
jmeter ^
-n ^
-t "C:\Users\xxxxx\Downloads\apache-jmeter-5.5\apache-jmeter-5.5\bin\templates\LoginPage.jmx ^
-l "C:\Users\xxxxx\Documents\Results\Jmeter.csv" ^
-e ^
-o "C:\Users\xxxxx\Documents\Results\report.csv"
You will notice that the filename passed after -t is missing a quote at the end.

Error running test command in veins_hetvnet

I am using Instant Veins 5.0-alpha2 i1. When executing the test procedure on veins_hetvnet, the following error is shown:
veins:~/src/veins_hetvnet/examples/veins_hetvnet% ./run -d -u Cmdenv | grep "HetVNetDemoApp::handleMessage"
./run: 25: exec: ../../run: not found
zsh: exit 127 ./run -d -u cmdenv |
zsh: exit 1 grep --color=auto "HetVNetDemoApp::handleMessage"
Error figure

why i get this " -bash: ROUGE-1.5.5.pl: command not found error " error?

I tried to evaluate the system generated summaries using ROUGE. I have used the command line bellow but i get this-bash: ROUGE-1.5.5.pl: command not founderror. what is the problem?
ROUGE-1.5.5.pl -n 4 -w 1.2 -m -2 4 -u -c 95 -r 1000 -f A -p 0.5 -t 0 -a -d rougejk.in
The path to your file "ROUGE-1.5.5.pl" isn't defined in your PATH variable, or your file isn't in a folder defined in PATH :
$> echo $PATH
If you want to add the path to the folder containing "ROUGE-1.5.5.pl" :
PATH="$PATH:/path/to/folder"
Then you will be able to run your command as described.
You can add this line to your .bashrc, if you want this to be permanent.
Else you have to run the command like this (from your script location) :
./ROUGE-1.5.5.pl -n 4 -w 1.2 -m -2 4 -u -c 95 -r 1000 -f A -p 0.5 -t 0 -a -d rougejk.in

bash script works on bootup, doesn't in terminal

I'm creating a server in Amazon ec2 and passing it a bash script as userdata, which is run when the server first boots. It includes a command to add a line to crontab for a user using the answer given here.
directory="/home/intahwebz/current/tools/amazon/"
command="cd $directory && sh backupSQLToS3.sh"
job="15 1 */2 * * $command"
cat <(fgrep -i -v "$command" <(crontab -u intahwebz -l)) <(echo "$job") | crontab -u intahwebz -
This script appears to work fine during bootup as it displays no error messages and the cronjob is installed in the crotab.
However I'd also like the script to run during server upgrades. Attempting to run the script from the command line gives the error:
installCrontab.sh: line 14: syntax error near unexpected token `('
installCrontab.sh: line 14: `cat <(fgrep -i -v "$command" <(crontab -u intahwebz -l)) <(echo "$job") | crontab -u intahwebz -'
What do I need to fix this error?
your approach is working perfectly for me:
$ whoami
test
$ echo $SHELL
/bin/bash
$ command="cd $directory && sh backupSQLToS3.sh"
$ job="15 1 */2 * * $command"
$ crontab -l
$ cat <(fgrep -i -v "$command" <(crontab -u test -l)) <(echo "$job") | crontab -u test -
$ crontab -l
15 1 */2 * * cd && sh backupSQLToS3.sh
I missed to set the "directory" variable but your code works fine for me.
It looks like you are using the bourne shell (/bin/sh) to execute a bash script. Try using bash instead of sh.

Bash command substution error

The code:
`cat <(fgrep -i -v "$DAEMON_TEST" <(sudo -u asm crontab -l)) <(echo "$CRON") | sudo -u asm crontab -`
The error:
command substitution: line 46: syntax error near unexpected token `('
/etc/init.d/asm: command substitution: line 46: `cat <(fgrep -i -v "$DAEMON_TEST" <(sudo -u asm crontab -l)) <(echo "$CRON") | sudo -u asm crontab -'
The command runs fine when run directly into the shell by replacing the variables with the relevant strings
Here are the variables:
DAEMON_TEST=asm_test.php
CRON="*/15 * * * * /opt/asm/daemons/test.php"
The issue ended up being completely unrelated.
Changed:
#/bin/sh
to:
#/bin/bash
I never realized there would be a differnce
https://superuser.com/questions/125728/what-is-the-difference-between-bash-and-sh

Resources