def __init__(self, settings_filename=None, settings=None, tissue_id=None):
        if settings is None and settings_filename is None:
            raise ValueError(
                "Either a settings object or a settings filename has to be given."
            )
        if not settings is None:
            self.settings = settings
        elif not settings_filename is None:
            self.settings = Settings(os.path.abspath(settings_filename),
                                     dctGlobals=globals())

        if not tissue_id is None:
            print('Overwriting settings ... ')
            self.settings = overwrite_settings(self.settings, tissue_id)
            print('tissue id: %s' % tissue_id)
            print('output_folder: %s' % self.settings.output_folder)

        for folder in self.settings.makefolders:
            if not os.path.exists(folder):
                os.makedirs(folder)

        self.cluster_folder = os.path.join(self.settings.output_folder,
                                           'clustering')
        self.plot_projection_folder = os.path.join(self.settings.output_folder,
                                                   'projections')
        for folder in [self.cluster_folder, self.plot_projection_folder]:
            if not os.path.isdir(folder):
                os.makedirs(folder)

        self.sp = SpotDetector(settings=self.settings)
        self.cell_detector = CellDetection(settings=self.settings)
        self.ilastik = Ilastik(settings=self.settings)

        self.markers = self.settings.cluster_markers[self.settings.dataset]
        self.nb_clusters = 60
Ejemplo n.º 2
0
    def __init__(self, settings_filename=None, settings=None, tissue_id=None):
        if settings is None and settings_filename is None:
            raise ValueError(
                "Either a settings object or a settings filename has to be given."
            )
        if not settings is None:
            self.settings = settings
        elif not settings_filename is None:
            self.settings = Settings(os.path.abspath(settings_filename),
                                     dctGlobals=globals())

        if not tissue_id is None:
            print('Overwriting settings ... ')
            self.settings = overwrite_settings(self.settings, tissue_id)
            print('tissue id: %s' % tissue_id)
            print('output_folder: %s' % self.settings.output_folder)

        for folder in self.settings.makefolders:
            if not os.path.exists(folder):
                os.makedirs(folder)

        self.cluster_folder = os.path.join(self.settings.output_folder,
                                           'clustering')
        self.plot_projection_folder = os.path.join(self.settings.output_folder,
                                                   'projections')
        for folder in [self.cluster_folder, self.plot_projection_folder]:
            if not os.path.isdir(folder):
                os.makedirs(folder)

        self.sp = SpotDetector(settings=self.settings)
        self.fissure = FissureDetection(settings=self.settings)
        self.cell_detector = CellDetection(settings=self.settings)
        self.ilastik = Ilastik(settings=self.settings)

        # all markers except for empty,
        self.all_markers = [
            'CD206', 'IL-21', 'CD185(CXCR5)', 'CD45', 'CXCL13',
            'CD1c-biotin-NA', 'CD303(BDCA2)', 'CD11b', 'Bcl-6', 'CD45RA',
            'E-Cadherin', 'CD141', 'CD123', 'CD68', 'CD279(PD-1)', 'HLA-DR',
            'aSMA', 'CD370', 'CD11c', 'CD19', 'ICOS', 'CD56(NCAM)', 'CD3',
            'CD14'
        ]

        self.acceptable_markers = [
            'E-Cadherin', 'aSMA', 'CD45', 'IL-21', 'CXCL13', 'CD279(PD-1)',
            'CD3', 'CD45RA', 'Bcl-6', 'CD19', 'HLA-DR', 'CD11c', 'CD14',
            'CD68', 'CD206', 'CD370', 'CD141', 'CD123'
        ]

        self.markers = self.settings.cluster_markers[self.settings.dataset]
        self.nb_clusters = 60
Ejemplo n.º 3
0
    def __init__(self, settings_filename=None, settings=None, 
                 tissue_id=None):
        if settings is None and settings_filename is None:
            raise ValueError("Either a settings object or a settings filename has to be given.")
        if not settings is None:
            self.settings = settings
        elif not settings_filename is None:
            self.settings = Settings(os.path.abspath(settings_filename), dctGlobals=globals())

        if not tissue_id is None:
            print('Overwriting settings ... ')
            self.settings = overwrite_settings(self.settings, tissue_id)
            print('tissue id: %s' % tissue_id)
            print('output_folder: %s' % self.settings.output_folder)

        for folder in self.settings.makefolders:
            if not os.path.exists(folder):
                os.makedirs(folder)
Ejemplo n.º 4
0
    def __init__(self, settings_filename=None, settings=None, tissue_id=None):
        if settings is None and settings_filename is None:
            raise ValueError("Either a settings object or a settings filename has to be given.")
        if not settings is None:
            self.settings = settings
        elif not settings_filename is None:
            self.settings = Settings(os.path.abspath(settings_filename), dctGlobals=globals())

        for folder in self.settings.makefolders:
            if not os.path.exists(folder):
                os.makedirs(folder)

        if not tissue_id is None:
            print('Overwriting settings ... ')
            self.settings = overwrite_settings(self.settings, tissue_id)
            print('tissue id: %s' % tissue_id)
            print('output_folder: %s' % self.settings.output_folder)

        self.sp = SpotDetector(settings=self.settings)
        self.fissure = FissureDetection(settings=self.settings)
        self.image_result_folder = os.path.join(self.settings.output_folder, 
                                                'cell_segmentation')
        if not os.path.isdir(self.image_result_folder):
            os.makedirs(self.image_result_folder)