ribosomeprofiling / ribor

R interface for .ribo files
4 stars 1 forks source link

plot_metagene #20

Closed imilenkovic closed 1 year ago

imilenkovic commented 1 year ago

Hello,

I was wondering if it would be possible to change the values of the x-axis when using plot_metagene - ie. when plotting the stop position the coverage is from -50 to 50, and I was wondering if I could somehow have it start earlier, eg. -150 or so? I'd also like to do the same with the start position, just the other way around.

Thank you! Ivan

hakanozadam commented 1 year ago

Hello,

Yes, it is possible to change the x-axis values. There are two solutions:

1) This is the easier and recommended solution. If you have access to the seqeuncing data and ran Ribofow to generate the ribo file, you can change the parameters so that 150 nucleotides to the left and to the right of the start / stop sites are included. Go to the yaml file that you used in your Riboflow run and change the parameter called metagene_radius to 150. Note that its default value is 50: https://github.com/ribosomeprofiling/riboflow/blob/082ff926b9ca6ff1ddb596aa9ea53fc3b24e51a9/project.yaml#L63.

2) If you don't want to (or can't) re-run the pipeline, then you can get the nucleotide coverage for each transcript individually. You can use get_coverage function for this. Using the function get_original_coordinates, you can obtain the position of the start and stop sites. Combining the two information (counts for the positions and position of the start/stop sites), you can pick the 150 nucleotides to the left and right of start and stop sites. Once you aggregate the counts from the transcripts, you can have the metagene plot.

I hope this helps!

imilenkovic commented 1 year ago

Hi, Thanks a lot for you answer! I can rerun the pipeline so I'll just edit the yaml file :) thanks! Ivan