Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test + new name #3

Merged
merged 7 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "StereoSSAM"
name = "Sainsc"
uuid = "4c4340ea-7f9e-46b4-8512-61f1f6c41a11"
authors = ["Niklas Müller-Bötticher <[email protected]>"]
version = "0.1.0"
Expand Down Expand Up @@ -28,15 +28,18 @@ CellScopesExt = "CellScopes"
SingleCellProjectionsExt = "SingleCellProjections"

[compat]
BlockArrays = "0.16,1"
CSV = "0.10"
CategoricalArrays = "0.9,0.10"
DataFrames = "1"
ImageFiltering = "0.7"
LinearAlgebra = "1"
Muon = "0.2"
OffsetArrays = "1.11"
PooledArrays = "1"
SparseArrays = "1"
Unzip = "0.2"
julia = "1.9"
AutomaticSingleCellToolbox = "0.9"
BlockArrays = "0.16,1"
CSV = "0.10"
CategoricalArrays = "0.9,0.10"
CellScopes = "1"
DataFrames = "1"
ImageFiltering = "0.7"
LinearAlgebra = "1"
Muon = "0.2"
OffsetArrays = "1.11"
PooledArrays = "1"
SparseArrays = "1"
SingleCellProjections = "0.3"
Unzip = "0.2"
julia = "1.9"
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
# StereoSSAM.jl
# Sainsc.jl

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://niklasmueboe.github.io/StereoSSAM.jl/stable)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://niklasmueboe.github.io/StereoSSAM.jl/dev)
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://niklasmueboe.github.io/Sainsc.jl/stable)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://niklasmueboe.github.io/Sainsc.jl/dev)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)

/ˈsaiəns/

_"**S**egmentation-free **A**nalysis of **In S**itu **C**apture data"_
or alternatively
"_**S**tupid **A**cronyms **In Sc**ience_"

## Installation

The package can be installed with the Julia package manager.
From the Julia REPL, type `]` to enter the `Pkg` REPL mode and run:

```
pkg> add StereoSSAM
pkg> add Sainsc
```

Or, alternatively, via the `Pkg` API:

```julia
using Pkg
Pkg.add("StereoSSAM")
Pkg.add("Sainsc")
```

## Documentation

The documentation for StereoSSAM.jl is available [here](https://niklasmueboe.github.io/StereoSSAM.jl/stable).
It includes the [Reference API](https://niklasmueboe.github.io/StereoSSAM.jl/stable/api)
as well as an [example analysis](https://niklasmueboe.github.io/StereoSSAM.jl/stable/examples/ExampleAnalysis).
The documentation for Sainsc.jl is available [here](https://niklasmueboe.github.io/Sainsc.jl/stable).
It includes the [Reference API](https://niklasmueboe.github.io/Sainsc.jl/stable/api)
as well as an [example analysis](https://niklasmueboe.github.io/Sainsc.jl/stable/examples/ExampleAnalysis).
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
StereoSSAM = "4c4340ea-7f9e-46b4-8512-61f1f6c41a11"
Sainsc = "4c4340ea-7f9e-46b4-8512-61f1f6c41a11"

[compat]
Documenter = "1.3"
Expand Down
11 changes: 4 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
using Documenter
using DocumenterInterLinks
using StereoSSAM
using Sainsc

links = InterLinks(
# "CategoricalArrays" => "https://categoricalarrays.juliadata.org/stable/",
# "DataFrames" => "https://dataframes.juliadata.org/stable/",
# "OffsetArrays" => "https://juliaarrays.github.io/OffsetArrays.jl/stable/",
"Muon" => "https://scverse.org/Muon.jl/dev/",
"SparseArrays" => (
"https://docs.julialang.org/en/v1/stdlib/SparseArrays/",
"https://docs.julialang.org/en/v1/objects.inv",
),
"SparseArrays" => "https://docs.julialang.org/en/v1/",
)

makedocs(;
sitename="StereoSSAM.jl",
sitename="Sainsc.jl",
pages=[
"Home" => "index.md",
"Example analysis" => "examples/ExampleAnalysis.md",
Expand All @@ -25,4 +22,4 @@ makedocs(;
format=Documenter.HTML(; size_threshold_ignore=["examples/ExampleAnalysis.md"]),
)

deploydocs(; repo="github.com/niklasmueboe/StereoSSAM.jl.git")
deploydocs(; repo="github.com/niklasmueboe/Sainsc.jl.git")
12 changes: 6 additions & 6 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Reference API

Documentation for `StereoSSAM.jl`'s public interface.
Documentation for `Sainsc.jl`'s public interface.

## Index

Expand All @@ -12,10 +12,10 @@ Pages = ["api.md"]

```@autodocs
Modules = [
StereoSSAM.GridCount,
StereoSSAM.IO,
StereoSSAM.Utils,
StereoSSAM.KDE,
StereoSSAM.LocalMax,
Sainsc.GridCount,
Sainsc.IO,
Sainsc.Utils,
Sainsc.KDE,
Sainsc.LocalMax,
]
```
8 changes: 4 additions & 4 deletions docs/src/examples/ExampleAnalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# Example analysis

This is an example workflow demonstrating all the different functionalities the
`StereoSSAM.jl` package offers.
`Sainsc.jl` package offers.

## General workflow

We start by loading the package and defining the path of some example data.
=#

using StereoSSAM
using Sainsc

using ImageTransformations
using ImageShow
Expand Down Expand Up @@ -97,7 +97,7 @@ println("$(length(lm)) local maxima detected")
#=
Once we identified the local maxima we can load them for a defined set of genes.
[`getlocalmaxima`](@ref) allows you to load the maxima in a variety of output types.
Have a look at the existing `StereoSSAM.jl` extensions. Here we are going to load them
Have a look at the existing `Sainsc.jl` extensions. Here we are going to load them
as `Muon.AnnData` object.
=#

Expand Down Expand Up @@ -154,7 +154,7 @@ simshow(imresize(celltype_img; ratio=1 / 45))
#=
## Utils

Some additional useful functions are included in `StereoSSAM.jl`.
Some additional useful functions are included in `Sainsc.jl`.

### Cropping & Masking

Expand Down
8 changes: 4 additions & 4 deletions docs/src/examples/ExampleAnalysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ EditURL = "ExampleAnalysis.jl"
# Example analysis

This is an example workflow demonstrating all the different functionalities the
`StereoSSAM.jl` package offers.
`Sainsc.jl` package offers.

## General workflow

We start by loading the package and defining the path of some example data.

````julia
using StereoSSAM
using Sainsc

using ImageTransformations
using ImageShow
Expand Down Expand Up @@ -129,7 +129,7 @@ println("$(length(lm)) local maxima detected")

Once we identified the local maxima we can load them for a defined set of genes.
[`getlocalmaxima`](@ref) allows you to load the maxima in a variety of output types.
Have a look at the existing `StereoSSAM.jl` extensions. Here we are going to load them
Have a look at the existing `Sainsc.jl` extensions. Here we are going to load them
as `Muon.AnnData` object.

````julia
Expand Down Expand Up @@ -248,7 +248,7 @@ simshow(imresize(celltype_img; ratio=1 / 45))

## Utils

Some additional useful functions are included in `StereoSSAM.jl`.
Some additional useful functions are included in `Sainsc.jl`.

### Cropping & Masking

Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Muon = "446846d7-b4ce-489d-bf74-72da18fe3629"
OpenCV = "f878e3a2-a245-4720-8660-60795d644f2a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
StereoSSAM = "4c4340ea-7f9e-46b4-8512-61f1f6c41a11"
Sainsc = "4c4340ea-7f9e-46b4-8512-61f1f6c41a11"

[compat]
Literate = "2.15.1"
21 changes: 15 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# StereoSSAM.jl
# Sainsc.jl

TODO general introduction
`Sainsc.jl` - Segmentation-free analysis of in situ capture data[^1] - is,
as the name states, a tool to analyse in situ capture-based spatial
transcriptomics data. Actually, it can also be used to analyse imaging-based datasets.
For a more thorough background please refer to the
[original publication](https://TODO)
or just follow along the provided examplary analysis.

reference to python repo
A more _batteries included_[^2] version of this package is available in Python/Rust.
If you are interested have a look at [https://github.com/HiDiHlabs/sainsc](https://github.com/HiDiHlabs/sainsc).

## Citation

If you use `StereoSSAM.jl` for your research please consider citing
If you use `Sainsc.jl` for your research please consider citing
TODO

## Installation
Expand All @@ -15,14 +21,14 @@ The package can be installed with the Julia package manager.
From the Julia REPL, type `]` to enter the `Pkg` REPL mode and run:

```
pkg> add StereoSSAM
pkg> add Sainsc
```

Or, alternatively, via the `Pkg` API:

```julia
using Pkg
Pkg.add("StereoSSAM")
Pkg.add("Sainsc")
```

## Index
Expand All @@ -34,3 +40,6 @@ Pages = [
]
Depth = 3
```

[^1]: Some people claim it actually stands for _Stupid Acronyms in Science_
[^2]: Pun intended
6 changes: 3 additions & 3 deletions ext/AnnDataExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module AnnDataExt

using Muon: AnnData

using StereoSSAM
using Sainsc

function StereoSSAM.getlocalmaxima(::Type{AnnData}, counts, localmax, kernel; genes=nothing)
function Sainsc.getlocalmaxima(::Type{AnnData}, counts, localmax, kernel; genes=nothing)
X, genes, obs = getlocalmaxima(counts, localmax, kernel; genes=genes)

return AnnData(;
Expand All @@ -15,7 +15,7 @@ function StereoSSAM.getlocalmaxima(::Type{AnnData}, counts, localmax, kernel; ge
)
end

function StereoSSAM.readstereoseqbinned(::Type{AnnData}, file, binsize::Integer)
function Sainsc.readstereoseqbinned(::Type{AnnData}, file, binsize::Integer)
X, genes, obs = readstereoseqbinned(file, binsize)

return AnnData(;
Expand Down
6 changes: 3 additions & 3 deletions ext/AutomaticSingleCellToolboxExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ using AutomaticSingleCellToolbox: WsObj
using DataFrames: DataFrame, rename!
using SparseArrays: nzrange

using StereoSSAM
using Sainsc

function StereoSSAM.getlocalmaxima(::Type{WsObj}, counts, localmax, kernel; genes=nothing)
function Sainsc.getlocalmaxima(::Type{WsObj}, counts, localmax, kernel; genes=nothing)
X, genes, coordinates = getlocalmaxima(counts, localmax, kernel; genes=genes)

coordinates[!, "cell_counts"] = vec(sum(X; dims=1))
Expand All @@ -17,7 +17,7 @@ function StereoSSAM.getlocalmaxima(::Type{WsObj}, counts, localmax, kernel; gene
return WsObj(Dict("raw_dat" => X), coordinates, genes, String[], Dict())
end

function StereoSSAM.readstereoseqbinned(::Type{WsObj}, file, binsize::Integer)
function Sainsc.readstereoseqbinned(::Type{WsObj}, file, binsize::Integer)
X, genes, coordinates = readstereoseqbinned(file, binsize)

coordinates[!, "cell_counts"] = vec(sum(X; dims=1))
Expand Down
6 changes: 3 additions & 3 deletions ext/CellScopesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module CellScopesExt
using DataFrames: rename!
using CellScopes: RawCountObject

using StereoSSAM
using Sainsc

function StereoSSAM.getlocalmaxima(
function Sainsc.getlocalmaxima(
::Type{RawCountObject}, counts, localmax, kernel; genes=nothing
)
mat, genes, coordinates = getlocalmaxima(counts, localmax, kernel; genes=genes)
Expand All @@ -15,7 +15,7 @@ function StereoSSAM.getlocalmaxima(
return RawCountObject(mat, coordinates.cell_name, genes.gene), coordinates
end

function StereoSSAM.readstereoseqbinned(::Type{RawCountObject}, file, binsize::Integer)
function Sainsc.readstereoseqbinned(::Type{RawCountObject}, file, binsize::Integer)
counts, genes, coordinates = readstereoseqbinned(file, binsize)

rename!(coordinates, Dict(:id => "cell_name"))
Expand Down
8 changes: 3 additions & 5 deletions ext/SingleCellProjectionsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ module SingleCellProjectionsExt

using SingleCellProjections: DataMatrix

using StereoSSAM
using Sainsc

function StereoSSAM.getlocalmaxima(
::Type{DataMatrix}, counts, localmax, kernel; genes=nothing
)
function Sainsc.getlocalmaxima(::Type{DataMatrix}, counts, localmax, kernel; genes=nothing)
return DataMatrix(getlocalmaxima(counts, localmax, kernel; genes=genes))
end

function StereoSSAM.readstereoseqbinned(::Type{DataMatrix}, file, binsize::Integer)
function Sainsc.readstereoseqbinned(::Type{DataMatrix}, file, binsize::Integer)
return DataMatrix(readstereoseqbinned(file, binsize))
end

Expand Down
1 change: 1 addition & 0 deletions src/IO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function readGEMfile(file)
for n in countcol_name
if n in names(df)
rename!(df, n => :count)
break
end
end

Expand Down
Loading
Loading