示例#1
0
    def prepare_data(
        self,
        sequence_x,
        position_x,
        annotation_x,
        sequence_y,
        position_y,
        annotation_y,
    ):
        data_x = self._prepare_sequence(
            sequence_x, position_x, annotation_x
        )
        data_y = self._prepare_sequence(
            sequence_y, position_y, annotation_y
        )

        block_size = len(data_x)/self.window_size
        base_x = data_x[(self.window_size//2) * block_size]
        base_y = data_y[(self.window_size//2) * block_size]

        ax = AnnotationLoader.get_annotation_at(annotation_x, position_x)
        ay = AnnotationLoader.get_annotation_at(annotation_y, position_y)

        return [base_x, base_y]\
            + self._prepare_annotations(ax)\
            + self._prepare_annotations(ay)\
            + self.combine(data_x, data_y)
示例#2
0
    def prepare_data(
        self,
        sequence_x,
        position_x,
        annotation_x,
        sequence_y,
        position_y,
        annotation_y,
        reference=None,
    ):
        if reference is None:
            reference = self.insert_sequence

        args = [
            (sequence_x, position_x, annotation_x),
            (sequence_y, position_y, annotation_y),
        ]
        data_r = self._prepare_sequence(*args[reference])
        data_s = self._prepare_space_sequence(*args[1 - reference])

        block_size = (len(data_r)) / (self.window_size)
        base = data_r[(self.window_size // 2) * block_size]

        a = AnnotationLoader.get_annotation_at(args[reference][2],
                                               args[reference][1])

        return [base]\
            + self._prepare_annotations(a)\
            + self.combine(data_r, data_s)
示例#3
0
    def prepare_data(
        self,
        sequence_x,
        position_x,
        annotation_x,
        sequence_y,
        position_y,
        annotation_y,
        reference=None,
    ):
        if reference is None:
            reference = self.insert_sequence

        args = [
            (sequence_x, position_x, annotation_x),
            (sequence_y, position_y, annotation_y),
        ]
        data_r = self._prepare_sequence(*args[reference])
        data_s = self._prepare_space_sequence(*args[1-reference])

        block_size = (len(data_r))/(self.window_size)
        base = data_r[(self.window_size//2) * block_size]

        a = AnnotationLoader.get_annotation_at(args[reference][2], args[reference][1])

        return [base]\
            + self._prepare_annotations(a)\
            + self.combine(data_r, data_s)
示例#4
0
    def prepare_data(
        self,
        sequence_x,
        position_x,
        annotation_x,
        sequence_y,
        position_y,
        annotation_y,
    ):
        data_x = self._prepare_sequence(sequence_x, position_x, annotation_x)
        data_y = self._prepare_sequence(sequence_y, position_y, annotation_y)

        block_size = len(data_x) / self.window_size
        base_x = data_x[(self.window_size // 2) * block_size]
        base_y = data_y[(self.window_size // 2) * block_size]

        ax = AnnotationLoader.get_annotation_at(annotation_x, position_x)
        ay = AnnotationLoader.get_annotation_at(annotation_y, position_y)

        return [base_x, base_y]\
            + self._prepare_annotations(ax)\
            + self._prepare_annotations(ay)\
            + self.combine(data_x, data_y)