UCSF-DSCOLAB / cyclone

3 stars 2 forks source link

Bug Fix: Allow running without a 'gated_fcs_dir' #10

Closed dtm2451 closed 1 year ago

dtm2451 commented 1 year ago

I think a recent update introduced a bug where the config file's 'gated_fcs_dir' must be a real directory or else the pipeline errors out in step 6.

The bug:

A cyclone run where the config file 'gated_fcs_dir' is not a real directory (because I don't have gated fcs files to power SCAFFoLD analysis; derp value I filled it in with was "/boop/boop/boop") fails after completing step 5 with this at the end of the log file.

##########################################################
Starting step#: 5
[ 2023-01-03 07:18:29 ] Checkpoint #5 reached. Saving the newly generated data. 
[ 2023-01-03 07:18:30 ] Data is saved in /krummellab/data1/DSCoLab/XNEO1/cytof/All_runs_1_to_10/processed/clustering_pipeline_subsample_with_control/checkpoint_5.RData 

##########################################################
Starting step#: 6
Error in if (make_scaffold_map) { : argument is of length zero
Execution halted

Fix here:

This PR adjusts the logic around setting the 'make_scaffold_map' logical value in order to ensure it still gets set.

rebeccagj commented 1 year ago

Just curious, have you tried not filling it with a mock path? I usually just assign no directory if I'm not doing scaffold analysis, eg: gated_fcs_dir: ""

But in general I think the PR allows for more flexibility depending on what inputs users might give!

dtm2451 commented 1 year ago

I haven't tried that, but I suspect it would bug out the same way nowadays cuz you'd still end up with FALSE at the if( dir.exists(gated_fcs_dir) ) logic point, and thus skip past where make_scaffold_map is changed from NULL.

> dir.exists("")
[1] FALSE
dtm2451 commented 1 year ago

Checking the string version is needed... I hadn't tested at the time of the first commit or else this would have all been in one, =p, because the first commit didn't work. exists() takes in a string and checks for the existence of an object with that name.

Is there a specific reason you like exists(gated_fcss) over exists("gated_fcss")?

ravipatel4 commented 1 year ago

Oh, sorry I confused exists() with dir.exists() that I use above! :| P.S. sorry about closing and opening the PR. I am just learning this aspect of git. :D

dtm2451 commented 1 year ago

haha, no wories, no harm done!