You might throw -F into your grep, since your read is a fixed string. If you wanted decent speed, I’d write a quick single pass picard program to read your list of read names in and emit the reads to a new file.
-Jim On Aug 18, 2014, at 10:32 AM, csoeder <[email protected]> wrote: > Hi! I would like to query a sam/bam file by its qname field. Can this be done > with samtools? I haven't seen anything like it in the documentation. I've > tried > > grep -f qnames.list reads.sam > output.out > > but it's unworkably slow. > > Thanks! > Charlie > > > ------------------------------------------------------------------------------ > _______________________________________________ > Samtools-help mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/samtools-help ------------------------------------------------------------------------------ _______________________________________________ Samtools-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/samtools-help
