Parallelising grep

2013-08-09 Thread Nathan S. Watson-Haigh
I have a SAM/BAM file and I'd like to grep for alignments of certain reads IDs. I have the read ID strings in another file. I'm currently doing this with: $ samtools view in.bam | fgrep -w -f read.ids > alignments.txt Is it possible to parallelise the grep by having each grep process a different

Re: Parallelising grep

2013-08-09 Thread Ole Tange
On Fri, Aug 9, 2013 at 7:53 AM, Nathan S. Watson-Haigh wrote: > > I have a SAM/BAM file and I’d like to grep for alignments of certain reads > IDs. I have the read ID strings in another file. I’m currently doing this > with: > > $ samtools view in.bam | fgrep -w -f read.ids > alignments.txt It wi

RE: Parallelising grep

2013-08-09 Thread Cook, Malcolm
Assuming your shell is bash With this exported function function slice { # PURPOSE: After an optional -h lines of header (which are echoed # unless supressed with <-sh>), echo every <-n>th line (default: # every 1 line) starting with the <-m>th (counting from 1, starting # with the first line