From BITS wiki
Jump to: navigation, search

Picard tools is a set of programs for manipulation and converting NGS data types.

What to do when "Error parsing text SAM file. Empty sequence dictionary."

This error appears because the appropriate header lines are not avaialable the SAM file. Header lines start with '@'. For Picard tools, they need to contain the Sequence dictionary information, such as the reference file etc. You need to use CreateSequenceDictionary.jar and cat to sort this out.

1. Create the dictionary, say, dict.sam
java -jar CreateSequenceDictionary.jar OUTPUT=dict.sam R=ref.fa

2. Create a new file (unsorted_file.sam) that has both the dictionary and the aligned reads.
cat dictionary.sam > unsorted_file.sam && cat file.sam >> unsorted_file.sam

3. Sort the SAM file
java -jar SortSam.jar INPUT=unsorted_file.sam OUTPUT=sorted_file.sam SO=coordinate

That's what has worked for me.

Source: http://seqanswers.com/forums/showthread.php?t=9421