|
From: James B. <jk...@sa...> - 2011-02-28 12:46:17
|
On Mon, Feb 28, 2011 at 11:59:32AM +0000, Peter wrote:
> I've never tried, but in that case try combining the desired flags, 0x02 plus/or
> 0x08 is 0x0A (in binary, 2+8=10), so I'd expect -f 0x0A will do what you want.
Sometimes you want to filter by either-OR. So either 2 or 8 (or
both). In that case "(flags & 10) != 0" is a suitable boolean
condition.
Othertimes we want to filter by AND. So 2 and 8 must both be set,
implying "(flags & 10) == 10" is a suitable boolean.
The latter method is how samtools works and is probably what most
users typically want/expect. The documentation for -f states "Only
output alignments with all bits in INT present in the FLAG field" - ie
it's an explicit AND operation and not OR.
I don't know if it's possible too do the first OR case, if that is
indeed what you wanted. The original poster mentioned trying multiple
-f parameters, which would be a reasonable way to implement an OR
mechanism.
--
James Bonfield (jk...@sa...) | Hora aderat briligi. Nunc et Slythia Tova
| Plurima gyrabant gymbolitare vabo;
A Staden Package developer: | Et Borogovorum mimzebant undique formae,
https://sf.net/projects/staden/ | Momiferique omnes exgrabure Rathi.
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.
|