SURE-tools 2.2.12__tar.gz → 2.2.15__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {sure_tools-2.2.12 → sure_tools-2.2.15}/PKG-INFO +1 -1
  2. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/DensityFlow.py +15 -20
  3. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE_tools.egg-info/PKG-INFO +1 -1
  4. {sure_tools-2.2.12 → sure_tools-2.2.15}/setup.py +1 -1
  5. {sure_tools-2.2.12 → sure_tools-2.2.15}/LICENSE +0 -0
  6. {sure_tools-2.2.12 → sure_tools-2.2.15}/README.md +0 -0
  7. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/SURE.py +0 -0
  8. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/__init__.py +0 -0
  9. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/assembly/__init__.py +0 -0
  10. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/assembly/assembly.py +0 -0
  11. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/assembly/atlas.py +0 -0
  12. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/atac/__init__.py +0 -0
  13. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/atac/utils.py +0 -0
  14. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/codebook/__init__.py +0 -0
  15. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/codebook/codebook.py +0 -0
  16. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/flow/__init__.py +0 -0
  17. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/flow/flow_stats.py +0 -0
  18. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/flow/plot_quiver.py +0 -0
  19. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/perturb/__init__.py +0 -0
  20. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/perturb/perturb.py +0 -0
  21. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/utils/__init__.py +0 -0
  22. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/utils/custom_mlp.py +0 -0
  23. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/utils/queue.py +0 -0
  24. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE/utils/utils.py +0 -0
  25. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE_tools.egg-info/SOURCES.txt +0 -0
  26. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE_tools.egg-info/dependency_links.txt +0 -0
  27. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE_tools.egg-info/entry_points.txt +0 -0
  28. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE_tools.egg-info/requires.txt +0 -0
  29. {sure_tools-2.2.12 → sure_tools-2.2.15}/SURE_tools.egg-info/top_level.txt +0 -0
  30. {sure_tools-2.2.12 → sure_tools-2.2.15}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SURE-tools
3
- Version: 2.2.12
3
+ Version: 2.2.15
4
4
  Summary: Succinct Representation of Single Cells
5
5
  Home-page: https://github.com/ZengFLab/SURE
6
6
  Author: Feng Zeng
@@ -696,7 +696,7 @@ class DensityFlow(nn.Module):
696
696
  """
697
697
  Return the mean part of metacell codebook
698
698
  """
699
- cb = self._get_metacell_coordinates()
699
+ cb = self._get_codebook()
700
700
  cb = tensor_to_numpy(cb)
701
701
  return cb
702
702
 
@@ -842,47 +842,42 @@ class DensityFlow(nn.Module):
842
842
 
843
843
  return counts, zs
844
844
 
845
- def _cell_response(self, xs, factor_idx, perturb):
845
+ def _cell_response(self, zs, perturb_idx, perturb):
846
846
  #zns,_ = self.encoder_zn(xs)
847
- zns,_ = self._get_basal_embedding(xs)
847
+ #zns,_ = self._get_basal_embedding(xs)
848
+ zns = zs
848
849
  if perturb.ndim==2:
849
- ms = self.cell_factor_effect[factor_idx]([zns, perturb])
850
+ ms = self.cell_factor_effect[perturb_idx]([zns, perturb])
850
851
  else:
851
- ms = self.cell_factor_effect[factor_idx]([zns, perturb.reshape(-1,1)])
852
+ ms = self.cell_factor_effect[perturb_idx]([zns, perturb.reshape(-1,1)])
852
853
 
853
854
  return ms
854
855
 
855
856
  def get_cell_response(self,
856
- xs,
857
- factor_idx,
858
- perturb,
857
+ zs,
858
+ perturb_idx,
859
+ perturb_us,
859
860
  batch_size: int = 1024):
860
861
  """
861
862
  Return cells' changes in the latent space induced by specific perturbation of a factor
862
863
 
863
864
  """
864
- xs = self.preprocess(xs)
865
- xs = convert_to_tensor(xs, device=self.get_device())
866
- ps = convert_to_tensor(perturb, device=self.get_device())
867
- dataset = CustomDataset2(xs,ps)
865
+ #xs = self.preprocess(xs)
866
+ zs = convert_to_tensor(zs, device=self.get_device())
867
+ ps = convert_to_tensor(perturb_us, device=self.get_device())
868
+ dataset = CustomDataset2(zs,ps)
868
869
  dataloader = DataLoader(dataset, batch_size=batch_size, shuffle=False)
869
870
 
870
871
  Z = []
871
872
  with tqdm(total=len(dataloader), desc='', unit='batch') as pbar:
872
- for X_batch, P_batch, _ in dataloader:
873
- zns = self._cell_response(X_batch, factor_idx, P_batch)
873
+ for Z_batch, P_batch, _ in dataloader:
874
+ zns = self._cell_response(Z_batch, perturb_idx, P_batch)
874
875
  Z.append(tensor_to_numpy(zns))
875
876
  pbar.update(1)
876
877
 
877
878
  Z = np.concatenate(Z)
878
879
  return Z
879
880
 
880
- def get_metacell_response(self, factor_idx, perturb):
881
- zs = self._get_codebook()
882
- ps = convert_to_tensor(perturb, device=self.get_device())
883
- ms = self.cell_factor_effect[factor_idx]([zs,ps])
884
- return tensor_to_numpy(ms)
885
-
886
881
  def _get_expression_response(self, delta_zs):
887
882
  return self.decoder_concentrate(delta_zs)
888
883
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: SURE-tools
3
- Version: 2.2.12
3
+ Version: 2.2.15
4
4
  Summary: Succinct Representation of Single Cells
5
5
  Home-page: https://github.com/ZengFLab/SURE
6
6
  Author: Feng Zeng
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name='SURE-tools',
8
- version='2.2.12',
8
+ version='2.2.15',
9
9
  description='Succinct Representation of Single Cells',
10
10
  long_description=long_description,
11
11
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes
File without changes