Question: How Do I Create An Rg.Txt File For Input Into Samtools Merge? / Picard
0
gravatar for 21286786
5.3 years ago by
212867860
212867860 wrote:

I have merged bam files from 6 lanes for a number of samples, and am trying to use picard MarkDuplicates. However, I get an error PicardException: Value was put into PairInfoMap more than once. Which I've learn is due to some issues with the read group information.

I'm planning to rerun samtools merge using the -r and -h options (ie samtools merge -rh rg.txt in1.bam in2.bam in3.bam in4.bam in5.bam in6.bam out.bam) but I'm not sure what file to use for the -h option, what needs to be included etc in the required file. Could anyone please let me know where to get the file or what to include?

Thanks in advance

read samtools error picard merge bam • 2.6k views
ADD COMMENTlink modified 5.3 years ago by samsara560 • written 5.3 years ago by 212867860

cross posted on SE: http://seqanswers.com/forums/showthread.php?t=33260

ADD REPLYlink written 5.3 years ago by Pierre Lindenbaum115k
2
gravatar for Devon Ryan
5.3 years ago by
Devon Ryan86k
Freiburg, Germany
Devon Ryan86k wrote:

The file specified by -h is effectively the header of a SAM file in text format. If you did "samtools view -H in1.bam > rg.txt", you'll get a header that you can then edit in any text editor. In practice, you probably don't want to reheader the file, since the headers for the inputs should be the same (at least as far as it matters) and they should all be sorted equivalently. The -r option should take care of adding the read groups to the merged file appropriately.

Just as a point of warning, don't get too aggressive with changing the header of BAM files. If you change the chromosome order in them, then you end up changing the chromosome/contig alignment for your reads, which can really shoot you in the foot.

ADD COMMENTlink written 5.3 years ago by Devon Ryan86k
0
gravatar for samsara
5.3 years ago by
samsara560
The Earth
samsara560 wrote:

I wounder if you are the one who posted same question in seqanswers.com

ADD COMMENTlink written 5.3 years ago by samsara560
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1695 users visited in the last hour