Generates an index by scanning though all the reads in an SFF file (PRIVATE).
This is a slow but generic approach if we can't parse the provided index
(if present).
Will use the handle seek/tell functions.

Reads any existing Roche style read index provided in the SFF file (PRIVATE).
Will use the handle seek/tell functions.
This works on ".srt1.00" and ".mft1.00" style Roche SFF index blocks.
Roche SFF indices use base 255 not 256, meaning we see bytes in range the
range 0 to 254 only. This appears to be so that byte 0xFF (character 255)
can be used as a marker character to separate entries (required if the
read name lengths vary).
Note that since only four bytes are used for the read offset, this is
limited to 255^4 bytes (nearly 4GB). If you try to use the Roche sfffile
tool to combine SFF files beyound this limit, they issue a warning and
omit the index (and manifest).

Reads any existing Roche style XML manifest data in the SFF "index" (PRIVATE, DEPRECATED).
Will use the handle seek/tell functions. Returns a string.
This has been replaced by ReadRocheXmlManifest. We would normally just
delete an old private function without warning, but I believe some people
are using this so we'll handle this with a deprecation warning.

0045300454 def _sff_read_roche_index_xml(handle):
00455 """Reads any existing Roche style XML manifest data in the SFF "index" (PRIVATE, DEPRECATED).00456 00457 Will use the handle seek/tell functions. Returns a string.00458 00459 This has been replaced by ReadRocheXmlManifest. We would normally just00460 delete an old private function without warning, but I believe some people00461 are using this so we'll handle this with a deprecation warning.00462 """00463 import warnings
00464 warnings.warn("Private function _sff_read_roche_index_xml is deprecated. "00465 "Use new public function ReadRocheXmlManifest instead",
00466 DeprecationWarning)
00467 returnReadRocheXmlManifest(handle)
00468

Reads any Roche style XML manifest data in the SFF "index".
The SFF file format allows for multiple different index blocks, and Roche
took advantage of this to define their own index block wich also embeds
an XML manifest string. This is not a publically documented extension to
the SFF file format, this was reverse engineered.
The handle should be to an SFF file opened in binary mode. This function
will use the handle seek/tell functions and leave the handle in an
arbitrary location.
Any XML manifest found is returned as a Python string, which you can then
parse as appropriate, or reuse when writing out SFF files with the
SffWriter class.
Returns a string, or raises a ValueError if an Roche manifest could not be
found.

0046900470 def ReadRocheXmlManifest(handle):
00471 """Reads any Roche style XML manifest data in the SFF "index".00472 00473 The SFF file format allows for multiple different index blocks, and Roche00474 took advantage of this to define their own index block wich also embeds00475 an XML manifest string. This is not a publically documented extension to00476 the SFF file format, this was reverse engineered.00477 00478 The handle should be to an SFF file opened in binary mode. This function00479 will use the handle seek/tell functions and leave the handle in an00480 arbitrary location.00481 00482 Any XML manifest found is returned as a Python string, which you can then00483 parse as appropriate, or reuse when writing out SFF files with the00484 SffWriter class.00485 00486 Returns a string, or raises a ValueError if an Roche manifest could not be00487 found.00488 """00489 number_of_reads, header_length, index_offset, index_length, xml_offset, \
00490 xml_size, read_index_offset, read_index_size = _sff_find_roche_index(handle)
00491 ifnot xml_offset ornot xml_size:
00492 raise ValueError("No XML manifest found")
00493 handle.seek(xml_offset)
00494 return_bytes_to_string(handle.read(xml_size))
00495
00496
#This is a generator function!