downloading 1000 genomes project bam files in the background
0
0
Entering edit mode
6.6 years ago
Ana ▴ 200

My question is somehow related to what I asked yesterday. C: downloading bam files of phase 3 of 1000 genomes project

I am trying to download bam files of 1000 genomes project, only for my desired intervals by incorporating samtools -view. As it takes probably more than a day, I want to run it in the background, this is the code that I am using so far (I used & in the end of my code):

wget -q -O - "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/current.tree" | cut -f 1 | grep '.bam$' | while read B; do echo -n "$B " && /data/programs/samtools-1.3.1/samtools  view -bu "http://ftp.1000genomes.ebi.ac.uk/vol1/$B" "1:115258827-115258827"  && rm *.chrom20.* && rm *.chrom11.* ; done &

I also tried (& disown)

wget -q -O - "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/current.tree" | cut -f 1 | grep '.bam$' | while read B; do echo -n "$B " && /data/programs/samtools-1.3.1/samtools  view -bu "http://ftp.1000genomes.ebi.ac.uk/vol1/$B" "1:115258827-115258827"  && rm *.chrom20.* && rm *.chrom11.* ; done & disown

However, when I logout, my jobs terminate. My question is how can I download files and run my command that I mention above in the background?

bam • 1.9k views
ADD COMMENT
2
Entering edit mode

Have a look at GNU screen to run processes in the background. IMHO one of the most useful GNU application, I use it like every day.

ADD REPLY
2
Entering edit mode

look into wrapping your command in nohup and &

ADD REPLY
0
Entering edit mode

option -b activates running wget in background mode

ADD REPLY
0
Entering edit mode

you might also try to execute your cmdline as such

( cmdline ) &

so use () to 'encapsulate' your cmdline. I'm doubting the behaviour of the & on a piped cmdline

ADD REPLY

Login before adding your answer.

Traffic: 1838 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