mortazavilab / swan_vis

A Python library to visualize and analyze long-read transcriptomes
https://freese.gitbook.io/swan/
MIT License
57 stars 11 forks source link

replace talon.db #16

Closed xiaonalu closed 2 years ago

xiaonalu commented 2 years ago

Hello, I have my data preprocessed using SQANIT3. I was wondering if I don't want to use the talon.db, what data from SQANTI3 could replace it? If I don't need the quantification, but only the visualization of my transcripts, is it still necessary? Thanks Best Xiaona

fairliereese commented 2 years ago

Swan is able to handle GTFs as input for transcriptomes. You should be able to use the one that's output from SQANTI. If that gives you any trouble please let me know.

fairliereese commented 2 years ago

Please look at this section of the documentation: https://freese.gitbook.io/swan/tutorials/getting_started#adding-transcript-models-from-a-gtf

xiaonalu commented 2 years ago

Thank you for the tutorial. There is still an issue regarding the "merge on int64" as below

Traceback (most recent call last):   File "/Swan/Swan.py", line 24, in     sg.add_abundance(ab_file)   File "/conda_envs/swan/lib/python3.9/site-packages/swan_vis/swangraph.py", line 276, in add_abundance     df = df.merge(self.t_df['tid'].to_frame(), how='right', left_on='tid', right_index=True)   File "/conda_envs/swan/lib/python3.9/site-packages/pandas/core/frame.py", line 9191, in merge     return merge(   File "/conda_envs/swan/lib/python3.9/site-packages/pandas/core/reshape/merge.py", line 105, in merge     op = _MergeOperation(   File "/conda_envs/swan/lib/python3.9/site-packages/pandas/core/reshape/merge.py", line 702, in init     self._maybe_coerce_merge_keys()   File "/conda_envs/swan/lib/python3.9/site-packages/pandas/core/reshape/merge.py", line 1255, in _maybe_coerce_merge_keys     raise ValueError(msg) ValueError: You are trying to merge on int64 and object columns. If you wish to proceed you should use pd.concat

fairliereese commented 2 years ago

Can you send me a screenshot of your abundance file please?

xiaonalu commented 2 years ago

Yes. Thank you

Screen Shot 2021-12-10 at 1 51 23 PM
fairliereese commented 2 years ago

Can you also please send me a couple of lines of your GTF? It seems like you might have mismatches between the transcript IDs reported in your GTF and reported in your abundance matrix.

xiaonalu commented 2 years ago

Could this link work for you?https://drive.google.com/drive/folders/1mxvjWqdYfzzdTNJPP9aOiJHnnFoWwMNv?usp=sharing Thanks a lot

fairliereese commented 2 years ago

Nope, I don't have access to that. Just the first few lines copied here should work.

xiaonalu commented 2 years ago

I figure out the reason of that error I think. When SQANTI3 generate the abundance matrix, the third column is p value. I removed it using excel, when I forgot to change the format. When I use the corrected tab separate file, the problem solved. Thank you so much for the wonderful script. The figure is very beautiful.

fairliereese commented 2 years ago

Oh perfect, glad it worked for you! Please don't hesitate to ask if you have any more questions :)