-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from earmingol/new_version
Updates for v0.6.4
- Loading branch information
Showing
14 changed files
with
279 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ | |
from cell2cell import tensor | ||
from cell2cell import utils | ||
|
||
__version__ = "0.6.3" | ||
__version__ = "0.6.4" |
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,31 @@ | ||
from scanpy.readwrite import read | ||
|
||
|
||
def balf_covid(filename='BALF-COVID19-Liao_et_al-NatMed-2020.h5ad'): | ||
"""BALF samples from COVID-19 patients | ||
The data consists in 63k immune and epithelial cells in lungs | ||
from 3 control, 3 moderate COVID-19, and 6 severe COVID-19 patients. | ||
This dataset was previously published in [1], and this objects contains | ||
the raw counts for the annotated cell types available in: | ||
https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE145926 | ||
References: | ||
[1] Liao, M., Liu, Y., Yuan, J. et al. | ||
Single-cell landscape of bronchoalveolar immune cells in patients | ||
with COVID-19. Nat Med 26, 842–844 (2020). | ||
https://doi.org/10.1038/s41591-020-0901-9 | ||
Parameters | ||
---------- | ||
filename : str, default='BALF-COVID19-Liao_et_al-NatMed-2020.h5ad' | ||
Path to the h5ad file in case it was manually downloaded. | ||
Returns | ||
------- | ||
Annotated data matrix. | ||
""" | ||
url = 'https://zenodo.org/record/7535867/files/BALF-COVID19-Liao_et_al-NatMed-2020.h5ad' | ||
adata = read(filename, backup_url=url) | ||
return adata |
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,46 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from __future__ import absolute_import | ||
|
||
import os | ||
|
||
|
||
def create_directory(pathname): | ||
'''Creates a directory. | ||
Uses a path to create a directory. It creates | ||
all intermediate folders before creating the | ||
leaf folder. | ||
Parameters | ||
---------- | ||
pathname : str | ||
Full path of the folder to create. | ||
''' | ||
if not os.path.isdir(pathname): | ||
os.makedirs(pathname) | ||
print("{} was created successfully.".format(pathname)) | ||
else: | ||
print("{} already exists.".format(pathname)) | ||
|
||
|
||
def get_files_from_directory(pathname, dir_in_filepath=False): | ||
'''Obtains a list of filenames in a folder. | ||
Parameters | ||
---------- | ||
pathname : str | ||
Full path of the folder to explore. | ||
dir_in_filepath : boolean, default=False | ||
Whether adding `pathname` to the filenames | ||
Returns | ||
------- | ||
filenames : list | ||
A list containing the names (strings) of the files | ||
in the folder. | ||
''' | ||
directory = os.fsencode(pathname) | ||
filenames = [pathname + '/' + os.fsdecode(file) if dir_in_filepath else os.fsdecode(file) for file in os.listdir(directory)] | ||
return filenames |
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
Oops, something went wrong.