Skip to content

Commit

Permalink
test on RNAseq, ATACseq, scRNAseq, clean code and fix cosmetics #11
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichl committed Mar 19, 2024
1 parent e34746d commit 5b11c07
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 1 addition & 3 deletions config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# always use absolute paths

##### RESOURCES #####
# memory (mem) in MB
Expand Down Expand Up @@ -49,5 +48,4 @@ file_type: "pdf"
# define custom colors (in HEX) for groups from the annotation file
track_colors:
untreated: "#800080"
LO28_2h: "#00FFFF"
LO28_6h: "#FF0000"
treated: "#00FFFF"
1 change: 1 addition & 0 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ sc_groups = list(set(group for data in sc_file_group_dict.values() for group in

# groups for actual visualization
plot_groups = sc_groups + list(set([group for group in annot['group'] if not group.endswith('.tsv')]))
plot_groups.sort()

result_path = os.path.join(config["result_path"], module_name)

Expand Down
4 changes: 2 additions & 2 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def get_bams(wildcards):
else:
return annot.loc[annot['group']==wildcards.group,'bam'].to_list()

def get_bigWigs(wildcards):
return expand(os.path.join(result_path, 'bigWigs','{group}.bw'),group=plot_groups)
# def get_bigWigs(wildcards):
# return expand(os.path.join(result_path, 'bigWigs','{group}.bw'),group=sort(plot_groups))

def parse_gene(gene):
count = 0
Expand Down
2 changes: 2 additions & 0 deletions workflow/rules/prepare.smk
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# create BED file of genes/genomic regions
rule make_bed:
input:
config["gene_list"],
output:
bed_file = os.path.join(result_path,'genes.bed'),
resources:
Expand Down
9 changes: 5 additions & 4 deletions workflow/rules/visualization.smk
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ rule ucsc_hub:
track = ['track {}'.format(group),
'shortLabel {}'.format(group),
'longLabel {}'.format(group),
'bigDataUrl {}.bigWig'.format(group),
'bigDataUrl {}.bw'.format(group),
'parent {} on'.format(config["project_name"]),
'type bigWig', 'windowingFunction mean',
'color {}'.format(track_color),
'color {}'.format(','.join(map(str, track_color))),
'', '']

track_db += track
Expand All @@ -66,7 +66,8 @@ rule ucsc_hub:
# plot genome tracks of groups using pyGenomeTracks wrapper gtracks
rule plot_tracks:
input:
get_bigWigs,
bigWigs = expand(os.path.join(result_path, 'bigWigs','{group}.bw'), group=plot_groups),
# get_bigWigs,
output:
genome_track = report(os.path.join(result_path, 'tracks','{gene}.'+config["file_type"]),
caption="../report/genome_tracks.rst",
Expand Down Expand Up @@ -101,7 +102,7 @@ rule plot_tracks:
export GTRACKS_GENES_PATH={params.genome_bed}
gtracks {params.coordinates} \
{input} \
{input.bigWigs} \
{output.genome_track} \
--genes {params.genome_bed} \
{params.ymax} \
Expand Down

0 comments on commit 5b11c07

Please # to comment.