Skip to content

Commit 298d6ec

Browse files
Cleaned up phrasing
1 parent cb10b91 commit 298d6ec

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

docs/source/torch_example.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,34 +32,32 @@ This tutorial also uses the following settings::
3232
test_label = 'cell_ontology_id'
3333
model_path = model_dir + 'example_file_model'
3434

35-
If you are interested in annotating your own datasets do so by replacing train_file and test_file with paths to your own files.
35+
If you are interested in annotating your own datasets, you can do so by replacing `train_file` and `test_file` with paths to your own files.
3636

37-
Next we must read the cell ontology data and initialize the model as::
37+
Next we read the cell ontology data and initialize the model as::
3838
3939
print ('read ontology data and initialize training model...')
4040
cell_type_nlp_emb_file, cell_type_network_file, cl_obo_file = read_ontology_file('cell ontology', ontology_data_dir)
4141
OnClass_train_obj = OnClassModel(cell_type_nlp_emb_file = cell_type_nlp_emb_file, cell_type_network_file = cell_type_network_file, memory_saving_mode=MEMORY_SAVING_MODE)
4242

4343
where `MEMORY_SAVING_MODE` is true if you want to run OnClass on low RAM, and false otherwise. This value can be set easily in the `config <https://github.com/wangshenguiuc/OnClass/OnClass_Torch/config.py>`__ file.
4444

45-
Read the training data from the training file::
45+
Read the training data from the training file as::
4646

4747
print ('read training single cell data...')
4848
train_feature, train_genes, train_label, _, _ = read_data(train_file, cell_ontology_ids = OnClass_train_obj.cell_ontology_ids,
4949
exclude_non_leaf_ontology = False, tissue_key = 'tissue', AnnData_label_key = train_label, filter_key = {},
5050
nlp_mapping = False, cl_obo_file = cl_obo_file, cell_ontology_file = cell_type_network_file, co2emb = OnClass_train_obj.co2vec_nlp,
5151
memory_saving_mode=MEMORY_SAVING_MODE)
5252

53-
where `train_feature` is a sample-by-gene gene expression matrix, `train_label` is a label vector for each sample. The labels in `Y` should use the Cell Ontology Id (e.g., CL:1000398). The data (e.g., tabula muris raw gene expression matrix, the Cell Ontology obo file) can be downloaded from FigShare.(see dataset section in this tutorial).
53+
where `train_feature` is a sample-by-gene gene expression matrix, `train_label` is a label vector for each sample. The labels in `train_label` in this example are Cell Ontology Ids (e.g., CL:1000398). It's important to add, that if the model is in memory saving mode, it will load `train_feature` as a sparse scipy matrix.
5454

55-
It's important to add, that if the model is in memory saving mode, it will load train_feature as a sparse scipy matrix.
56-
57-
Next, we embed the cell onotology::
55+
Next, we embed the cell onotology as::
5856

5957
print ('embed cell types using the cell ontology...')
6058
OnClass_train_obj.EmbedCellTypes(train_label)
6159

62-
Read the test data::
60+
And read the test data as::
6361

6462
test_label = x.obs[test_label].tolist()
6563
test_genes = np.array([x.upper() for x in x.var.index])

0 commit comments

Comments
 (0)