Question: downloading 1000 genomes project bam files in the background
0
gravatar for Ana
12 months ago by
Ana140
Ana140 wrote:

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 • 353 views
ADD COMMENTlink modified 12 months ago • written 12 months ago by Ana140
2

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 REPLYlink modified 12 months ago • written 12 months ago by ATpoint15k
2

look into wrapping your command in nohup and &

ADD REPLYlink written 12 months ago by st.ph.n2.4k

option -b activates running wget in background mode

ADD REPLYlink written 12 months ago by lieven.sterck4.5k

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 REPLYlink written 12 months ago by lieven.sterck4.5k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1382 users visited in the last hour