Skip to content
Snippets Groups Projects
Commit 380bc1d3 authored by BIOPZ-Schmidt Ralf's avatar BIOPZ-Schmidt Ralf
Browse files

updated relative usage inference script to include the reporting of single distal sites

parent 9cec9d8b
Branches
No related tags found
No related merge requests found
......@@ -12,8 +12,12 @@ PAQR/.snakemake/
PAQR/scripts/deNovo-used-sites-and-usage-inference.testVersion.py
KAPAC/doIt.sh
KAPAC/RESULTS/
KAPAC/RESULTS_FORMER.log
KAPAC/RESULTS_FORMER/
KAPAC/RESULTS_FORMER_AFTER_CLEANUP/
KAPAC/RESULTS.log
# Rhistory
*.Rhistory
KAPAC/DATA/kmer_counts_all.tsv
# exclude the gitignore as well
.gitignore
......@@ -83,6 +83,7 @@ rule infer_relative_usage:
output:
relUse = "{study}/relative_usages.tsv",
expressions = "{study}/tandem_pas_expressions.tsv",
distal_sites = "{study}/single_distal_sites.tsv"
header = "{study}/relative_usages.header.out"
params:
script_dir = config['dir.scripts'],
......@@ -115,9 +116,8 @@ rule infer_relative_usage:
conds_string = " ".join(conds)
extens_string = " ".join(extens)
shell('''
{params.py2_env_path}/py2_paqr/bin/python {params.script_dir}/deNovo-used-sites-and-usage-inference.py \
{params.py2_env_path}/py2_paqr/bin/python {params.script_dir}/deNovo-used-sites-and-usage-inference.single_distal_included.py \
--verbose \
--expressions_out {output.expressions} \
--clusters {params.clusters} \
--coverages {input.coverages} \
--conditions {conds_string} \
......@@ -131,11 +131,12 @@ rule infer_relative_usage:
--best_break_point_upstream_extension {params.valid_region_upstream_of_cluster_to_locate_globalBestBreakPoint_in} \
--processors {threads} \
--max_downstream_coverage {params.max_downstream_cov_relative_to_start} \
--expressions_out {output.expressions} \
--distal_sites {output.distal_sites} \
> {output.relUse} \
2> {log}
''')
#-------------------------------------------------------------------------------
# create design file for polyA-MARA
#-------------------------------------------------------------------------------
......@@ -172,7 +173,8 @@ rule design_file:
rule tpm_normalize:
##LOCAL##
input:
expression = "{study}/tandem_pas_expressions.tsv"
expression = "{study}/tandem_pas_expressions.tsv",
distal_sites = "{study}/single_distal_sites.tsv"
output:
tpm_expr = "{study}/tandem_pas_expressions.rpm.tsv"
run:
......@@ -188,6 +190,13 @@ rule tpm_normalize:
continue
libsizes[ i - 10 ] += float(F[i])
with open(input.distal_sites, "r") as distal_in:
for line in distal_in:
for i in range(10, len(F)):
if float(F[i]) == -1:
continue
libsizes[ i - 10 ] += float(F[i])
with open(output.tpm_expr, "w") as ofile:
with open(input.expression, "r") as ifile:
for line in ifile:
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment