Skip to content

Commit 6e78bb0

Browse files
authored
Merge pull request #2 from ArpiarSaundersLab/dev
Major Feature updates
2 parents 01e51f4 + d3b5f09 commit 6e78bb0

33 files changed

Lines changed: 4305 additions & 1801 deletions

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
data/
22
db/
33
env/
4+
env2/
45
__pycache__/
56
rdata/
67
*.pyc
@@ -14,4 +15,5 @@ build_doc.sh
1415
build_wheel.sh
1516
.DS_Store
1617
/**/__pycache__/
17-
/**/.pytest_cache/
18+
/**/.pytest_cache/
19+
site/

README.md

Lines changed: 16 additions & 230 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
########################################################
2-
# Annsql uses the duckdb api to build the database and
3-
# perform operations. You can access the .asql file in
4-
# R by simply installing the duckdb package and loading
5-
# the library and database. Once you've loaded the db
6-
# you can run any query you'd like.
7-
########################################################
1+
# Opening AnnSQL Databases in R
2+
Annsql uses the duckdb api to build the database and perform operations. You can access the .asql file in R by simply installing the duckdb package and loading the library and database. Once you've loaded the db you can run any query your heart desires.
3+
<br>
4+
<br>
85

6+
```
97
#install the duckdb api dependency and load the library
108
if (!requireNamespace("duckdb", quietly = TRUE)) {
119
install.packages("duckdb")
@@ -25,7 +23,7 @@ print(results)
2523
2624
#don't forget to close the door
2725
dbDisconnect(con)
26+
```
27+
<br>
2828

29-
30-
31-
29+
While extended functionality in our Python based package is not currently implemented in R. AnnSQL databases can be opened, queried, and explored in R.

docs/api_annsql.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# AnnSQL Class API
2+
3+
::: src.AnnSQL.AnnSQL
4+
handler: python

docs/api_builddb.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# BuildDb Class API
2+
**Note** This class is accessed by the `MakeDb` class for building an on-disk database. It is also used by the `AnnSQL` class to build an in-memory database. Generally, users shouldn't instantiate this class unless they pass their own database connection when instantiating the class.
3+
4+
<br>
5+
6+
::: src.AnnSQL.BuildDb
7+
handler: python

docs/api_makedb.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# MakeDb Class API
2+
3+
::: src.AnnSQL.MakeDb
4+
handler: python
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"metadata": {},
66
"source": [
77
"# Basic Usage\n",
8-
"Below, we give the the most streamlined example of how to use AnnSQL for a smaller datasets. This notebook shows how to use the in-memory querying capabilities of AnnSql. Depending on your system memory and the AnnData filesize, you may want to consider building local database using AnnSQL; however, if your dataset contains fewer than around 30k libraries, then this approach should work well."
8+
"Below, we give the the most streamlined example of how to use AnnSQL for a smaller datasets. This notebook shows how to use the in-memory querying capabilities of AnnSql. Depending on your system memory and the AnnData filesize, you may want to consider building local database using AnnSQL; however, if your dataset contains fewer than around 30k cells, then this approach should work well."
99
]
1010
},
1111
{
@@ -72,7 +72,7 @@
7272
"cell_type": "markdown",
7373
"metadata": {},
7474
"source": [
75-
"### Pass the adata object to the AnnSQL class.\n",
75+
"### Pass the adata object to the AnnSQL class\n",
7676
"Below, we simply instantiate AnnSQL class with the adata object from above. Alternatively, you may pass a filepath to a h5ad file."
7777
]
7878
},
@@ -99,7 +99,7 @@
9999
"cell_type": "markdown",
100100
"metadata": {},
101101
"source": [
102-
"### Explore the data using SQL!\n",
102+
"### Explore the data using SQL\n",
103103
"AnnSQL wraps around the powerful DuckDb SQL engine, you're now capable of running simple or complex queries on the dataset.\n",
104104
"\n",
105105
"### SELECT Example"
@@ -615,7 +615,7 @@
615615
"cell_type": "markdown",
616616
"metadata": {},
617617
"source": [
618-
"### Filter by cell type (bulk_labels)"
618+
"### Filter by cell type"
619619
]
620620
},
621621
{
@@ -966,7 +966,7 @@
966966
"cell_type": "markdown",
967967
"metadata": {},
968968
"source": [
969-
"### Count total cells by cell type (bulk_labels)"
969+
"### Count total cells by cell type"
970970
]
971971
},
972972
{
@@ -1077,6 +1077,13 @@
10771077
"asql.query(\"SELECT bulk_labels, COUNT(*) as total FROM obs GROUP BY bulk_labels ORDER BY total DESC\")"
10781078
]
10791079
},
1080+
{
1081+
"cell_type": "markdown",
1082+
"metadata": {},
1083+
"source": [
1084+
"### Show all tables in the database"
1085+
]
1086+
},
10801087
{
10811088
"cell_type": "code",
10821089
"execution_count": 8,

0 commit comments

Comments
 (0)