annaorteu / wrath

Wrath: WRapped Analysis of Tagged Haplotypes
GNU General Public License v3.0
8 stars 3 forks source link

No plotting option (wrath -p) not working as expected #7

Open gmkov opened 6 months ago

gmkov commented 6 months ago

I think the NO plotting option (wrath -p: "skip plotting the heatmap") is not working as expected, neither when run on its own nor when run at the same time as -l ("automatic detection of SVs").

Option -p -l should run sv_detection.py, WHILE skipping plot_heatmap.py AND sv_detection_and_heatmap.py, if I've understood correctly

wrath -p -l -g $genome -c $chromosome -w $winSize -a $group -t 15 -s $start -e $end 

ISSUE

Two issues arise after running the line above:

  1. This line DOES produce a heatmap in wrath_out/plots/ - despite option -p. So it seems like it is running a script that creates a heat map (either plot_heatmap.py or sv_detection_and_heatmap.py, i think the latter). Thus, the description of -p "skip plotting the heatmap" is confusing

  2. The following error appears at the end: sv_detection.py:

error: unrecognized arguments: -w wrath_out/beds/windows_100000_26_5125000_6806000.bed

/home/mgm49/rds/hpc-work/home/bin/wrath: line 307: Detecting SVs in matrix wrath_out/matrices/jaccard_matrix_100000_26_5125000_6806000_47.all.brazil.haplotagging.n93.txt step failed: 

Regarding the first error when trying to run sv_detection.py (-w) I already made a pull request for that https://github.com/annaorteu/wrath/pull/4 . The second part of the error is just saying that running sv_detection.py failed (because of the unknown -w option)

Similarly when running wrath -p -g $genome -c $chromosome -w $winSize -a $group -t 15 -s $start -e $end (note no SV detection option -l), it produces a heatmap in wrath_out/plots/

EXPLANATION

I think the issue might be the logic of the main wrath script, and it's a bit out of my depth so instead of suggesting a change I'll explain here and you can confirm or deny!

What it currently does is if -p -l are specified:

OTHER RELATED / LESS IMPORTANT ISSUE

I think that when running wrath -l (note no "no plot" -p option) it is still running the plot_heatmap.py (producing a heatmap without automatically detected SVs ) but then the plot is being overwritten with the plot produced by sv_detection_and_heatmap.py (exact same name). A bit wasteful :)

POSSIBLE SOLUTIONS

a) change main wrath script so that when -p is selected it skips the step "Plot results without automatic detection of SVs" plot_heatmap.py (while still running sv_detection.py if -l is specified) & accept my pull request to get rid of -w in the main wrath script when running sv_detection.py. Then both -p and -l can be used at the same time with the desired outcome (no plot but SV detection).

b) (less intuitive imo) chage the definition of -p to specify that it will still plot a heatmap, but this plot wont have automatically detected SVs

c) might be worth changing wrath so that "Plot results without automatic detection of SVs" plot_heatmap.py does NOT run if -l is specified (and -p is NOT specified, i.e. we want automatic SV detection and a heatmap), as the heatmap from sv_detection_and_heatmap.py will replace the heatmap from plot_heatmap.py

I have not made pull requests for these as up to the developers to decide what's best / correct me.

THANKS

Thanks for this amazing resource!! hope i can serve as a guinea pig