-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
99 additions
and
14 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 |
---|---|---|
@@ -1,16 +1,33 @@ | ||
library(tools) | ||
library(dplyr) | ||
library(reticulate) | ||
|
||
source("count_wrapper.R") | ||
source("R/count_wrapper.R") | ||
|
||
input1 <- "../data/Base1.fastq" | ||
guides_fasta <- "../data/small_sgRNA_library.fasta" | ||
# Define Conda environment and packages for counting script | ||
conda_dependencies <- c("pandas", "pyfastx", "python-edlib") | ||
conda_env_name <- "count-env" | ||
|
||
conda_create(conda_env_name, | ||
packages = conda_dependencies, | ||
channel = c("bioconda", "conda-forge")) | ||
use_condaenv(conda_env_name, required = TRUE) | ||
|
||
# Set the environment variables to ensure the correct python is used | ||
python_path <- conda_python(conda_env_name) | ||
Sys.setenv(RETICULATE_PYTHON = python_path) | ||
Sys.setenv(PATH = paste(dirname(python_path), Sys.getenv("PATH"), sep = ":")) | ||
|
||
# input parameter setup | ||
input1 <- "datasets/base/fastqfiles/Base1.fastq" | ||
guides_fasta <- "datasets/base/guidelibrary/small_sgRNA_library.fasta" | ||
outdir <- "test" | ||
sample_name <- tools::file_path_sans_ext(basename(input1)) | ||
sample_name <- basename(input1) %>% | ||
strsplit(., "(.fastq|.fq)") %>% | ||
first() %>% | ||
first() | ||
|
||
# call the count wrapper function | ||
count_output <- count(input1, | ||
guides_fasta, | ||
outdir, | ||
sample_name, | ||
guide_len = 20, | ||
primer = "TATTTATTTTGCTACTTAATAATTGGGACT", | ||
mismatches = 1) | ||
sample_name) |
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