def handle(self, *args, **options): project_id = args[0] project = Project.objects.get(project_id=project_id) file_map = {} for path in os.listdir(args[1]): sample = path.replace(".bam.csv", "") sample = sample.replace(".", "") sample = sample.replace("-", "") file_map[sample] = os.path.abspath(os.path.join(args[1], path)) for indiv in project.get_individuals(): sample = indiv.indiv_id.replace("-", "") if sample in file_map: indiv.exome_depth_file = file_map[sample] indiv.save() get_cnv_store().add_sample(str(indiv.pk), open(indiv.exome_depth_file))
def handle(self, *args, **options): project_id = args[0] project = Project.objects.get(project_id=project_id) file_map = {} for path in os.listdir(args[1]): sample = path.replace('.bam.csv', '') sample = sample.replace('.', '') sample = sample.replace('-', '') file_map[sample] = os.path.abspath(os.path.join(args[1], path)) for indiv in project.get_individuals(): sample = indiv.indiv_id.replace('-', '') if sample in file_map: indiv.exome_depth_file = file_map[sample] indiv.save() get_cnv_store().add_sample(str(indiv.pk), open(indiv.exome_depth_file))
def clean_project(project_id): """ Clear data for this project from all the xbrowse resources: - datastore - coverage store - cnv store Does not remove any of the project's data links - so no data is lost, but everything must be rebuilt """ project = Project.objects.get(project_id=project_id) individuals = project.get_individuals() # datastore get_mall(project_id).variant_store.delete_project(project_id) # coverage store for individual in individuals: get_coverage_store().remove_sample(individual.get_coverage_store_id()) # cnv store for individual in individuals: get_cnv_store().remove_sample(individual.get_coverage_store_id())
def get_gene_diangostic_info(family, gene_id, variant_filter=None): diagnostic_info = GeneDiagnosticInfo(gene_id) diagnostic_info._gene_phenotype_summary = get_gene_phenotype_summary( get_reference(), gene_id) diagnostic_info._gene_sequencing_summary = get_gene_sequencing_summary( get_coverage_store(), family, gene_id) diagnostic_info._variants = get_diagnostic_search_variants_in_family( get_mall(family.project).variant_store, family, gene_id, variant_filter) diagnostic_info._cnvs = get_diagnostic_search_cnvs_in_family( get_cnv_store(), family, gene_id, ) return diagnostic_info
def get_gene_diangostic_info(family, gene_id, variant_filter=None): diagnostic_info = GeneDiagnosticInfo(gene_id) diagnostic_info._gene_phenotype_summary = get_gene_phenotype_summary(get_reference(), gene_id) diagnostic_info._gene_sequencing_summary = get_gene_sequencing_summary(get_coverage_store(), family, gene_id) diagnostic_info._variants = get_diagnostic_search_variants_in_family( get_mall(family.project).variant_store, family, gene_id, variant_filter ) diagnostic_info._cnvs = get_diagnostic_search_cnvs_in_family( get_cnv_store(), family, gene_id, ) return diagnostic_info