Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add samtools head -e EXPR header filtering option [DRAFT] #1537

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jmarshall
Copy link
Member

A draft PR on top of #1517 that adds a -e, --expr EXPR option to the samtools head command, to allow arbitrary filtering of which headers to display.

Requires PR samtools/htslib#1351, and adds draft documentation of that PR's proposed header filter variables to doc/samtools.1.

This enables useful functionality such as:

# View only read groups
samtools head -e 'type == "RG"' foo.bam

# View only "interesting" chromosomes
samtools head -e '@SQ && [SN] !~ "^GL"' bar.bam
samtools head -e '@SQ && [LN:i] > 1000000' baz.bam

Prints the input file's headers and optionally also its first few
alignment records. This command always displays the headers as they
are in the file, never adding an extra `@PG` header itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants