def selected_subgraph(self):
        items = self.selectedItems()
        modules = [x.id
                   for x in items
                   if isinstance(x, QGraphicsModuleItem)]
        return self.controller.current_pipeline.graph.subgraph(modules)

#    def contextMenuEvent(self, event):
#        selectedItems = self.selectedItems()
#        if len(selectedItems) == 0:
#            return QInteractiveGraphicsScene.contextMenuEvent(self, event)
#        else:
#            self._context_menu.exec_(event.screenPos())
Returns the subgraph containing the selected modules and its
dataset/ETHPy150Open VisTrails/VisTrails/vistrails/gui/pipeline_view.py/QPipelineScene.selected_subgraph