Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import anndata
import os
import scipy.sparse
import numpy as np


def load(data_dir, sample_fn, **kwargs):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you only have a single file, it is not necessary to use sample_fn and you can use def load(data_dir, **kwargs): instead here

fn = os.path.join(data_dir, sample_fn)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you are not using fn, so you can just take this line out!


counts = pd.read_csv(data_dir + "GSE115746_cells_exon_counts.csv.gz", index_col=0)
counts_t = counts.T.copy()

metadata = pd.read_csv(data_dir + "GSE115746_complete_metadata_28706-cells.csv.gz")

metadata = metadata[metadata.sample_name.isin(counts_t.index.values)].copy()
metadata.index = metadata.sample_name
metadata = metadata.reindex(counts_t.index)


np.testing.assert_array_equal(metadata.sample_name.values, counts_t.index.values)

adata = AnnData(scipy.sparse.csc_matrix(counts_t.to_numpy()),obs=metadata,)
adata.var.index = counts_t.columns

return adata
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
dataset_structure:
dataset_index: 1
sample_fns:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can leave this field empty if you only have a single file name here to reduce complexity!

- "GSE115746_cells_exon_counts.csv.gz"
dataset_wise:
author: "Tasic"
doi: "10.1038/s41586-018-0654-5"
download_url_data: "https://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE115746&format=file&file=GSE115746%5Fcells%5Fexon%5Fcounts%2Ecsv%2Egz"
download_url_meta: "https://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE115746&format=file&file=GSE115746%5Fcomplete%5Fmetadata%5F28706%2Dcells%2Ecsv%2Egz"
normalization: "raw"
year: "2018"
dataset_or_observation_wise:
age:
age_obs_key:
assay: "smart-seq2"
assay_obs_key:
bio_sample:
bio_sample_obs_key:
development_stage:
development_stage_obs_key:
ethnicity:
ethnicity_obs_key:
healthy:
healthy_obs_key:
individual:
individual_obs_key: "donor_id"
organ: "brain"
organ_obs_key:
organism: "mouse"
organism_obs_key: "organism"
sex:
sex_obs_key: "donor_sex"
state_exact: "healthy"
state_exact_obs_key:
tech_sample:
tech_sample_obs_key:
observation_wise:
cellontology_original_obs_key: "cell_cluster"
feature_wise:
var_ensembl_col:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to supply one of these to give some sort of gene name list.

var_symbol_col:
misc:
meta:
version: "1.0"
Empty file.