Skip to content

Use the new header API - #998

Merged
daviesrob merged 11 commits into
samtools:developfrom
valeriuo:merge_headers
Aug 19, 2019
Merged

daviesrob merged 11 commits into
samtools:developfrom
valeriuo:merge_headers

Conversation

@valeriuo

@valeriuo valeriuo commented Jan 15, 2019 •

Copy link
Copy Markdown
Contributor

Depends on htslib PR samtools/htslib#812
Fixes #856
Fixes #1079

@daviesrob

Copy link
Copy Markdown
Member

Updated to the header API as finally deployed. Most of the original commits were just chasing changes in the API as it developed, hence squashed as not very useful.

@jmarshall

Copy link
Copy Markdown
Member

Note for when merging or further rewriting these commits: the first one has inadvertently deleted test/split/.gitignore.

@valeriuo

valeriuo commented Jul 2, 2019

Copy link
Copy Markdown
Contributor Author

Thanks for spotting that. Fixed and rebased.

@valeriuo
valeriuo force-pushed the merge_headers branch 2 times, most recently from 424b261 to 9f74850 Compare July 16, 2019 15:30
@valeriuo

Copy link
Copy Markdown
Contributor Author

1161e5b fixes #856

Comment thread bam_addrprg.c Outdated
return false;
}
if (opts->mode == overwrite_all &&
-1 == sam_hdr_keep_line(retval->output_header, "RG", "ID", opts->rg_id)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this.

It's a bit surprising that a function called sam_hdr_keep_line has the effect of removing lines! Maybe this API function could be renamed to sam_hdr_keep_only_line or similar?

@valeriuo valeriuo Aug 6, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to sam_hdr_remove_except.

@valeriuo
valeriuo force-pushed the merge_headers branch 3 times, most recently from 7bdf844 to 03acf36 Compare August 6, 2019 16:27
@valeriuo

Copy link
Copy Markdown
Contributor Author

Fixes #1079

@daviesrob

Copy link
Copy Markdown
Member

Rebased so all commits build against current HTSlib.

Upgraded bam_split count_RG() function to use the new header API.

bam_smpl_add() and get_rg_sample() also do some header text parsing. I'll probably them separately as they are a bit more complicated.

@daviesrob
daviesrob merged commit 5f06375 into samtools:develop Aug 19, 2019
@valeriuo
valeriuo deleted the merge_headers branch August 19, 2019 15:17
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.

make error addreplacerg overwrite_all doesn't overwrite the old RG tags

4 participants