AllenCell / cvapipe

Cell Variance Analysis Pipeline
Other
2 stars 0 forks source link

Specifying option path_in_stdv in pca_path_cells returns type error #30

Closed Calebium closed 4 years ago

Calebium commented 4 years ago

Description

If the option 'path_in_stdv' for the pca_path_cells step is specified as a list in the command line, a type error is returned:

Traceback (most recent call last): File "/home/caleb.chan/anaconda3/envs/cvapipe/bin/cvapipe", line 33, in <module> sys.exit(load_entry_point('cvapipe', 'console_scripts', 'cvapipe')()) File "/home/caleb.chan/cvapipe/cvapipe/bin/cli.py", line 35, in cli fire.Fire({**step_map, "all": All}) File "/home/caleb.chan/anaconda3/envs/cvapipe/lib/python3.7/site-packages/fire/core.py", line 138, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/home/caleb.chan/anaconda3/envs/cvapipe/lib/python3.7/site-packages/fire/core.py", line 468, in _Fire target=component.__name__) File "/home/caleb.chan/anaconda3/envs/cvapipe/lib/python3.7/site-packages/fire/core.py", line 672, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/home/caleb.chan/anaconda3/envs/cvapipe/lib/python3.7/site-packages/datastep/step.py", line 61, in wrapper return func(self, *args, **kwargs) File "/home/caleb.chan/cvapipe/cvapipe/steps/pca_path_cells/pca_path_cells.py", line 136, in run path=path_in_stdv * pc_stdv, TypeError: can't multiply sequence by non-int of type 'numpy.float64'

Expected Behavior

The specified option is supposed to be used to extract closest cells from the modified PCA path points, and no error should be returned

Reproduction

Just execute the following in the command line:

cvapipe pcapathcells run --pca_csv_loc '/allen/aics/modeling/caleb/datasets/dataset_from_matheus/manifest_v2.csv' --N_cells 100 -pcs "['DNA_MEM_PC1']" -dist_cols "['DNA_MEM_PC1']" -path_in_stdv "[-3.0, -2.5, -2.0, -1.5, -1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0]" > PCAPathCells.log 2>&1

My guess is that the value of path_in_stdv is expected to be an np.array in the code, but when passed in as an argument, the argument is passed in as a list and not an np.array. However, it is not obvious how one can pass in this list as an np.array in the command line

Environment

Any additional information about your environment

donovanr commented 4 years ago

This should have been fixed by #28. That patch to master works for me on the dgx. Please pull from master and check to see if it works for you. Reopen if not.