lareaulab / psix

14 stars 7 forks source link

Type error when running psix_object.junctions2psi on 10x data #9

Closed ytliu01 closed 1 year ago

ytliu01 commented 1 year ago

Hi,

Thanks for such useful tool! I tried to run psix on 10x data aligned by STARsolo. My code is following

psix_object.junctions2psi(sj_dir='output/E2.Solo.out/SJ/raw/', 
                          intron_file='../psix_mm39_annotation.tab',
                          save_files_in='psix_output/',
                          solo = True, 
                          tenX=True)

And the error message is following

File "<stdin>", line 1
    psix_object.junctions2psi(sj_dir='output/E2.Solo.out/SJ/raw/', intron_file='../psix_mm39_annotation.tab',save_files_in='psix_output/',solo = True, tenX=True)
IndentationError: unexpected indent
>>> psix_object.junctions2psi(sj_dir='output/E2.Solo.out/SJ/raw/', intron_file='../psix_mm39_annotation.tab',save_files_in='psix_output/',solo = True, tenX=True)
Processing STARsolo output. This might take a few minutes...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home1/.local/lib/python3.9/site-packages/psix/psix.py", line 102, in junctions2psi
    solo_to_psi(self, solo_dir = sj_dir, intron_file = intron_file, tpm_file = tpm_file,
  File "/home1/.local/lib/python3.9/site-packages/psix/solo2psi.py", line 179, in solo_to_psi
    intron_mtx_CI, intron_mtx_exons = process_solo(solo_dir, intron_file, cell_list)
  File "/home1/.local/lib/python3.9/site-packages/psix/solo2psi.py", line 70, in process_solo
    intron_list = read_solo_features(solo_features_path)
  File "/home1/.local/lib/python3.9/site-packages/psix/solo2psi.py", line 16, in read_solo_features
    intron = row.chrom + ':' + str(row.start) + '-' + str(row.end) + ':'
TypeError: unsupported operand type(s) for +: 'int' and 'str'

Here is my feature table image

Thank you so much for your help in advance!

Best, YT

cfbuenabadn commented 1 year ago

Hi, this error is likely due to pandas reading your chromosome column as numerical, while the read_solo_features was expecting a string. I added a string transformation function to make sure that this is not an issue. It should be working now.