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

samtools merge to trace transformations applied to @RG IDs #264

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

SamStudio8
Copy link
Contributor

Adds a -t <FILE> option for samtools merge to create a tab-delimited text file in the format;

bam_filename    @RG_ID    Transformed_@RG_ID

eg.

/dat/test_input_1_b.bam fish PG:llama   fish PG:llama
/dat/test_input_1_b.bam cow cow
/dat/test_input_1_b.bam colt    colt
/dat/test_input_1_c.bam fish    fish
/dat/test_input_1_c.bam cow cow-55424A4
/dat/test_input_1_c.bam colt    colt-3A2CCEF5
/dat/test_input_1_a.bam fish    fish-4861F4EF
/dat/test_input_1_a.bam cow cow-39E5EF
/dat/test_input_1_a.bam colt    colt-1802EEEC

This allows users to keep track of a particular read group ID through the merge process via a simple lookup file. For testing purposes I have hijacked the third merge test in test.pl and performed a diff between the resulting trace file and a provided expected trace file (above). Note that the test relies on a system call to sed to remove the unknown user-specific path to the /dat/ files before the comparison.

(I am unsure whether the fish PG:llama RG ID is intentional, the tab delimiter appears to be missing from the input BAM in question.)

@SamStudio8
Copy link
Contributor Author

Does merge offer this option now?

@valeriuo
Copy link
Contributor

No. And it seems -t has been used for tag sorting, in the meantime.
merge needs some rework, as there are quite a few old PRs that address it. Also, it could make better use of the new header API.

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