wtsi-npg / bambi

Process Illumina instrument data into SAM/BAM/CRAM files.
http://wtsi-npg.github.io/bambi
GNU Affero General Public License v3.0
9 stars 15 forks source link

Include BC: tag in read group headers #165

Closed kiwiroy closed 4 years ago

kiwiroy commented 4 years ago

The barcode expected for the sample can be included in the @RG header line as per Section 1.3 of SAMv1.pdf

This pull request ensures that bambi adds BC:barcode to each @RG when using the i2b command when a --barcode-file is supplied.

e.g. the following

@RG ID:1#0  DT:2011-03-23T00:00:00+0000 PU:160919_hiseq2500_4966_FC_1#0 LB:TestLibrary  PG:SCS  SM:TestSample   CN:SC   PL:ILLUMINA DS:Study TestStudy
@RG ID:1#1  DT:2011-03-23T00:00:00+0000 PU:160919_hiseq2500_4966_FC_1#1 LB:TestLibrary1 PG:SCS  SM:TestSample1  CN:SC   PL:ILLUMINA DS:Study TestStudy

becomes

@RG ID:1#0  DT:2011-03-23T00:00:00+0000 PU:160919_hiseq2500_4966_FC_1#0 LB:TestLibrary  PG:SCS  SM:TestSample   CN:SC   PL:ILLUMINA DS:Study TestStudy  BC:NN-NN
@RG ID:1#1  DT:2011-03-23T00:00:00+0000 PU:160919_hiseq2500_4966_FC_1#1 LB:TestLibrary1 PG:SCS  SM:TestSample1  CN:SC   PL:ILLUMINA DS:Study TestStudy  BC:GT-AG
jenniferliddle commented 4 years ago

Thanks for this, I'll review it as soon as I can.

kiwiroy commented 4 years ago

Awesome. Thank you.