Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: genefuse wrapper * fix: set strict mode for conda channels * feat: write output files to a temp folder * docs: update meta data * Removed format * Added URL * Changed extra * Removed format * Removed format * Removed format * Removed format * Removed patch version Co-authored-by: Filipe G. Vieira <fgarrettvieira@gmail.com>
- Loading branch information
Showing
10 changed files
with
107 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
channels: | ||
- bioconda | ||
- conda-forge | ||
- defaults | ||
dependencies: | ||
- genefuse=0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: GeneFuse | ||
description: A tool to detect and visualize target gene fusions by scanning FASTQ files directly. | ||
url: https://github.com/OpenGene/GeneFuse | ||
authors: | ||
- Patrik Smeds | ||
input: | ||
- fastq files | ||
- gene fuse settings files | ||
- refeference genome | ||
output: | ||
- txt file with fusions | ||
- html report | ||
- json report | ||
notes: | | ||
* The `extra` param allows for additional program arguments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
rule genefuse: | ||
input: | ||
fastq1="reads/{sample}_R1.fastq", | ||
fastq2="reads/{sample}_R2.fastq", | ||
config="genes.csv", | ||
reference="genome.fasta", | ||
output: | ||
html="{sample}_genefuse_report.html", | ||
json="{sample}_genefuse_report.json", | ||
fusions="{sample}_fusions.txt", | ||
log: | ||
"logs/{sample}_genefuse.log", | ||
params: | ||
# optional parameters | ||
extra="", | ||
threads:1 | ||
wrapper: | ||
"master/bio/genefuse" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
>GENE,chr1:10-70 | ||
1,15,20 | ||
2,25,30 | ||
3,35,40 | ||
4,45,50 | ||
5,55,60 | ||
6,65,70 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
>chr1 | ||
GCTAGCTCAGAAAAAAAAAAGATGCGAGGCGTAGGCGATGCGATCGATCGATCTATAGGCTCGAGGCTAGGGCTAGCTGA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@1 | ||
CTCAGGAGGC | ||
+ | ||
!!!!!!!!!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@1 | ||
CTCAGGAGGC | ||
+ | ||
!!!!!!!!!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
__author__ = "Patrik Smeds" | ||
__copyright__ = "Copyright 2022, Patrik Smeds" | ||
__email__ = "patrik.smeds@scilifelab.uu.se" | ||
__license__ = "MIT" | ||
|
||
|
||
from snakemake.shell import shell | ||
from tempfile import TemporaryDirectory | ||
|
||
# Formats the log redrection string | ||
log = snakemake.log_fmt_shell(stdout=False, stderr=True) | ||
|
||
extra = snakemake.params.get("extra", "") | ||
|
||
with TemporaryDirectory() as tempdir: | ||
# Executed shell command | ||
html_path = f"{tempdir}/genefuse.html" | ||
json_path = f"{tempdir}/genefuse.json" | ||
txt_path = f"{tempdir}/gene_fuse_fusions.txt" | ||
shell( | ||
"(genefuse " | ||
"-r {snakemake.input.reference} " | ||
"-t {snakemake.threads} " | ||
"-f {snakemake.input.config} " | ||
"-1 {snakemake.input.fastq1} " | ||
"-2 {snakemake.input.fastq2} " | ||
"-h {html_path} " | ||
"-j {json_path} " | ||
"{extra} > " | ||
"{txt_path}) " | ||
"{log}" | ||
) | ||
|
||
if snakemake.output.get("html", None): | ||
shell("mv {html_path} {snakemake.output.html}") | ||
|
||
if snakemake.output.get("json", None): | ||
shell("mv {json_path} {snakemake.output.json}") | ||
|
||
if snakemake.output.get("fusions", None): | ||
shell("mv {txt_path} {snakemake.output.fusions}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters