Skip to content

Commit

Permalink
Viloca touch ups
Browse files Browse the repository at this point in the history
- snakemake handles `directory()`
- VILOCA 1.0.0 on bioconda
- use GitLab for smallgenomeutilites due to GitHub LFS limitations
  • Loading branch information
DrYak committed Jun 7, 2024
1 parent 4ccd9d8 commit 2af73f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion workflow/envs/paired_end_read_merger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ dependencies:
- git-lfs
- pip
- pip:
- git+https://github.com/cbg-ethz/smallgenomeutilities@dev
- git+https://git.bsse.ethz.ch/cbg/viruses/smallgenomeutilities@dev
3 changes: 2 additions & 1 deletion workflow/envs/viloca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ channels:
dependencies:
- libshorah
- python=3.10.4
- viloca
- viloca=1.0.0
- coreutils # [not linux]
17 changes: 8 additions & 9 deletions workflow/rules/snv.smk
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,14 @@ rule viloca:
output:
SNVs="{dataset}/variants/SNVs/snvs.vcf",
CSV="{dataset}/variants/SNVs/snv/cooccurring_mutations.csv",
WORK_DIR=directory("{dataset}/variants/SNVs"),
params:
READ_LEN=read_len,
INSERT_FILE=config.viloca["insert_bedfile"],
MODE=config.viloca["mode"],
SHIFT=config.viloca["shift"],
OUTDIR="{dataset}/variants/SNVs",
EXTRA=config.viloca["extra"],
VILOCA=config.applications["viloca"],
WORK_DIR="{dataset}/variants/SNVs",
log:
outfile="{dataset}/variants/SNVs/viloca.out.log",
errfile="{dataset}/variants/SNVs/viloca.err.log",
Expand All @@ -377,20 +376,20 @@ rule viloca:
# Get absolute path for input files
CWD=${{PWD}}
BAM=${{PWD}}/{input.BAM}
REF={input.REF}; [[ ${{REF}} =~ ^/ ]] || REF=${{PWD}}/${{REF}}
OUTFILE=${{PWD}}/{log.outfile}
ERRFILE=${{PWD}}/{log.errfile}
WORK_DIR=${{PWD}}/{params.WORK_DIR}
WORK_DIR="$(realpath -m {ouput.WORK_DIR})"
BAM="$(realpath {input.BAM})"
REF="$(realpath {input.REF})"
OUTFILE="$(realpath -m {log.outfile})"
ERRFILE="$(realpath -m {log.errfile})"
# Create directory for running VILOCA
DIR=${{WORK_DIR}}
DIR="${{WORK_DIR}}"
if [[ ! -d "${{DIR}}" ]]; then
echo "Creating directory ${{DIR}}" >> $OUTFILE
mkdir -p ${{DIR}}
fi
# Change to the directory where VILOCA is to be executed
cd ${{DIR}}
cd "${{DIR}}"
# Run VILOCA
echo "Running VILOCA" >> $OUTFILE
Expand Down

0 comments on commit 2af73f9

Please sign in to comment.