Skip to content

Commit

Permalink
small docs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
LonnekeScheffer committed May 28, 2024
1 parent 4eed865 commit 114499f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
27 changes: 4 additions & 23 deletions docs/source/developer_docs/example_code/SillyEncoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ def encode(self, dataset, params: EncoderParams) -> Dataset:
# make sure to use the general encoder name here
# (e.g., OneHotEncoder.__name__, not OneHotSequenceEncoder.__name__)

return self._construct_encoded_dataset(dataset, encoded_data)
encoded_dataset = dataset.clone()
encoded_dataset.encoded_data = encoded_data

return encoded_dataset

def _get_encoded_examples(self, dataset: Dataset) -> np.array:
if isinstance(dataset, SequenceDataset):
Expand Down Expand Up @@ -155,25 +157,4 @@ def _get_encoded_repertoires(self, dataset: RepertoireDataset) -> np.array:
random_encoding = np.random.rand(self.embedding_len)
encoded_repertoires.append(random_encoding)

return np.array(encoded_repertoires)

def _construct_encoded_dataset(self, dataset, encoded_data) -> Dataset:
if isinstance(dataset, SequenceDataset):
return SequenceDataset(filenames=dataset.get_filenames(),
encoded_data=encoded_data,
labels=dataset.labels,
file_size=dataset.file_size,
dataset_file=dataset.dataset_file)
elif isinstance(dataset, ReceptorDataset):
return ReceptorDataset(filenames=dataset.get_filenames(),
encoded_data=encoded_data,
labels=dataset.labels,
file_size=dataset.file_size,
dataset_file=dataset.dataset_file)
elif isinstance(dataset, RepertoireDataset):
return RepertoireDataset(repertoires=dataset.repertoires,
encoded_data=encoded_data,
labels=dataset.labels,
metadata_file=dataset.metadata_file)


return np.array(encoded_repertoires)
2 changes: 1 addition & 1 deletion docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Lastly, this quickstart tutorial can be used when you have immuneML :ref:`instal

For simulation purposes, you can try LIgO quickstart:

- :ref:`Simulation quickstart`
- :ref:`LIgO simulation quickstart`



Expand Down

0 comments on commit 114499f

Please sign in to comment.