Skip to content

Commit

Permalink
fix #35
Browse files Browse the repository at this point in the history
  • Loading branch information
ChangqingW committed Aug 23, 2024
1 parent 2884c96 commit d4727af
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ RUN Rscript -e "options(repos = c(CRAN = 'https://cran.r-project.org')); devtool

RUN sudo apt-get update && sudo apt-get install -y samtools minimap2 && wget -O- https://github.com/attractivechaos/k8/releases/download/v1.2/k8-1.2.tar.bz2 | tar -jx

RUN sudo ln -s /home/rstudio/k8-1.2/k8-x86_64-Linux /bin/k8 && sudo ln -s /home/rstudio/k8-1.2/k8-x86_64-Linux /home/rstudio/k8
RUN sudo ln -s /home/rstudio/k8-1.2/k8-x86_64-Linux /bin/k8

USER rstudio

RUN Rscript -e "basilisk::basiliskRun(env = FLAMES:::flames_env, fun = function(){})"

USER root

RUN chmod -R 777 /home/rstudio
13 changes: 10 additions & 3 deletions R/minimap2_align.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ minimap2_align <- function(config, fa_file, fq_in, annot, outdir, minimap2 = NA,
if (config$alignment_parameters$use_junctions) {
file.remove(file.path(outdir, "tmp_splice_anno.bed12"))
}
return(get_flagstat(file.path(outdir, paste0(prefix, "align2genome.bam")), samtools))

if (!is.na(samtools)) {
return(get_flagstat(file.path(outdir, paste0(prefix, "align2genome.bam")), samtools))
}
# No equivalent to samtools flagstat in Rsamtools
# Rsamtools::quickBamFlagSummary does not return anything
}


Expand Down Expand Up @@ -221,8 +226,10 @@ minimap2_realign <- function(config, fq_in, outdir, minimap2, samtools = NULL, p
}
file.remove(file.path(outdir, paste0(prefix, "tmp_align.bam")))

return(get_flagstat(file.path(outdir, paste0(prefix, "realign2transcript.bam")),
samtools))
if (!is.na(samtools)) {
return(get_flagstat(file.path(outdir, paste0(prefix, "realign2transcript.bam")),
samtools))
}
}

#' Sys.which wrapper
Expand Down

0 comments on commit d4727af

Please sign in to comment.