SyntaxWarning in reporter_SNV.py
Hi, thank you for the great tool and recent update. I ran reporter_SNV.py -h to check if it is correctly installed and gave out syntax warning message as follows.
"reporter_SNV.py:223: SyntaxWarning: invalid escape sequence '\.'
dp_df['REF_no'] = dp_df['MATCH'].str.count("[\.\,]").astype('Int64')"
It seemed like line to find dot or comma so I changed the line to the following.
dp_df['REF_no'] = dp_df['MATCH'].str.count(r"[.,]").astype("Int64")
Would this be plausible and not affect the workflow in reporter_SNV.py? Thank you for your help in advance.
Hi Kyung-Tae,
Thanks for raising the issue. The pattern is deprecated for python 3.12. I've updated the pattern. Please try it again for the new version.
Regards, Cheng-Kai
Hi, Cheng-Kai,
Thank you for the reply. I ran the scNanoGPS reporter_SNV.py and gave out following error. I masked the PATH just in case.
Traceback (most recent call last):
File "reporter_SNV.py", line 555, in <module>
pileup_df, options = merge_mpileup(CB_list, options)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "reporter_SNV.py", line 207, in merge_mpileup
pileup_df['POS'] = pileup_df['POS'].apply(str)
~~~~~~~~~^^^^^^^
File "[PATH]/scNanoGPS/lib/python3.13/site-packages/pandas/core/frame.py", line 4102, in __getitem__
indexer = self.columns.get_loc(key)
File "PATH]/scNanoGPS/lib/python3.13/site-packages/pandas/core/indexes/range.py", line 417, in get_loc
raise KeyError(key)
KeyError: 'POS'
Could you help me what is the problem here. I have "filtered_SNV_position_list.tsv.gz" and "SNV_matrix.filtered.vcf.gz" generated but got the error. Thank you for your help in advance.
Hi Kyung-Tae,
This error could be due to some error during running longshot. By default, scNanoGPS delete the meta files to save storage. Could you please try running reporter_SNV.py with additional parameter " --keep_meta 1 " ? With this parameter, the meta files would be kept. So that you can trace them down.
After that, you'll find some meta files, like <cell_barcode>.mpileup <cell_barcode>.vcf. Please check these meta files. If it is convenient, please provide some further information.
Furthermore, could you please try dry-running samtools, bcftools, tabix ?
I tried running a small test dataset under python3.13, and there's no error produced. I'll try running a complete sample.
Hope this helps.
Regards, Cheng-Kai
Hi, Cheng-Kai,
I ran reported_SNV.py again with " --keep_meta 1" and found that file with "mpileup" suffix are all empty. samtools, bcftools, tabix are all set up and I will leave their version information below fyi.
Thank you for your help in advance.
Hi Kyung-Tae,
Your environment sounds good. The empty mpileup result is not normal. Please check files "longshot.output.<cell_barcode>.log" and "longshot.output.<cell_barcode>.vcf.gz" If you find any error in "longshot.output.<cell_barcode>.log", then I guess your tmp files might be truncated. Please re-clone scNanoGPS tools (make sure you delete the scNanoGPS tools you had), and then re-run scNanoGPS again. Thanks.
Regards, Cheng-Kai