axelalmet / flowsig

Python package to find communication-driven intercellular flows from single-cell RNA-sequencing and spatial transcriptomics data.
MIT License
51 stars 0 forks source link

unexpected keyword argument 'validated_adjacency_key' #16

Open ChloeHJ opened 2 weeks ago

ChloeHJ commented 2 weeks ago

Hi,

Thanks for an amazing package. I was trying to run tutorial on pancreatic_islets_scrnaseq_example and I was getting errors: fs.tl.apply_biological_flow(adata, flowsig_network_key = 'flowsig_network', adjacency_key = 'adjacency', validated_adjacency_key = 'adjacency_validated' ) TypeError: apply_biological_flow() got an unexpected keyword argument 'validated_adjacency_key'

I've tried changing the argument based on the latest code, but still giving me error fs.tl.apply_biological_flow(adata, flowsig_network_key = 'flowsig_network', adjacency_key = 'adjacency', validated_key = 'validated' )

          163 # Get the adjacency
      --> 164 adjacency = adata.uns[flowsig_network_key]['network'][adjacency_key]
          165 flow_vars = adata.uns[flowsig_network_key]['flow_var_info'].index.tolist()
          166 flow_var_info = adata.uns[flowsig_network_key]['flow_var_info']

      KeyError: 'network'

Similarly, the code below as throwing out error as well: edge_threshold = 0.7 fs.tl.filter_low_confidence_edges(adata, edge_threshold = edge_threshold, flowsig_network_key = 'flowsig_network', adjacency_key = 'adjacency', filtered_adjacency_key = 'adjacency_filtered') TypeError: filter_low_confidence_edges() got an unexpected keyword argument 'filtered_adjacency_key'

Are these still under development? I would love to give it a try but wasn't sure if they are not yet ready for use

Thanks and best wishes Chloe

axelalmet commented 1 week ago

Hi Chloe,

Thanks for the question and I'm very sorry for taking so long to respond!

I reran the pancreatic islets example and didn't get this error. The only reason I can think of why you have this issue is that, for some reason, the output of fs.tl.learn_intercellular_flows hasn't been saved correctly. Would you mind rerunning learn_intercellular_flows and then trying to run fs.tl.apply_biological_flow and fs.tl.filter_low_confidence_edges?

You have however pointed out correctly that the tutorial is out of date regarding the command arguments to specify for fs.tl.apply_biological_flow and fs.tl.filter_low_confidence_edges. I've updated the tutorial in flowsig repository to reflect those changes. Thanks for catching that!

Best wishes, Axel.