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 (j...@sanger.ac.uk) | 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. ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape _______________________________________________ Samtools-help mailing list Samtools-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/samtools-help