-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merged devel into c++ find_isoform version
- Loading branch information
Showing
65 changed files
with
6,745 additions
and
683 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
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,65 @@ | ||
#' BLAZE Assign reads to cell barcodes. | ||
#' | ||
#' @description | ||
#' Uses BLAZE to generate barcode list and assign reads to cell barcodes. | ||
#' Uses default options for BLAZE, see BLAZE documentation for details (https://github.com/shimlab/BLAZE). | ||
#' | ||
#' @param blaze_config List, additional BLAZE configuration parameters | ||
#' @param fq_in File path to the fastq file used as a query sequence file | ||
#' | ||
#' @return a \code{data.frame} summarising the reads aligned | ||
#' | ||
#' @importFrom parallel detectCores | ||
#' @export | ||
#' @examples | ||
#' temp_path <- tempfile() | ||
#' bfc <- BiocFileCache::BiocFileCache(temp_path, ask = FALSE) | ||
#' bc_list_10x_url <- 'https://github.com/shimlab/BLAZE/blob/main/10X_bc/3M-february-2018.zip' | ||
#' bc_list_10x <- bfc[[names(BiocFileCache::bfcadd(bfc, 'bc_list_10x', bc_list_10x_url))]] | ||
#' fastq1_url <- 'https://raw.githubusercontent.com/shimlab/BLAZE/main/test/data/FAR20033_pass_51e510db_100.fastq' | ||
#' fastq1 <- bfc[[names(BiocFileCache::bfcadd(bfc, 'Fastq1', fastq1_url))]] | ||
#' outdir <- tempfile() | ||
#' dir.create(outdir) | ||
#' config = jsonlite::fromJSON(system.file('extdata/blaze_flames.json', package = 'FLAMES')) | ||
#' config$blaze_parameters['output-prefix'] <- outdir | ||
#' blaze(config$blaze_parameters, fastq1) | ||
#' @importFrom reticulate import_from_path dict | ||
#' @export | ||
blaze <- function(blaze_config, fq_in) { | ||
|
||
# command line arguments for blaze | ||
blaze_argv <- paste("") | ||
|
||
if (blaze_config['overwrite'] == TRUE) { | ||
blaze_argv <- paste(blaze_argv, '--overwrite ') | ||
} | ||
blaze_config['overwrite'] <- NULL | ||
for (arg in names(blaze_config)) { | ||
blaze_argv <- paste(blaze_argv, paste0('--',arg), blaze_config[arg])} | ||
|
||
# prepare 10X whitelist | ||
temp_path <- tempfile() | ||
bfc <- BiocFileCache::BiocFileCache(temp_path, ask = FALSE) | ||
bc_list_10x_url <- 'https://github.com/shimlab/BLAZE/raw/main/10X_bc/3M-february-2018.zip' | ||
cat('Downloading the full whitelist from 10X...') | ||
bc_list_10x <- bfc[[names(BiocFileCache::bfcadd(bfc, 'bc_list_10x', bc_list_10x_url))]] | ||
blaze_argv <- paste(blaze_argv, '--full-bc-whitelist', bc_list_10x) | ||
|
||
blaze_argv <- paste(blaze_argv, fq_in) | ||
|
||
ret <- | ||
callBasilisk(flames_env, function(blaze_argv) { | ||
|
||
blaze_path <- system.file("blaze", package = "FLAMES") | ||
cat("Running BLAZE...\n") | ||
cat("Argument: ", blaze_argv, "\n") | ||
blaze <- | ||
reticulate::import_from_path("blaze", blaze_path) | ||
ret <- | ||
blaze$main(blaze_argv) | ||
|
||
ret | ||
}, blaze_argv = blaze_argv | ||
) | ||
#ret # return the filename of demultiplexed fastq | ||
} |
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 @@ | ||
#' FLAMES: full-length analysis of mutations and splicing | ||
#' @name FLAMES | ||
#' @useDynLib FLAMES, .registration=TRUE | ||
NULL |
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,66 +1,31 @@ | ||
# flames_nopysam_env <- BasiliskEnvironment( | ||
# envname = "flames_nopysam_env", pkgname = "FLAMES", | ||
# packages = c( | ||
# "python==2.7.15.0", | ||
# # "minimap2==2.17", | ||
# "numpy==1.16.5", | ||
# "editdistance==0.5.3", | ||
# "bamnostic==1.1.7" | ||
# ), | ||
# channels = c("bioconda", "conda-forge") | ||
# ) | ||
|
||
#' @importFrom basilisk BasiliskEnvironment | ||
flames_env <- BasiliskEnvironment( | ||
envname = "flames_env", pkgname = "FLAMES", | ||
pip = c("fast-edit-distance==1.2.0"), | ||
packages = c( | ||
"python==3.7", | ||
# "minimap2==2.17", | ||
"numpy==1.16.5", | ||
"editdistance==0.5.3", | ||
"scipy==1.2.0", | ||
"pysam==0.18.0" | ||
"python==3.10", | ||
"numpy==1.25.0", | ||
"editdistance==0.6.2", | ||
"scipy==1.11.1", | ||
"pysam==0.21.0", | ||
"cutadapt==4.4", | ||
"tqdm==4.64.1", | ||
"matplotlib==3.5.3", | ||
"pandas==1.3.5", | ||
"biopython==1.79" | ||
), | ||
channels = c("bioconda", "conda-forge") | ||
channels = c("conda-forge", "bioconda", "defaults") | ||
) | ||
# flames_env <- BasiliskEnvironment(envname="full_env", | ||
# pkgname="FLAMES", | ||
# packages=c("python==2.7.15.0", | ||
# "pysam==0.16.0.1", | ||
# "minimap2==2.17", | ||
# "numpy==1.16.5", | ||
# "editdistance==0.5.3", | ||
# "bzip2==1.0.8", | ||
# "c-ares==1.11.0", | ||
# "ca-certificates==2020.11.8", | ||
# "certifi==2019.11.28", | ||
# "htslib==1.11", | ||
# "k8==0.2.5", | ||
# "krb5==1.17.1", | ||
# "libblas==3.9.0", | ||
# "libcblas==3.9.0", | ||
# "libcurl==7.71.1", | ||
# "libcxx==11.0.0", | ||
# "libdeflate==1.6", | ||
# "libedit==3.1.20191231", | ||
# "libev==4.33", | ||
# "libffi==3.2.1", | ||
# "libgfortran==3.0.0", | ||
# "libgfortran5==9.3.0", | ||
# "liblapack==3.9.0", | ||
# "libnghttp2==1.41.0", | ||
# "libopenblas==0.3.12", | ||
# "libssh2==1.9.0", | ||
# "llvm-openmp==11.0.0", | ||
# "ncurses==6.2", | ||
# "openssl==1.1", | ||
# #"pip==20.1.1", | ||
# "python_abi==2.7", | ||
# "readline==8.0", | ||
# "setuptools==44.0.0", | ||
# "sqlite==3.33.0", | ||
# "tk==8.6.10", | ||
# "wheel==0.35.1", | ||
# "xz==5.2.5", | ||
# "zlib==1.2.11"), | ||
# channels=c("bioconda", "conda-forge")) | ||
|
||
# blaze_env <- BasiliskEnvironment( | ||
# envname = "blaze_env", pkgname = "FLAMES", | ||
# pip = c("fast-edit-distance==1.2.0"), | ||
# channels = c('conda-forge','bioconda', 'defaults'), | ||
# packages = c( | ||
# "python==3.7", | ||
# "biopython==1.79", #blaze specific | ||
# "pandas==1.3.5",#blaze specific | ||
# "numpy==1.21.6", #blaze specific | ||
# "matplotlib==3.5.3", #blaze specific | ||
# "tqdm==4.64.1" | ||
# )) |
Oops, something went wrong.