gt1 / biobambam2

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

bamtofastq #43

Closed nesilin closed 7 years ago

nesilin commented 7 years ago

Hi!

I have downloaded a pair of tumor/normal BAM files and I want to realign them again. So, I tried to convert them into FASTQ file . When using biobambam2 like:

bamtofastq collate=1 inputformat=bam level=5 exclude=QCFAIL,SECONDARY,SUPPLEMENTARY filename=name_normal.bam gz=1 outputdir=/output/dir/ outputperreadgroup=1 outputperreadgroupsuffixF=_1.fq.gz outputperreadgroupsuffixF2=_2.fq.gz outputperreadgroupsuffixO=_o1.fq.gz outputperreadgroupsuffixO2=_o2.fq.gz outputperreadgroupsuffixS=_s.fq.gz tryoq=1

the fastq files obtained have as name the @RG ID of the bam file plus the corresponding suffix(e.g. _1.fq.gz ) instead of the name of the file plus the read group id (@RG ID) plus the suffix that I have written in the command (name_normal+prefix(@RG ID)+suffix).

Is there a way to tell biobambam2 to put also the original bam filename to the fastq outputs? Or is there a way to tell biobamba2 that, a part of using the RG ID, to use the sample name (tag @RG SM) too as fastq file name?

gt1 commented 7 years ago

Hi,

could you try the options outputperreadgrouprgsm=1 and outputperreadgroupprefix=name_normal in version 2.0.72?

nesilin commented 7 years ago

I've tried! Perfect! Thank!