Xinglab / rmats2sashimiplot

GNU General Public License v2.0
135 stars 54 forks source link

Got a similar issue that was reported before (Issues # 72, and 115). I am not sure how to fix it after saving the -e SE JC file as tab delimited text #138

Open nbizzozero opened 1 month ago

nbizzozero commented 1 month ago

I am trying to use rmats2sashimi and for some reason, I am encountering a similar issue that was reported before and commented on October 8, 2021 Issues # 72 and 115.

usage: rmats2sashimiplot [-h] -o OUT_DIR [--l1 L1] [--l2 L2] [--event-type {SE,A5SS,A3SS,MXE,RI}] [-e EVENTS_FILE] [-c COORDINATE] [--s1 S1] [--s2 S2] [--b1 B1] [--b2 B2] [--exon_s EXON_S] [--intron_s INTRON_S] [--group-info GROUP_INFO] [--min-counts MIN_COUNTS] [--color COLOR] [--font-size FONT_SIZE] [--fig-height FIG_HEIGHT] [--fig-width FIG_WIDTH] [--hide-number] [--no-text-background] [--keep-event-chr-prefix] [--remove-event-chr-prefix] 'chr' is not in list There is an exception in plot_with_eventsfile Traceback (most recent call last): File "./rmats2sashimiplot/src/rmats2sashimiplot/rmats2sashimiplot.py", line 953, in main() File "./rmats2sashimiplot/src/rmats2sashimiplot/rmats2sashimiplot.py", line 949, in main plot_with_eventsfile(options) File "./rmats2sashimiplot/src/rmats2sashimiplot/rmats2sashimiplot.py", line 606, in plot_with_eventsfile options.events_file = create_chr_aware_events_file(options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ./rmats2sashimiplot/src/rmats2sashimiplot/rmats2sashimiplot.py", line 589, in create_chr_aware_events_file chr_index = columns.index('chr') ^^^^^^^^^^^^^^^^^^^^ I saved my SE_JC file to .txt in a couple of ways but it still does not work and I can see the chr column well delineated. Any ideas on how to fix this?

Thanks so much, Nora

EricKutschera commented 1 month ago

The error would happen if the file given with -e doesn't have chr as a tab separated value on the first line of the file. Can you upload that file?

nbizzozero commented 1 month ago

Thank you, Eric. I fixed the chr error, but now I got a different error " invalid literal for int() with base 10: 'upstreamEE' " as shown below. I also uploaded the .txt file that I used for this. I know that I am close to solving the problem. Essentially, the issue is with converting an Excel file to a .txt file and not having problems with the columns or extra characters like " added to the first and last IncLev numbers.

Thanks again, Nora

image SE-Neurites.txt

EricKutschera commented 1 month ago

The code is expecting the same columns (and in the same order) as SE.MATS.JC.txt. Your file doesn't have ID as the first column which causes the code to process that first line as a regular row and not as the header. Also the line that gave the error is expecting the value for exonStart_0base as the 6th column (items[5]), but it found upstreamEE in that position

The expected headers are: ID GeneID geneSymbol chr strand exonStart_0base exonEnd upstreamES upstreamEE downstreamES downstreamEE ID IJC_SAMPLE_1 SJC_SAMPLE_1 IJC_SAMPLE_2 SJC_SAMPLE_2 IncFormLen SkipFormLen PValue FDR IncLevel1 IncLevel2 IncLevelDifference

Your file had (including a few trailing tabs): geneSymbol chr exonStart_0base exonEnd upstreamES upstreamEE downstreamES downstreamEE IJC_SAMPLE_1 SJC_SAMPLE_1 IJC_SAMPLE_2 SJC_SAMPLE_2 FDR IncLevel1 IncLevel2 IncLevelDifference

nbizzozero commented 1 month ago

Thank you again, Eric.

I was trying different ways of converting the .xls to .txt file and when I used the space-delimited conversion I had too many columns and deleted a couple of those. I am going to use the tab-limited conversion and only remove the extra “ characters while keeping all the columns the same as in the original file.

Thanks for your patience explaining what I need to do to fix the SE_JC file,

I am sure it will work now.

Best regards, Nora From: Eric Kutschera @.> Sent: Friday, November 1, 2024 8:35 AM To: Xinglab/rmats2sashimiplot @.> Cc: Nora Bizzozero @.>; Author @.> Subject: Re: [Xinglab/rmats2sashimiplot] Got a similar issue that was reported before (Issues # 72, and 115). I am not sure how to fix it after saving the -e SE JC file as tab delimited text (Issue #138)

[[-- External - this message has been sent from outside the University --]]

The code is expecting the same columns (and in the same order) as SE.MATS.JC.txt. Your file doesn't have ID as the first column which causes the code to process that first line as a regular row and not as the header. Also the line that gave the error is expecting the value for exonStart_0base as the 6th column (items[5]), but it found upstreamEE in that position

The expected headers are: ID GeneID geneSymbol chr strand exonStart_0base exonEnd upstreamES upstreamEE downstreamES downstreamEE ID IJC_SAMPLE_1 SJC_SAMPLE_1 IJC_SAMPLE_2 SJC_SAMPLE_2 IncFormLen SkipFormLen PValue FDR IncLevel1 IncLevel2 IncLevelDifference

Your file had (including a few trailing tabs): geneSymbol chr exonStart_0base exonEnd upstreamES upstreamEE downstreamES downstreamEE IJC_SAMPLE_1 SJC_SAMPLE_1 IJC_SAMPLE_2 SJC_SAMPLE_2 FDR IncLevel1 IncLevel2 IncLevelDifference

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/Xinglab/rmats2sashimiplot/issues/138*issuecomment-2451978232__;Iw!!KXH1hvEXyw!eJsYchXSBqVzzag_lM_c5tUqCru0mKrlNjUHLOZ-w8JIa6E5_i1bzwNwbgJa_dTNG2YuquV9NJzOz62pYUgSLAv4cG4iLAk$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/BHYLHAW5H5IFBEBWFFNDMM3Z6OGSBAVCNFSM6AAAAABQ7JRHHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJRHE3TQMRTGI__;!!KXH1hvEXyw!eJsYchXSBqVzzag_lM_c5tUqCru0mKrlNjUHLOZ-w8JIa6E5_i1bzwNwbgJa_dTNG2YuquV9NJzOz62pYUgSLAv4P3mupS8$. You are receiving this because you authored the thread.Message ID: @.**@.>>

nbizzozero commented 1 month ago

Thanks again. I am thrilled to see the plots!!!!

From: Nora Bizzozero Sent: Friday, November 1, 2024 10:56 AM To: Xinglab/rmats2sashimiplot @.>; Xinglab/rmats2sashimiplot @.> Cc: Author @.>; David N Linsenbardt @.> Subject: RE: [Xinglab/rmats2sashimiplot] Got a similar issue that was reported before (Issues # 72, and 115). I am not sure how to fix it after saving the -e SE JC file as tab delimited text (Issue #138)

Thank you again, Eric.

I was trying different ways of converting the .xls to .txt file and when I used the space-delimited conversion I had too many columns and deleted a couple of those. I am going to use the tab-limited conversion and only remove the extra “ characters while keeping all the columns the same as in the original file.

Thanks for your patience explaining what I need to do to fix the SE_JC file,

I am sure it will work now.

Best regards, Nora From: Eric Kutschera @.**@.>> Sent: Friday, November 1, 2024 8:35 AM To: Xinglab/rmats2sashimiplot @.**@.>> Cc: Nora Bizzozero @.**@.>>; Author @.**@.>> Subject: Re: [Xinglab/rmats2sashimiplot] Got a similar issue that was reported before (Issues # 72, and 115). I am not sure how to fix it after saving the -e SE JC file as tab delimited text (Issue #138)

[[-- External - this message has been sent from outside the University --]]

The code is expecting the same columns (and in the same order) as SE.MATS.JC.txt. Your file doesn't have ID as the first column which causes the code to process that first line as a regular row and not as the header. Also the line that gave the error is expecting the value for exonStart_0base as the 6th column (items[5]), but it found upstreamEE in that position

The expected headers are: ID GeneID geneSymbol chr strand exonStart_0base exonEnd upstreamES upstreamEE downstreamES downstreamEE ID IJC_SAMPLE_1 SJC_SAMPLE_1 IJC_SAMPLE_2 SJC_SAMPLE_2 IncFormLen SkipFormLen PValue FDR IncLevel1 IncLevel2 IncLevelDifference

Your file had (including a few trailing tabs): geneSymbol chr exonStart_0base exonEnd upstreamES upstreamEE downstreamES downstreamEE IJC_SAMPLE_1 SJC_SAMPLE_1 IJC_SAMPLE_2 SJC_SAMPLE_2 FDR IncLevel1 IncLevel2 IncLevelDifference

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/Xinglab/rmats2sashimiplot/issues/138*issuecomment-2451978232__;Iw!!KXH1hvEXyw!eJsYchXSBqVzzag_lM_c5tUqCru0mKrlNjUHLOZ-w8JIa6E5_i1bzwNwbgJa_dTNG2YuquV9NJzOz62pYUgSLAv4cG4iLAk$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/BHYLHAW5H5IFBEBWFFNDMM3Z6OGSBAVCNFSM6AAAAABQ7JRHHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJRHE3TQMRTGI__;!!KXH1hvEXyw!eJsYchXSBqVzzag_lM_c5tUqCru0mKrlNjUHLOZ-w8JIa6E5_i1bzwNwbgJa_dTNG2YuquV9NJzOz62pYUgSLAv4P3mupS8$. You are receiving this because you authored the thread.Message ID: @.**@.>>

nbizzozero commented 4 weeks ago

Thank you again, Eric.

I was trying different ways of converting the .xls to .txt file and when I used the space-delimited conversion I had too many columns and deleted a couple of those. I am going to use the tab-limited conversion and only remove the extra “ characters while keeping all the columns the same as in the original file.

Thanks for your patience in explaining what I need to do to fix the SE_JC file,

I am sure it will work now.

Good news: The program worked and I got the index files OK as shown below . Bad news: Unfortunately, I could not print the plots. So my new question for you is: Do I need to have MISO installed as well?

This is the new error I found after rmats2sashimplot program finished running:

"/users/nperrone/rmats2sashimiplot/src/MISO/misopy/index_gff.py", line 77 print "Making directory: %s" %(chrom_dir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? /carc/scratch/users/nperrone/.conda/envs/rmats2sashimiplot/bin/python /users/nperrone/rmats2sashimiplot/src/MISO/misopy/sashimi_plot/sashimi_plot.py --plot-event "2_7060034870600419-@2_7059920670599274-@2_7058781870587893-" /users/nperrone/test_events_output/Sashimi_index_Tlk1_1 /users/nperrone/test_events_output/Sashimi_index_Tlk1_1/sashimi_plot_settings.txt --output-dir /users/nperrone/test_events_output/Sashimi_plot File "/users/nperrone/rmats2sashimiplot/src/MISO/misopy/sashimi_plot/sashimi_plot.py", line 46 print "WARNING: %s does not end in .miso_bf, are you sure it is the " \ AND so on for the other genes:

It seems to me that everything is working well except that I cannot plot and print the plots Sashimi plot output from CARC but unable to print as yet

EricKutschera commented 3 weeks ago

The error is SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

The error would happen if you use Python3 with the unmodified source code for rmats2sashimiplot which is written for Python2. Here is a similar issue: https://github.com/Xinglab/rmats2sashimiplot/issues/83

Your command used python from /carc/scratch/users/nperrone/.conda/envs/rmats2sashimiplot/bin/python and the rmats2sashimiplot code was from /users/nperrone/rmats2sashimiplot/src/MISO/misopy/sashimi_plot/sashimi_plot.py

You could either convert the source code with:

cd /users/nperrone/rmats2sashimiplot
./2to3.sh

Or if you installed rmats2sashimiplot to that conda environment then you should be able to just run rmats2sashimiplot when that environment is active

nbizzozero commented 3 weeks ago

It worked!!! Thanks so much!!!

I got PDFs of all the plots I need using the code to convert the source you sent me.

All the best, Nora

From: Eric Kutschera @.> Sent: Monday, November 4, 2024 6:44 AM To: Xinglab/rmats2sashimiplot @.> Cc: Nora Bizzozero @.>; Author @.> Subject: Re: [Xinglab/rmats2sashimiplot] Got a similar issue that was reported before (Issues # 72, and 115). I am not sure how to fix it after saving the -e SE JC file as tab delimited text (Issue #138)

[[-- External - this message has been sent from outside the University --]]

The error is SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

The error would happen if you use Python3 with the unmodified source code for rmats2sashimiplot which is written for Python2. Here is a similar issue: #83https://urldefense.com/v3/__https:/github.com/Xinglab/rmats2sashimiplot/issues/83__;!!KXH1hvEXyw!akjkapgBwbgk_75LY_Okf9nNCRitjK3DMnUMCXTlw6GAfE6CzJ9DwtVaqTBNutB5Crn5ZWzXmo6pxYzETE1d8l7-bDP82PQ$

Your command used python from /carc/scratch/users/nperrone/.conda/envs/rmats2sashimiplot/bin/python and the rmats2sashimiplot code was from /users/nperrone/rmats2sashimiplot/src/MISO/misopy/sashimi_plot/sashimi_plot.py

You could either convert the source code with:

cd /users/nperrone/rmats2sashimiplot

./2to3.sh

Or if you installed rmats2sashimiplot to that conda environment then you should be able to just run rmats2sashimiplot when that environment is active

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/Xinglab/rmats2sashimiplot/issues/138*issuecomment-2454752015__;Iw!!KXH1hvEXyw!akjkapgBwbgk_75LY_Okf9nNCRitjK3DMnUMCXTlw6GAfE6CzJ9DwtVaqTBNutB5Crn5ZWzXmo6pxYzETE1d8l7-KPxCoE4$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/BHYLHAUD2RKIJW6E662ZYVTZ65TXFAVCNFSM6AAAAABQ7JRHHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJUG42TEMBRGU__;!!KXH1hvEXyw!akjkapgBwbgk_75LY_Okf9nNCRitjK3DMnUMCXTlw6GAfE6CzJ9DwtVaqTBNutB5Crn5ZWzXmo6pxYzETE1d8l7-fpnvKS4$. You are receiving this because you authored the thread.Message ID: @.**@.>>