<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _run(self, referenceGroupId, referenceId=None):
 """ automatically guess reference id if not passed """

        # check if we can get reference id from rg
        if referenceId is None:
            referenceId = self._referenceId
        if referenceId is None:
            rg = self._client.get_read_group(
                read_group_id=referenceGroupId)
            iterator = self._client.search_references(rg.reference_set_id)
            for reference in iterator:
                self._run(referenceGroupId, reference.id)
        else:
            iterator = self._client.search_reads(
                read_group_ids=[referenceGroupId],
                reference_id=referenceId,
                start=self._start, end=self._end)
            self._output(iterator)