xryanglab / SCASL

single-cell clustering based on alternative splicing landscapes
Apache License 2.0
15 stars 3 forks source link

I got an error when I tried to run with your script: #3

Closed xiaojuanjuan94 closed 3 months ago

xiaojuanjuan94 commented 7 months ago

source activate scasl python main.py -y configs/srr.yaml

Errors reported as follows:

=============Normalization & Imputation============= reading data from process_result/20240416225626/filtered_matrix... Traceback (most recent call last): File "/share/home/lijuan/software/miniconda3/envs/scasl/SCASL-1.0.0/main.py", line 10, in scasl.fit() File "/share/home/lijuan/software/miniconda3/envs/scasl/SCASL-1.0.0/scasl/splice.py", line 95, in fit run_cluster(self.cfg) File "/share/home/lijuan/software/miniconda3/envs/scasl/SCASL-1.0.0/scasl/splice.py", line 66, in run_cluster df_final, mat = normalize(filter_path, cfg.impute.num_iteration, cfg.impute.knn) File "/share/home/lijuan/software/miniconda3/envs/scasl/SCASL-1.0.0/scasl/normalize.py", line 92, in normalize dfs = norm_only(df_path, 'start') File "/share/home/lijuan/software/miniconda3/envs/scasl/SCASL-1.0.0/scasl/normalize.py", line 40, in norm_only df_prob = to_prob(df, groupby=groupby) File "/share/home/lijuan/software/miniconda3/envs/scasl/SCASL-1.0.0/scasl/normalize.py", line 22, in to_prob sums = sums.drop(columns=['start', 'end']) File "/share/home/lijuan/software/miniconda3/envs/scasl/lib/python3.9/site-packages/pandas/core/frame.py", line 5568, in drop return super().drop( File "/share/home/lijuan/software/miniconda3/envs/scasl/lib/python3.9/site-packages/pandas/core/generic.py", line 4785, in drop obj = obj._drop_axis(labels, axis, level=level, errors=errors) File "/share/home/lijuan/software/miniconda3/envs/scasl/lib/python3.9/site-packages/pandas/core/generic.py", line 4827, in _drop_axis new_axis = axis.drop(labels, errors=errors) File "/share/home/lijuan/software/miniconda3/envs/scasl/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 7070, in drop raise KeyError(f"{labels[mask].tolist()} not found in axis") KeyError: "['end'] not found in axis"

kokox10 commented 6 months ago

It seems that your issue is similar to the one addressed in a previous response. I kindly suggest referring to that particular reply for further information and guidance. Here is the link to the relevant response: #1

hmgene commented 5 months ago

after groupby=start the column name is end_y not end, which may not be dropped. after groupby=end the column name is start_y not start, which may not be dropped. can you fix this if my interpretation is correct?

My solution would be:

    if( groupby=="start" ):
       sums = sums.drop(columns=['start', 'end_x', 'end_y'])
    else:
       sums = sums.drop(columns=['start_x','start_y','end'])
    #sums = sums.drop(columns=['start', 'end'])