|
From: James B. <jk...@sa...> - 2016-06-22 13:40:06
|
On Wed, Jun 22, 2016 at 11:42:08AM +0100, Dario Beraldi wrote:
> samtools view -F 128 -F 16 ...
>
> is the same as
>
> samtools view -F 144 ...
>
> Is this behaviour documented somewhere and intentional?
It is intentional, but I don't think it is documented anywhere.
The field is a bit field, and documented as such, so 144 is considered
as 128 OR 16 rather than 128+16. This in turn means -F 128 -F 16 -F
16 or -F 144 -F 16 will still be 144 and not 160, so there is some
built in safety there.
> I'm asking because I have some scripts that rely on this behaviour so I
> would like to know whether it's going to be supported or changed.
The code to make it work as repeatable bit-fields is trivial (just one
line extra byte[1] of source code for each of -f and -F) so there
isn't any logical reason I can think of why it would need to be
replaced. I'd even go as far to say there is a beauty and elegance in
its simplicity; not something you'll often here me say about
samtools. :-)
James
[1] The '|' character.
--
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.
|