rule make_CIRCOS_input_genes: #toevoegen aan make_CIRCOS_input
input:
bed="Reports/Locations_{type}_genes.bed"
output:
circos="Circos/{type}_genes.txt"
run:
bed_to_circos(input.bed, output.circos)
rule make_CIRCOS_zoom_plots:
"""Compare locations of known genes, recurrent regions from RUBIC and recurrent regions from GISTIC2."""
def get_list_genes_circos(wildcards):
"""Extract list of known genes to produce list of file names to save CIRCOS plot for each gene"""
list_genes = []
with open(os.path.join(workflow.basedir, config["prev_found_genes"])) as known:
for line in known:
gene = line.split("\t")[2]
gene_file = "Circos/KnownGenes/" + gene + ".png"
list_genes.append(gene_file)
return list_genes
rule plot_CIRCOS_per_gene: #Two genes won't plot because region is outside chromosome?
"""Compare locations of known genes, recurrent regions from RUBIC and recurrent regions from GISTIC2.
Use 'get_list_genes_circos' as input for a rule (e.g. rule all) to produce a plot for each known gene.'"""
input:
gistic="Reports/Circos/Zoom/GISTIC.txt", #all gistic regions
rubic="Reports/Circos/Zoom/RUBIC.txt", #all rubic regions
genes="Reports/Circos/Zoom/Genes.txt",
known="Reports/Locations_known_genes.bed", #use locations known genes to extract list of known genes and run rule for each gene maybe also not overlapping, but region around gene