snehamitra / SCARlink

37 stars 8 forks source link

Error in seq() during data preprocessing: "invalid '(to - from)/by'" #20

Open sainathmamde opened 1 day ago

sainathmamde commented 1 day ago

First of all, thank you for developing this great tool! I encountered an error while preprocessing the data using the following section of code: if (ncores > 1) { bpparam <- MulticoreParam(workers = ncores) } else { bpparam <- BiocParallel::SerialParam() }

Create chunks

max_ix <- min(length(selected.genes), max(trunc(length(selected.genes) / 50), 50))

tmp_files <- bplapply(1:max_ix, FUN = function(i) { selected.genes.subset <- selected.genes[seq(i, length(selected.genes), max_ix)] split_write_hdf5(out_dir, selected.genes.subset, tm.filtered[rowData(tm.filtered)$symbol %in% selected.genes.subset, ]) }, BPPARAM = bpparam)

The error I receive. [1] "Tile size: 500" character(0) [1] 0 R[write to console]: Error: BiocParallel errors 1 remote errors, element index: 1 1 unevaluated and other errors first remote error: Error in seq.default(i, length(selected.genes), max_ix): invalid '(to - from)/by'

R[write to console]: In addition: R[write to console]: There were 14 warnings (use warnings() to see them) R[write to console]:

Traceback (most recent call last): File "/tscc/nfs/home/smamde/miniconda3/envs/scarlink-env/bin/scarlink_processing", line 33, in sys.exit(load_entry_point('scarlink', 'console_scripts', 'scarlink_processing')()) File "/tscc/nfs/home/smamde/SCARlink/scarlink/preprocessing/create_h5_files.py", line 44, in main rfunc.write_files(archr_out, seurat_out, out_dir, args.window, args.ncores, args.scale) File "/tscc/nfs/home/smamde/miniconda3/envs/scarlink-env/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 208, in call return (super(SignatureTranslatedFunction, self) File "/tscc/nfs/home/smamde/miniconda3/envs/scarlink-env/lib/python3.8/site-packages/rpy2/robjects/functions.py", line 131, in call res = super(Function, self).call(*new_args, *new_kwargs) File "/tscc/nfs/home/smamde/miniconda3/envs/scarlink-env/lib/python3.8/site-packages/rpy2/rinterfacelib/conversion.py", line 45, in cdata = function(args, **kwargs) File "/tscc/nfs/home/smamde/miniconda3/envs/scarlink-env/lib/python3.8/site-packages/rpy2/rinterface.py", line 817, in call raise embedded.RRuntimeError(_rinterface._geterrmessage()) rpy2.rinterface_lib.embedded.RRuntimeError: Error: BiocParallel errors 1 remote errors, element index: 1 1 unevaluated and other errors first remote error: Error in seq.default(i, length(selected.genes), max_ix): invalid '(to - from)/by'

snehamitra commented 22 hours ago

Can you check how many variable genes you have in your Seurat object? Do you get the same error if you run scarlink_processing with -nc 1?