Picard를 이용하여 MarkDuplicates 를 수행하는 데 있어서,

"Value was put into PairIntoMap more than once" 라는 에러메시지가 발생하고 프로세스가 죽는 경우 입니다.

 

이 문제에 대해 해결할 수 있는 방안을 찾은 것 같습니다.

이 문제는 BAM파일 내의 리드 정보가 first read와 second read 사이의 flag 및 맵핑 위치 정보가 서로 맞지 않아 발생되는 오류로 확인하였습니다.

이것은 앞서 시도한 BWA -A 옵션을 줌으로써 mate에 대한 정보를 보정해주지 않는 것이 문제를 일으킨것 같습니다.

 

따라서 BWA -A 을 수행한 후에는

samtools fixmate input.bam output.bam

을 수행한 다음 이 output.bam 을 이용해 MarkDuplicates 를 수행하면 됩니다.
 

또 다른 경우로 밤파일들을 머지 한 데이터를 사용할 경우 머지한 밤파일내에 리드아이디가 중복해서 존재하게 되면 또한 위와 같은 에러가 발생합니다.
이러한 경우는 머지를 할때 samtools merge 를 사용할 경우입니다.
Picard의 MergeSamFiles.jar 를 이용하면 개발 bam들이 동일한 RG ID를 갖고 있으면, 자동으로 RG_ID 뒤에  ".1" 과 같이 숫자 인덱스를 만들어주게 됩니다. 보통 bioscope 등을 이용하여 맵핑한 bam 파일들은 RG_ID 가 default라는 명칭으로 되어 있습니다.

따라서 정리하면 위와 같은 에러메시지가 발생할 경우

1. "Value was put into PairIntoMap more than once"  와 함께 나타나는 리드 아이디가 중복해서 존재하는지 확인한다.
2. 중복해서 존재할 경우에는 merge 하는 툴을 Picard를 이용한다.
3. 중복해서 존재하지 않을 경우에는 samtools fixmate 를 실행한 후 재분석한다.


이상//

Posted by 옥탑방람보
,
Exception in thread "main" java.lang.RuntimeException: SAM validation error: ERROR: Record 62094965, Read name ILLUMINA-A16956_100211:4:14:19403:10471#0, MAPQ should be 0 for unmapped read

이러한 에러 발생시,

VALIDATION_STRINGENCY=
LENIENT

옵션을 추가해준다.


This is a common problem, and you'll run into it with all the Picard suite of tools.

There's a setting that goes something like VALIDATION_STRINGENCY, and if you set it to LENIENT, it will complain about those reads, but it won't stop on them.

This happens with bwa, because it concatenates reference sequence, which leads to slightly odd things happening when a read aligns over the overlap. So this might be the source of your problem. Regardless of what's causing it, you can examine the problem reads, and cut them out, or change the stringency to let them go through.

 
Posted by 옥탑방람보
,
java -jar MarkDuplicates.jar INPUT=test.bam OUTPUT=test.marked.bam METRICS_FILE=test.txt TMP_DIR=. ASSUME_SORTED=true
Posted by 옥탑방람보
,