How can I use nohup command when filtering SNPs?
2
0
Entering edit mode
2.1 years ago
ongchip • 0

Hello

When filtering SNPs, the command is

bcftools view my_var.bcf | vcfutils.pl varFilter - > my_final.vcf

However, I want to use "nohup" with this command to be performed in the background.

nohup bcftools view my_var.bcf | vcfutils.pl varFilter - > my_final.vcf > logs.txt &

I used this command but it seems not working.

How I can change the command?

bcftools SNP • 1.2k views
ADD COMMENT
0
Entering edit mode

Define 'not working'?

Pierre's suggestion is the better option, but have you looked at the log file? When you run a process with nohup and as a fork, you will often not be able to interrogate any terminal output unless you capture it in a separate file (but you will likely need to redirect stderr in to the logfile too.

ADD REPLY
2
Entering edit mode
2.1 years ago

don't use nohup.

Use a terminal multiplexer like tmux or screen

if you really want to use nohup. Put your bcftools+vctutils commands in a shell script and invoke nohup myscript.sh.

ADD COMMENT
2
Entering edit mode
2.0 years ago

Wrap your commands in a bash shell call:

nohup bash -c "bcftools view my_var.bcf | vcfutils.pl varFilter - > my_final.vcf" > logs.txt &

Or:

nohup bash -c "bcftools view my_var.bcf | vcfutils.pl varFilter - > my_final.vcf" > logs.stdout.txt 2> logs.stderr.txt &

Nothing wrong with using nohup, in my opinion. A multiplexer is well overkill to solve this.

ADD COMMENT
0
Entering edit mode

Thanks. It seems to work well.

ADD REPLY

Login before adding your answer.

Traffic: 2099 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6