gt1 / biobambam2

Tools for early stage alignment file processing
Other
93 stars 17 forks source link

bamtofastq - put specified tags in fastq comment if present #27

Closed keiranmraine closed 7 years ago

keiranmraine commented 8 years ago

If remapping a BAM file it would be useful to be able to retain information such as barcode (BC) information in the downstream files.

BWA mem supports taking data from the fastq comment and appending it to the mapped read in it's ouput:

-C Append append FASTA/Q comment to SAM output. This option can be used to transfer read meta information (e.g. barcode) to the SAM output. Note that the FASTA/Q comment (the string after a space in the header line) must conform the SAM spec (e.g. BC:Z:CGTAC). Malformated comments lead to incorrect SAM output.

Could a option along the lines of the following be added?

tags=<[]>   BAM tags to be copied in to fastq comment, e.g. BC.
gt1 commented 8 years ago

Could you try whether version 2.0.54 does what you need?

Thanks German