Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other: ValueError: max() arg is an empty sequence #7

Open
FLY-Fiancee opened this issue Dec 29, 2023 · 10 comments
Open

Other: ValueError: max() arg is an empty sequence #7

FLY-Fiancee opened this issue Dec 29, 2023 · 10 comments

Comments

@FLY-Fiancee
Copy link

FLY-Fiancee commented Dec 29, 2023

Hi, I'm having the same problem: max() arg is an empty sequence.
SEVtras.sEV_recognizer(sample_file='./sample_file', out_path='./outputs', species='Homo',alpha=0.09, score_t='10')
I've tried to reduce the thresholds, like: alpha=0.09, score_t='10' (I've also tried score_t='1'), but I still get the same error. Additionally I downloaded a portion of the mouse single cell sequencing data from the GEO data and after cellranger processing (default parameters), I get the following: no genes enriched... and sEV is hard to detect.... and KeyError: 'score'. There is also some warning:
/home/fbio/anaconda3/envs/secret_ev/lib/python3.7/site-packages/SEVtras/sc_pp.py:811: ImplicitModificationWarning: Trying to modify attribute .obs of view, initializing view as actual. adata.obs["n_genes"] = number /home/fbio/anaconda3/envs/secret_ev/lib/python3.7/site-packages/scipy/stats/stats.py:4484: SpearmanRConstantInputWarning: An input array is constant; the correlation coefficient is not defined.

@RuiqiaoHe
Copy link
Member

The output means that SEVtras is hard to identify sEVs in your data. But if you really want to characterize potential sEVs, you can try to set the alpha lower, e.g. 0.08.
Noted: The input droplet-gene matrix for SEVtras should be the raw data; herein, the matrix should come from the raw_feature_bc_matrix directory in Cell Ranger outs.

@FLY-Fiancee
Copy link
Author

FLY-Fiancee commented Jan 2, 2024

The output means that SEVtras is hard to identify sEVs in your data. But if you really want to characterize potential sEVs, you can try to set the alpha lower, e.g. 0.08. Noted: The input droplet-gene matrix for SEVtras should be the raw data; herein, the matrix should come from the in Cell Ranger outs.raw_feature_bc_matrix directory

I modified the parameters as follows:
SEVtras.sEV_recognizer(sample_file='./sample_file',out_path='./outputs',species='Mus',alpha=0.09,score_t='1',predefine_threads=80)。But still can't get the results, I'm using data from mouse kidneys, how should I correct the parameters?
The error reported is: `0 0 No genes enriched, please check input sample:/home/fbio/Documents/AKI_CKD/sev/test/adult_cellrange_out
sEV is hard to detect in /home/fbio/Documents/AKI_CKD/sev/test/adult_cellrange_out


KeyError Traceback (most recent call last)
~/anaconda3/envs/secret_ev/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
3360 try:
-> 3361 return self._engine.get_loc(casted_key)
3362 except KeyError as err:

~/anaconda3/envs/secret_ev/lib/python3.7/site-packages/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

~/anaconda3/envs/secret_ev/lib/python3.7/site-packages/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'score'

The above exception was the direct cause of the following exception:

KeyError Traceback (most recent call last)
/tmp/ipykernel_248170/441552012.py in
----> 1 SEVtras.sEV_recognizer(sample_file='./sample_file',out_path='./outputs',species='Mus',alpha=0.09,score_t='1',predefine_threads=80)

~/anaconda3/envs/secret_ev/lib/python3.7/site-packages/SEVtras/main.py in sEV_recognizer(sample_file, out_path, input_path, species, predefine_threads, get_only, score_t, search_UMI, alpha, dir_origin)
165
166 else:
--> 167 adata.obs['sEV'] = ['sEV' if i else 'False' for i in (adata.obs['total_counts'] < search_UMI) & (adata.obs['score'] < score_t)]
168 adata.obs['score'] = -np.log10(adata.obs['score'] + adata.obs.loc[(adata.obs['score']>0).values, 'score'].min()/10)
169 adata.write(str(out_path) + '/raw_' + str(sample) + '.h5ad')

~/anaconda3/envs/secret_ev/lib/python3.7/site-packages/pandas/core/frame.py in getitem(self, key)
3456 if self.columns.nlevels > 1:
3457 return self._getitem_multilevel(key)
-> 3458 indexer = self.columns.get_loc(key)
3459 if is_integer(indexer):
3460 indexer = [indexer]

~/anaconda3/envs/secret_ev/lib/python3.7/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
3361 return self._engine.get_loc(casted_key)
3362 except KeyError as err:
-> 3363 raise KeyError(key) from err
3364
3365 if is_scalar(key) and isna(key) and not self.hasnans:

KeyError: 'score'`

@RuiqiaoHe
Copy link
Member

RuiqiaoHe commented Jan 2, 2024

In your command line the 'score_t' is set to extremely low, but SEVtras cannot find any potential sEVs. Could you please check the input file that you are using as input? As I mentioned above, the CellRanger output for each scRNA-seq sample contains two folders: filtered_feature_bc_matrix and raw_feature_bc_matrix. SEVtras needs the data files in the raw_feature_bc_matrix directory as input.
The raw_feature_bc_matrix folder would be located in the outs of the CellRanger outputs for each scRNA-seq sample. Here is one example:
image

@FLY-Fiancee
Copy link
Author

FLY-Fiancee commented Jan 2, 2024

I think I have the file raw_feature_bc_matrix in the right place, because such code exists in your source code:adata = read_10x_mtx(adata_path + '/outs/raw_feature_bc_matrix/'),My file location was eventually identified as /home/fbio/Documents/ABC/sev/test/adult_cellrange_out/ + /outs/raw_feature_bc_matrix/

@RuiqiaoHe
Copy link
Member

RuiqiaoHe commented Jan 2, 2024

If so, the return 0 0 No genes enriched, please check input; sEV is hard to detect in xxx sample means that SEVtras was unable to identify sEVs in this sample. This condition occurs in some samples, where the level of sEVs is under the detect limit of SEVtras. Could you please share the raw data to me, and I will verify the above?

@FLY-Fiancee
Copy link
Author

Thank you for your willingness to help test the data, I've sent you the data number via email.

@finalbeibeiyu
Copy link

SEVtras.sEV_recognizer(
sample_file='/mnt/data/home/tycloud/NandA/input/sample_list.txt',
out_path='/mnt/data/home/tycloud/NandA/input/outputs',
species='Mus',
dir_origin=False,
score_t= '0',
alpha=0.001)
image
I have also encountered the same problem. I am not sure if the author can take a look at my data at your convenience

@RuiqiaoHe
Copy link
Member

Could you please check the input droplet-gene matrix for SEVtras should be the raw data? Herein, the matrix should come from the raw_feature_bc_matrix directory in Cell Ranger outs.

@finalbeibeiyu
Copy link

image
image
The file I entered is a standard file provided by 10x. I am not sure if this format matches the input file. If it does, I will send it to you; Not suitable, please tell me the appropriate input file method. thanks

@RuiqiaoHe
Copy link
Member

The file format is right. However, the content in the file may not match. The output of 10X CellRanger will output two folders. One is the filtered_feature_bc_matrix and raw_feature_bc_matrix. You can refer to the following:

As I mentioned above, the CellRanger output for each scRNA-seq sample contains two folders: filtered_feature_bc_matrix and raw_feature_bc_matrix. SEVtras needs the data files in the raw_feature_bc_matrix directory as input. The raw_feature_bc_matrix folder would be located in the outs of the CellRanger outputs for each scRNA-seq sample. Here is one example: image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants