Hi,
I have a couple of Roassal questions regarding how to customize the plots of a genome metric known as GC skew, and how to scale the visualization to cover a (bacterial) genome scale data. I have isolated a Roassal sample code below from BioSmalltalk to show how I did an initial GC skew graphic:
| b values ds |
values := 'GGCTGCGTTCCCCTCAGTTAGCGCCTATCCTAAGCAGATCTGTAGTTAGTACTGTCTAAGCTTGTTAGACTACTCGGAACTTGCTGATATTAACCTTACCCCCGTCGAAACGCTTATTCCGCTTTGCTACTTCAAGCCCTGTAACATCTACTGTACTGACAAGGTTGCAGTAGCAATTGGCAAGGCTGTTTGGCATCTCAGATGACAGTTACCCGTGTTGCGCTCACCCGCAGCGACTCTCGGATACGTAACGCAGAAGACGTCTTCCGCGAGATTTGGGCGCGTCTGTCCACCTTCCCAGGTTGGCATTGGCAGAAGCTCTATCCGGCTTTGTTCCTCTAGCGGCTCCGCA' asDNASimpleSequence gcSkewInt.
values := #(0 1 2 1 1 2 1 2 2 2 1 0 -1 -2 -2 -3 -3 -2 -2 -2 -2 -1 -2 -1 -2 -3 -3 -3 -3 -4 -5 -5 -5 -5 -4 -5 -5 -4 -4 -4 -5 -5 -4 -4 -4 -3 -3 -3 -3 -2 -2 -2 -3 -3 -2 -2 -3 -3 -3 -3 -2 -3 -3 -3 -2 -2 -2 -2 -1 -1 -2 -2 -2 -3 -3 -4 -3 -2 -2 -2 -3 -3 -3 -2 -3 -3 -2 -2 -2 -2 -2 -2 -2 -2 -3 -4 -4 -4 -4 -5 -6 -7 -8 -9 -8 -8 -9 -8 -8 -8 -8 -9 -8 -9 -9 -9 -9 -9 -9 -10 -11 -10 -11 -11 -11 -11 -10 -11 -11 -11 -12 -12 -12 -13 -13 -13 -12 -13 -14 -15 -15 -14 -14 -14 -14 -15 -15 -15 -16 -16 -16 -17 -17 -16 -16 -16 -17 -17 -16 -16 -17 -17 -17 -16 -15 -15 -15 -14 -15 -15 -14 -14 -14 -13 -14 -14 -14 -14 -14 -13 -12 -13 -13 -13 -12 -11 -12 -12 -11 -11 -11 -11 -10 -9 -10 -10 -10 -11 -11 -12 -12 -11 -11 -11 -10 -10 -11 -11 -10 -10 -10 -10 -11 -12 -13 -12 -12 -11 -11 -11 -10 -11 -10 -11 -11 -12 -12 -13 -14 -15 -14 -15 -15 -14 -15 -14 -14 -15 -15 -16 -16 -17 -16 -15 -15 -15 -15 -16 -15 -15 -15 -15 -16 -15 -16 -16 -15 -15 -15 -14 -14 -15 -14 -14 -15 -15 -15 -16 -17 -16 -17 -16 -16 -15 -15 -15 -15 -15 -14 -13 -12 -13 -12 -13 -12 -12 -13 -13 -12 -12 -13 -14 -14 -15 -16 -16 -16 -17 -18 -19 -19 -18 -17 -17 -17 -16 -15 -16 -16 -16 -16 -15 -14 -15 -15 -14 -14 -14 -13 -14 -14 -15 -15 -15 -15 -16 -17 -16 -15 -16 -16 -16 -16 -15 -15 -15 -16 -17 -17 -18 -18 -18 -17 -18 -17 -16 -17 -17 -18 -19 -18 -19 -19).
b := RTGrapher new. b extent: 800 @ 500. ds := RTData new noDot; points: values; connectColor: Color red; yourself. b add: ds. b axisY minValue: values min; title: 'Skew'; color: Color black; noDecimal. b axisX numberOfTicks: 10; noDecimal; color: Color black; title: 'Position'. b open
1) You can see the result in the TR Morph.png attached file. In X axis, how can set up a tick every certain step value? For example, every 50 points. Right now this is 88, 176, 264, 353 and I would like to be 50, 100, 150, 200, 250, 300, 350, 400.
2) I just plotted a very short DNA sequence, however if I would like to plot GC skew for E.coli that would take hundreds of points. The following scripts takes ages to complete or it never ends. You will find attached the necessary files:
| grapher ds eColiGCSkew zipArchive |
" The original dataset " "(ZnEasy get: 'http://bioinformaticsalgorithms.com/data/realdatasets/Replication/E_coli.txt') contents asDNASimpleSequence." "'/Users/mvs/Downloads/E_coli.txt' asFileReference size." "4639675"
" GC Skew calc using BioSmalltalk " "eColiGCSkew := '/Users/mvs/Downloads/E_coli.txt' asFileReference contents asDNASimpleSequence gcSkewInt."
" GC Skew already calculated in a FUEL compressed for this example " zipArchive := ZipArchive new. [ zipArchive readFrom: 'ecoligcskew.zip' fullName; extractAllTo: '.' ] ensure: [ zipArchive close ]. eColiGCSkew := FLMaterializer materializeFromFileNamed: 'OrderedCollection_3712516797.obj'. grapher := RTGrapher new extent: 800 @ 500; yourself. ds := RTData new noDot; points: eColiGCSkew; connectColor: Color red; yourself. grapher add: ds. grapher axisY minValue: eColiGCSkew min; title: 'Skew'; color: Color black; noDecimal. grapher axisX numberOfTicks: 10; noDecimal; color: Color black; title: 'Position'. grapher open
The skew_diagram_ecoli.png shows how the expected final plot.
Cheers,
Hernán
Hi,
I have a couple of Roassal questions regarding how to customize the plots of a genome metric known as GC skew, and how to scale the visualization to cover a (bacterial) genome scale data. For a toy example, I have isolated a Roassal sample code below from BioSmalltalk to show how I did an initial GC skew graphic:
| b values ds |
values := 'GGCTGCGTTCCCCTCAGTTAGCGCCTATCCTAAGCAGATCTGTAGTTAGTACTGTCTAAGCTTGTTAGACTACTCGGAACTTGCTGATATTAACCTTACCCCCGTCGAAACGCTTATTCCGCTTTGCTACTTCAAGCCCTGTAACATCTACTGTACTGACAAGGTTGCAGTAGCAATTGGCAAGGCTGTTTGGCATCTCAGATGACAGTTACCCGTGTTGCGCTCACCCGCAGCGACTCTCGGATACGTAACGCAGAAGACGTCTTCCGCGAGATTTGGGCGCGTCTGTCCACCTTCCCAGGTTGGCATTGGCAGAAGCTCTATCCGGCTTTGTTCCTCTAGCGGCTCCGCA' asDNASimpleSequence gcSkewInt.
values := #(0 1 2 1 1 2 1 2 2 2 1 0 -1 -2 -2 -3 -3 -2 -2 -2 -2 -1 -2 -1 -2 -3 -3 -3 -3 -4 -5 -5 -5 -5 -4 -5 -5 -4 -4 -4 -5 -5 -4 -4 -4 -3 -3 -3 -3 -2 -2 -2 -3 -3 -2 -2 -3 -3 -3 -3 -2 -3 -3 -3 -2 -2 -2 -2 -1 -1 -2 -2 -2 -3 -3 -4 -3 -2 -2 -2 -3 -3 -3 -2 -3 -3 -2 -2 -2 -2 -2 -2 -2 -2 -3 -4 -4 -4 -4 -5 -6 -7 -8 -9 -8 -8 -9 -8 -8 -8 -8 -9 -8 -9 -9 -9 -9 -9 -9 -10 -11 -10 -11 -11 -11 -11 -10 -11 -11 -11 -12 -12 -12 -13 -13 -13 -12 -13 -14 -15 -15 -14 -14 -14 -14 -15 -15 -15 -16 -16 -16 -17 -17 -16 -16 -16 -17 -17 -16 -16 -17 -17 -17 -16 -15 -15 -15 -14 -15 -15 -14 -14 -14 -13 -14 -14 -14 -14 -14 -13 -12 -13 -13 -13 -12 -11 -12 -12 -11 -11 -11 -11 -10 -9 -10 -10 -10 -11 -11 -12 -12 -11 -11 -11 -10 -10 -11 -11 -10 -10 -10 -10 -11 -12 -13 -12 -12 -11 -11 -11 -10 -11 -10 -11 -11 -12 -12 -13 -14 -15 -14 -15 -15 -14 -15 -14 -14 -15 -15 -16 -16 -17 -16 -15 -15 -15 -15 -16 -15 -15 -15 -15 -16 -15 -16 -16 -15 -15 -15 -14 -14 -15 -14 -14 -15 -15 -15 -16 -17 -16 -17 -16 -16 -15 -15 -15 -15 -15 -14 -13 -12 -13 -12 -13 -12 -12 -13 -13 -12 -12 -13 -14 -14 -15 -16 -16 -16 -17 -18 -19 -19 -18 -17 -17 -17 -16 -15 -16 -16 -16 -16 -15 -14 -15 -15 -14 -14 -14 -13 -14 -14 -15 -15 -15 -15 -16 -17 -16 -15 -16 -16 -16 -16 -15 -15 -15 -16 -17 -17 -18 -18 -18 -17 -18 -17 -16 -17 -17 -18 -19 -18 -19 -19).
b := RTGrapher new. b extent: 800 @ 500. ds := RTData new noDot; points: values; connectColor: Color red; yourself. b add: ds. b axisY minValue: values min; title: 'Skew'; color: Color black; noDecimal. b axisX numberOfTicks: 10; noDecimal; color: Color black; title: 'Position'. b open
1) You can see the result in the TR Morph.png attached file. In X axis, how can set up a tick every certain step value? For example, every 50 points. Right now this is 88, 176, 264, 353 and I would like to be 50, 100, 150, 200, 250, 300, 350, 400.
2) I just plotted a very short toy DNA sequence, however if I would like to plot GC skew for E.coli that would take hundreds of points. The following script takes ages to complete or it never ends. You will find attached the necessary files:
| grapher ds eColiGCSkew zipArchive |
" The original dataset " "(ZnEasy get: 'http://bioinformaticsalgorithms.com/data/realdatasets/Replication/E_coli.txt') contents asDNASimpleSequence." "'/Users/mvs/Downloads/E_coli.txt' asFileReference size." "4639675"
" GC Skew calc using BioSmalltalk " "eColiGCSkew := '/Users/mvs/Downloads/E_coli.txt' asFileReference contents asDNASimpleSequence gcSkewInt."
" GC Skew already calculated in a FUEL compressed for this example, ecoligcskew.zip available at https://drive.google.com/file/d/1k9qayWrGkBEOeZ3Wb8TIJ80Rl-IR2Znx/view?usp=s... "
zipArchive := ZipArchive new. [ zipArchive readFrom: 'ecoligcskew.zip' fullName; extractAllTo: '.' ] ensure: [ zipArchive close ]. eColiGCSkew := FLMaterializer materializeFromFileNamed: 'OrderedCollection_3712516797.obj'. grapher := RTGrapher new extent: 800 @ 500; yourself. ds := RTData new noDot; points: eColiGCSkew; connectColor: Color red; yourself. grapher add: ds. grapher axisY minValue: eColiGCSkew min; title: 'Skew'; color: Color black; noDecimal. grapher axisX numberOfTicks: 10; noDecimal; color: Color black; title: 'Position'. grapher open
The skew_diagram_ecoli.png shows how the expected final plot should look like - obviously obtained with another software. What can I do to make it work in Roassal? Any suggestions here?
Cheers,
Hernán
Pretty cool!
Alexandre
On Oct 2, 2018, at 2:21 AM, Hernán Morales Durand hernan.morales@gmail.com wrote:
<a TRMorph(28411392).png><skew_diagram_ecoli.png>
Hi Alex,
Thanks. Please note there are two questions related to Roassal :) I have isolated the script so you don't need to load BioSmalltalk
Maybe someone can check or give a hint?
El mar., 2 oct. 2018 a las 22:31, Alexandre Bergel (alexandre.bergel@me.com) escribió:
Pretty cool!
Alexandre
On Oct 2, 2018, at 2:21 AM, Hernán Morales Durand hernan.morales@gmail.com wrote:
<a TRMorph(28411392).png><skew_diagram_ecoli.png>
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
I am lost. What are the questions? I do not see them in the mailing list.
Alexandre
On Oct 3, 2018, at 11:11 AM, Hernán Morales Durand hernan.morales@gmail.com wrote:
Hi Alex,
Thanks. Please note there are two questions related to Roassal :) I have isolated the script so you don't need to load BioSmalltalk
Maybe someone can check or give a hint?
El mar., 2 oct. 2018 a las 22:31, Alexandre Bergel (alexandre.bergel@me.com) escribió:
Pretty cool!
Alexandre
On Oct 2, 2018, at 2:21 AM, Hernán Morales Durand hernan.morales@gmail.com wrote:
<a TRMorph(28411392).png><skew_diagram_ecoli.png>
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
This is weird, could you check:
http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/2018-October/04...
Hernán
El mié., 3 oct. 2018 a las 22:41, Alexandre Bergel (alexandre.bergel@me.com) escribió:
I am lost. What are the questions? I do not see them in the mailing list.
Alexandre
On Oct 3, 2018, at 11:11 AM, Hernán Morales Durand hernan.morales@gmail.com wrote:
Hi Alex,
Thanks. Please note there are two questions related to Roassal :) I have isolated the script so you don't need to load BioSmalltalk
Maybe someone can check or give a hint?
El mar., 2 oct. 2018 a las 22:31, Alexandre Bergel (alexandre.bergel@me.com) escribió:
Pretty cool!
Alexandre
On Oct 2, 2018, at 2:21 AM, Hernán Morales Durand hernan.morales@gmail.com wrote:
<a TRMorph(28411392).png><skew_diagram_ecoli.png>
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
Hi Hernan,
1) You can see the result in the TR Morph.png attached file. In X axis, how can set up a tick every certain step value? For example, every 50 points. Right now this is 88, 176, 264, 353 and I would like to be 50, 100, 150, 200, 250, 300, 350, 400.
you can use message #shouldUseNiceLabelsForX:, this enables RTGrapher to use RTLabelGenerator, that uses nice labels for these cases.
.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.= | b ds | b := RTGrapher new.
ds := RTData new. ds points: RTShape withAllSubclasses. ds y: #numberOfMethods. b add: ds.
b addDecorator: RTVerticalMinValueDecorator new red. b addDecorator: RTVerticalMaxValueDecorator new blue.
b shouldUseNiceLabelsForX: true. b axisY noLabel. b axisX noDecimal; numberOfTicks: 10; numberOfLabels: 10. b build. ^ b view .=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.= [image: Captura de pantalla 2018-10-08 a la(s) 19.08.10.png] 2) I just plotted a very short toy DNA sequence, however if I would like to plot GC skew for E.coli that would take hundreds of points. The following script takes ages to complete or it never ends. You will find attached the necessary files:
| grapher ds eColiGCSkew zipArchive |
zipArchive := ZipArchive new. [ zipArchive readFrom: 'ecoligcskew.zip' asFileReference; extractAllTo: '.' asFileReference ] ensure: [ zipArchive close ]. eColiGCSkew := FLMaterializer materializeFromFileNamed: 'OrderedCollection_3712516797.obj'. eColiGCSkew := eColiGCSkew copyFrom: 1 to: 20000. grapher := RTGrapher new extent: 800 @ 500; yourself. ds := RTData new points: { 0@ -1000. eColiGCSkew size@ 1000}; y: #y; x: #x; yourself. grapher add: ds.
grapher addDecorator: (RTAreaDecorator new points: eColiGCSkew; color: Color orange trans). grapher shouldUseNiceLabelsForX: true. grapher axisY minValue: eColiGCSkew min; title: 'Skew'; color: Color black; noDecimal. grapher axisX numberOfTicks: 10; noDecimal; color: Color black; title: 'Position'. grapher
[image: Captura de pantalla 2018-10-09 a la(s) 18.26.14.png]
The eColiGCSkew is an array of 4 millon points, this in roassal creates 4 millon instances of RTElement of one ellipse. For this script I have used RTAreaDecorator, that creates a single instance of RTSVGPath, with a lot of commands that Athens can read and creates. But in this case you can:
- create a SVG with all the points, and add it to the grapher. like RTAreaDecorator. - Draw on the same canvas: roassal in TRMorph uses a Surface to draw the elements, I think that you reuse this surface to draw each dot with one roassal shape, in order to get this kind of draw over the time(the time that takes to iterate the 4 millon points) https://www.openprocessing.org/sketch/604265
Cheers, Milton
El jue., 4 oct. 2018 a las 0:49, Hernán Morales Durand (< hernan.morales@gmail.com>) escribió:
This is weird, could you check:
http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/2018-October/04...
Hernán
El mié., 3 oct. 2018 a las 22:41, Alexandre Bergel (alexandre.bergel@me.com) escribió:
I am lost. What are the questions? I do not see them in the mailing list.
Alexandre
On Oct 3, 2018, at 11:11 AM, Hernán Morales Durand <
hernan.morales@gmail.com> wrote:
Hi Alex,
Thanks. Please note there are two questions related to Roassal :) I have isolated the script so you don't need to load BioSmalltalk
Maybe someone can check or give a hint?
El mar., 2 oct. 2018 a las 22:31, Alexandre Bergel (alexandre.bergel@me.com) escribió:
Pretty cool!
Alexandre
On Oct 2, 2018, at 2:21 AM, Hernán Morales Durand <
hernan.morales@gmail.com> wrote:
<a TRMorph(28411392).png><skew_diagram_ecoli.png>
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
Hi Hernán,
Sorry for the late reply.
Regarding your first question, you can do: -=-=-=-=-=-= g := RTGrapher new.
d := RTData new. d connectColor: Color blue. d noDot. d points: (-3.14 to: 3.14 by: 0.1). d y: #sin. d x: #yourself. g add: d.
g axisX numberOfTicks: 10; numberOfLabels: 5. g -=-=-=-=-=-=
As you can see, the line "g axisX numberOfTicks: 10; numberOfLabels: 5.” allows you to set the number of ticks and the number of labels.
Regarding your second question, where can I find the file OrderedCollection_3712516797.obj ? Or, how can I reproduce it. Anyway, I believe the problem is that you have too many points. In this case, I suggest you to reduce the number of points.
For example, a slight variation of the previous example [DO NOT RUN IT]: -=-=-=-=-=-= points := -3.14 to: 3.14 by: 0.000001.
g := RTGrapher new.
d := RTData new. d connectColor: Color blue. d noDot. d points: points. d y: #sin. d x: #yourself. g add: d.
g axisX numberOfTicks: 10; numberOfLabels: 5. g -=-=-=-=-=-=
The script tries to build the same graph but with 6 280 001 points. Which obviously, is way too many.
Instead, you can do something like: -=-=-=-=-=-= points := SortedCollection new. 1000 timesRepeat: [ points add: (-3.14 to: 3.14 by: 0.000001) atRandom ].
g := RTGrapher new.
d := RTData new. d connectColor: Color blue. d noDot. d points: points. d y: #sin. d x: #yourself. g add: d.
g axisX numberOfTicks: 10; numberOfLabels: 5. g -=-=-=-=-=-=
Which only display the graph with 1000 points.
Cheers, Alexandre
On Oct 4, 2018, at 12:49 AM, Hernán Morales Durand hernan.morales@gmail.com wrote:
This is weird, could you check:
http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/2018-October/04...
Hernán
El mié., 3 oct. 2018 a las 22:41, Alexandre Bergel (alexandre.bergel@me.com) escribió:
I am lost. What are the questions? I do not see them in the mailing list.
Alexandre
On Oct 3, 2018, at 11:11 AM, Hernán Morales Durand hernan.morales@gmail.com wrote:
Hi Alex,
Thanks. Please note there are two questions related to Roassal :) I have isolated the script so you don't need to load BioSmalltalk
Maybe someone can check or give a hint?
El mar., 2 oct. 2018 a las 22:31, Alexandre Bergel (alexandre.bergel@me.com) escribió:
Pretty cool!
Alexandre
On Oct 2, 2018, at 2:21 AM, Hernán Morales Durand hernan.morales@gmail.com wrote:
<a TRMorph(28411392).png><skew_diagram_ecoli.png>
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev