Skip to content

Commit

Permalink
Merge pull request #27 from CCBR/fix/issue24
Browse files Browse the repository at this point in the history
Fix #23 and #24
  • Loading branch information
kopardev authored Feb 8, 2024
2 parents 82e2c0c + 91c6fff commit 07b6554
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## Development Version

## v1.0.1

- feat: aggregate raw counts for hervquant (plus TPM) #24
- fix: remove unnecessary normlization of locus and class aggregates (#23)
- feat: version control doc mike plugin added
- feat: GHA updates

## v1.0.0

- feat: add annotation to HOMER output #12
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.1
6 changes: 5 additions & 1 deletion workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ include: join("rules","init.smk")
def get_hervquant_output(wildcards):
filelist = list()
if GENOME.startswith("hg"):
filelist.extend(expand(join(WORKDIR,"results","hervquant","{replicate}","{replicate}.dummy"),replicate=REPLICATES))
filelist.extend(expand(join(WORKDIR,"results","hervquant","{replicate}","quant.sf"),replicate=REPLICATES))
filelist.extend(expand(join(WORKDIR,"results","hervquant","{replicate}","{replicate}.Aligned.out.filtered.bam"),replicate=REPLICATES))
filelist.append(join(WORKDIR,"results","hervquant","hervquant_rawcounts.tsv"))
filelist.append(join(WORKDIR,"results","hervquant","hervquant_rawcounts.xlsx"))
filelist.append(join(WORKDIR,"results","hervquant","hervquant_TPM.tsv"))
filelist.append(join(WORKDIR,"results","hervquant","hervquant_TPM.xlsx"))
return filelist

localrules: all
Expand Down
41 changes: 39 additions & 2 deletions workflow/rules/hervquant.smk
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ rule hervquant:
input:
unpack(get_hervquant_input),
output:
dummy = join(WORKDIR,"results","hervquant","{replicate}","{replicate}.dummy"),
quantsf = join(WORKDIR,"results","hervquant","{replicate}","quant.sf"),
filtered_bam = join(WORKDIR,"results","hervquant","{replicate}","{replicate}.Aligned.out.filtered.bam"),
params:
name = "{replicate}",
outdir = join(WORKDIR,"results","hervquant","{replicate}"),
peorse = get_peorse,
randomstr = str(uuid.uuid4()),
hervquantindexdir = join(INDEXDIR,"hervquant"),
hervquantindexdir = join(SCRIPTSDIR,"hervquant_aggregate.R"),
hervquant_final_reference = join(INDEXDIR,"hervquant","hervquant_final_reference.fa"),
threads: getthreads("hervquant")
envmodules: TOOLS["star"],
Expand Down Expand Up @@ -61,3 +61,40 @@ salmon quant \
-o {params.outdir} \
-p {threads}
"""

rule hervquant_aggregate:
input:
expand(join(WORKDIR,"results","hervquant","{replicate}","quant.sf"),replicate=REPLICATES),
output:
rawcounts_tsv = join(WORKDIR,"results","hervquant","hervquant_rawcounts.tsv"),
rawcounts_xlsx = join(WORKDIR,"results","hervquant","hervquant_rawcounts.xlsx"),
TPM_tsv = join(WORKDIR,"results","hervquant","hervquant_TPM.tsv"),
TPM_xlsx = join(WORKDIR,"results","hervquant","hervquant_TPM.xlsx"),
params:
outdir = join(WORKDIR,"results","hervquant"),
randomstr = str(uuid.uuid4()),
hervquant_aggregate_rscript = join(SCRIPTSDIR,"hervquant_aggregate.R"),
hervquant_lookup = join(INDEXDIR,"hervquant","herv_lookup.psv"),
threads: getthreads("hervquant")
envmodules: TOOLS["R"],
shell:"""
{SETSTR}
{TMPDIR_STR}
cd {params.outdir}
Rscript \\
{params.hervquant_aggregate_rscript} \\
--hervquantfolder {params.outdir} \\
--lookuptable {params.hervquant_lookup} \\
--outfile {output.rawcounts_tsv} \\
--exceloutfile {output.rawcounts_xlsx}
Rscript \\
{params.hervquant_aggregate_rscript} \\
--hervquantfolder {params.outdir} \\
--lookuptable {params.hervquant_lookup} \\
--outfile {output.TPM_tsv} \\
--exceloutfile {output.TPM_xlsx} \\
--counttype TPM
"""
4 changes: 2 additions & 2 deletions workflow/rules/homer.smk
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ done
analyzeRepeats.pl \\
repeats \\
{params.genome} \\
-d $list_of_dirs \\
-d $list_of_dirs -noadj \\
> {output.counts}
"""

Expand All @@ -99,7 +99,7 @@ done
analyzeRepeats.pl \\
repeats \\
{params.genome} \\
-d $list_of_dirs \\
-d $list_of_dirs -noadj \\
> {output.counts}
"""

Expand Down

0 comments on commit 07b6554

Please sign in to comment.