Beispiel #1
0
    def perform_hotspot(self):
        self.project_config = config_mongo.get_project_config()
        hotspot_file = self.project_config['hotspot_file']
        hotspot_dir = self.project_config['hotspot_dir']

        output_dir = hotspot_dir + "/hotspot_output"

        if os.path.isdir(output_dir):
            self.__log_hotspot_files_already_exist()
        else:
            bash.make_dir(output_dir)

            ref_fasta = self.project_config['ref_fasta']
            bed_file = self.project_config['project_bed']
            tvc_params = self.project_config['tvc_params']

            bam_files = sampleinfo_mongo.get_bam_files()

            # HOTSPOT ALL OF THE BAM FILES
            self.__hotspot_bam_files(bam_files, hotspot_file, output_dir, ref_fasta, bed_file, tvc_params)

        # Delete the filter files
        all_files = glob(output_dir+"/*")
        for vcf in all_files:
            if "filtered.vcf" in vcf:
                bash.remove_file(vcf)
Beispiel #2
0
    def __ensure_directory(self, number=0):
        hotspot_dir = "%s/hotspots" % self.project_config['output_dir']
        bash.make_dir(hotspot_dir)
        config_mongo.change_config_field('hotspot_dir', hotspot_dir)

        directory = '%s/%s' % (hotspot_dir, number)
        bash.make_dir(directory)

        return directory
Beispiel #3
0
    def __init__(self):
        self.project_config = config_mongo.get_project_config()
        self.logger = Logger.get_logger()

        self.annotations_dir = '%s/annotations' % self.project_config['output_dir']
        if 'annotation_dir' not in self.project_config or not\
                os.path.isdir(self.project_config['annotation_dir']):
            bash.make_dir(self.annotations_dir)
            config_mongo.change_config_field('annotation_dir', self.annotations_dir)
        else:
            self.annotations_dir = self.project_config['annotation_dir']
Beispiel #4
0
    def __init__(self):
        """
        This init method is different in that it will create the annotation_dir config parameter if it doesn't
        already exist. This is not necessarily the most elegant way to do this, but it works.
        :return:
        """
        self.project_config = config_mongo.get_project_config()
        self.logger = Logger.get_logger()

        # Creates the annotation_dir if needed and loads it into the config file
        self.annotations_dir = '%s/annotations' % self.project_config['output_dir']
        if 'annotation_dir' not in self.project_config or not\
                os.path.isdir(self.project_config['annotation_dir']):
            bash.make_dir(self.annotations_dir)
            config_mongo.change_config_field('annotation_dir', self.annotations_dir)
        else:
            self.annotations_dir = self.project_config['annotation_dir']