Skip to content

Commit

Permalink
Merge tag 'v1.4.8' into develop
Browse files Browse the repository at this point in the history
Fix an issue with temporary directories.
  • Loading branch information
dputhier committed Dec 22, 2023
2 parents 42a74f3 + 27424dd commit 7ac8bc2
Show file tree
Hide file tree
Showing 114 changed files with 232 additions and 208 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: scigenex
Type: Package
Title: The scigenex package (Single-Cell Informative GENe Explorer)
Version: 1.4.7
Version: 1.4.8
Date: 2020-07-22
Author: J. Bavais, Sebastien Nin, Lionel Spinelli and Denis Puthier
Maintainer: J. Bavais <julie.bavais@yahoo.fr>
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MAKEFILE=Makefile
VERSION=1.4.7
VERSION=1.4.8

.PHONY: help

Expand All @@ -11,7 +11,7 @@ VERSION=1.4.7
help:
@echo ""
@echo "- Available targets:"
@echo "- Info: make check VERSION=1.4.2 "
@echo "- Info: make check VERSION=1.4.8 "
@perl -ne 'if( /^(\w+):/){print "\t",$$1,"\n"}' $(MAKEFILE)
@echo ""
@echo ""
Expand Down
41 changes: 30 additions & 11 deletions R/gene_clustering.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,20 @@ gene_clustering <- function(object = NULL,
inflation = 2,
method=c("closest_neighborhood", "reciprocal_neighborhood"),
threads = 1,
output_path = tempdir(),
output_path = NULL,
name = NULL,
keep_nn = FALSE) {

if(is.null(output_path)){
output_path <- tempdir()
dir.create(output_path, recursive = TRUE, showWarnings = FALSE)
}else{
if (!dir.exists(output_path)) {
dir.create(output_path, recursive = TRUE, showWarnings = FALSE)
}
}



method <- match.arg(method)

Expand Down Expand Up @@ -179,19 +189,24 @@ gene_clustering <- function(object = NULL,
#' @export construct_new_graph
construct_new_graph <- function(object = NULL,
k = 5,
output_path = tempdir(),
output_path = NULL,
name = NULL) {

if(is.null(output_path)){
output_path <- tempdir()
dir.create(output_path, recursive = TRUE, showWarnings = FALSE)
}

## Check format object arg
check_format_cluster_set(object)

## Generate output path
# Get working directory if output_path is "."
if (output_path == ".") {
output_path <- getwd()
}
# Check if output directory exists. If not stop the command.
if (!file.exists(output_path)) {
stop("Output directory provided does not exist.")

if (!dir.exists(output_path)) {
dir.create(output_path, recursive = TRUE, showWarnings = FALSE)
}

# Create a random string if name is not provided
Expand Down Expand Up @@ -376,17 +391,21 @@ construct_new_graph <- function(object = NULL,
#' @keywords internal
#' @export keep_dbf_graph
keep_dbf_graph <- function(object = NULL,
output_path = tempdir(),
output_path = NULL,
name = NULL) {

## Generate output path
if(is.null(output_path)){
output_path <- tempdir()
dir.create(output_path, recursive = TRUE, showWarnings = FALSE)
}

# Get working directory if output_path is "."
if (output_path == ".") {
output_path <- getwd()
}
# Check if output directory exists. If not stop the command.
if (!file.exists(output_path)) {
stop("Output directory provided does not exist.")

if (!dir.exists(output_path)) {
dir.create(output_path, recursive = TRUE, showWarnings = FALSE)
}

# Create a random string if name is not provided
Expand Down
3 changes: 3 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ html_preview: false
library("badger")
```

<img src="https://github.com/dputhier/scigenex/raw/master/inst/sticker/scigenex_logo.png" width="150" height="150" align="right"/>


```{r, echo = FALSE, results='asis'}
cat(
badge_lifecycle(stage = "stable", color="green"),
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<!-- README.md is generated from README.Rmd using devtools::build_readme(). Please edit README.Rmd -->
<!-- README.md is generated from README.Rmd using devtools::build_readme(). Please edit that file -->

<img src="https://github.com/dputhier/scigenex/raw/master/inst/sticker/scigenex_logo.png" width="150" height="150" align="right"/>

## ✔ Setting active project to '/Users/puthier/Documents/git/project_dev/scigenex'

[![](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![Project Status: Active - The project has reached a stable, usable
Expand All @@ -7,11 +11,10 @@ developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.re
[![License:
MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://cran.r-project.org/web/licenses/MIT)
[![](https://img.shields.io/github/last-commit/dputhier/scigenex.svg)](https://github.com/dputhier/scigenex/commits/main)
[![Codecov test coverage](https://codecov.io/gh/dputhier/scigenex/branch/main/graph/badge.svg)](https://app.codecov.io/gh/dputhier/scigenex?branch=main)

# SciGeneX repository

## :arrow_double_down: Installation
## :arrow\_double\_down: Installation

### System requirements

Expand Down Expand Up @@ -48,7 +51,7 @@ You may skip this step as the latest versions of SciGeneX will call
`scigenex::install_mcl()`to install MCL in `~/.scigenex` directory if
this program is not found in the PATH.

#### Installation of MCL using install_mcl()
#### Installation of MCL using install\_mcl()

The `install_mcl()` has been developed to ease MCL installation. This
function should be call automatically from within R when calling the
Expand Down Expand Up @@ -80,15 +83,15 @@ should be available in your PATH from within R.
## Example

The scigenex library contains several datasets including the
pbmc3k_medium which is a subset from pbmc3k 10X dataset.
pbmc3k\_medium which is a subset from pbmc3k 10X dataset.

library(Seurat)
library(scigenex)
set_verbosity(1)

# Load a dataset
load_example_dataset("7871581/files/pbmc3k_medium")

# Select informative genes
res <- select_genes(pbmc3k_medium,
distance = "pearson",
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

# Changelog

## v1.4.8

* Fix an issue with temp dir.

## v1.4.7

* Change k_g argument to 's' in `gene_clustering()` function for clarity purpose.
Expand Down
21 changes: 9 additions & 12 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
threshold: 1%
informational: true
language: R

sudo: false

cache: packages

after_success:

- Rscript -e 'covr::codecov()'
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/articles/usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">scigenex</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">1.4.7</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">1.4.8</span>
</span>
</div>

Expand Down Expand Up @@ -193,7 +193,7 @@ <h3 id="extracting-gene-modules-using-scigenex">Extracting gene modules using Sc
<span><span class="co">## * seed = 123 </span></span>
<span><span class="co">## * keep_nn = FALSE </span></span>
<span><span class="co">## * k_mcl_graph = 5 </span></span>
<span><span class="co">## * output_path = /var/folders/zy/wl3dj2_n76zfc8sdvny1q06c0000gn/T//Rtmp6UgYV7 </span></span>
<span><span class="co">## * output_path = /var/folders/zy/wl3dj2_n76zfc8sdvny1q06c0000gn/T//RtmpDSTiJs </span></span>
<span><span class="co">## * name = s8gZ5uYQ33 </span></span>
<span><span class="co">## * inflation = 2</span></span></code></pre>
<p>There are various methods associated with the <code>ClusterSet</code> objects.</p>
Expand Down Expand Up @@ -567,7 +567,7 @@ <h3 id="session-info">Session info<a class="anchor" aria-label="anchor" href="#s
<span><span class="co">## </span></span>
<span><span class="co">## other attached packages:</span></span>
<span><span class="co">## [1] tidyr_1.3.0 dplyr_1.1.3 </span></span>
<span><span class="co">## [3] scigenex_1.4.7 stxKidney.SeuratData_0.1.0</span></span>
<span><span class="co">## [3] scigenex_1.4.8 stxKidney.SeuratData_0.1.0</span></span>
<span><span class="co">## [5] stxBrain.SeuratData_0.1.1 pbmc3k.SeuratData_3.1.4 </span></span>
<span><span class="co">## [7] SeuratData_0.2.2 SeuratObject_4.1.3 </span></span>
<span><span class="co">## [9] Seurat_4.3.0 patchwork_1.1.2 </span></span>
Expand Down
6 changes: 3 additions & 3 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion docs/changelog.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7ac8bc2

Please sign in to comment.