SnapGeneFileReader icon indicating copy to clipboard operation
SnapGeneFileReader copied to clipboard

Reading History for New format *.dna file

Open MinTTT opened this issue 10 months ago • 1 comments

Since the *.dna improve the storage of history trees, they compressed the xml tags after the version of 5.0.

I recommend decompress the hex string to read the history of DNA sequence.

        elif ord(next_byte) == 7:
            # read history
            hist_content = fileobject.read(block_size)
            try:
                hist2xml = hist_content.decode("utf-8")
                
            except Exception as e:
                # try to read the history decompress via LZMA
                hist_content_compressed = hist_content
                # print hist_content_compressed as hex 
                print(hist_content_compressed.hex())
                try:
                    hist2xml = lzma.decompress(hist_content_compressed).decode("utf-8")
                except Exception as e:
                    continue

            hist_data = parse_dict(xmltodict.parse(hist2xml))

MinTTT avatar Mar 16 '25 07:03 MinTTT