Camelia, the Perl 6 bug

IRC log for #bioperl, 2011-06-10

| Channels | #bioperl index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:34 Jason_ni joined #bioperl
00:38 dukeleto left #bioperl
00:39 dukeleto joined #bioperl
02:28 sheenams left #bioperl
05:09 zenman_ joined #bioperl
05:23 zenman_ left #bioperl
07:29 ank left #bioperl
07:30 ank joined #bioperl
09:24 Jason_ni left #bioperl
13:21 zenman_ joined #bioperl
13:43 Timmy_ joined #bioperl
13:45 zenman_ left #bioperl
13:51 Timmy_ hello, ive been reading the Graphics HOWTO a bit, and Im wondering if it would be possible to create pictures of an ace file  assembly.
13:52 Timmy_ ive got a script liek this
13:52 Timmy_ https://gist.github.com/1018851
13:52 Timmy_ and i would to create apicture resembling this: http://imageshack.us/photo​/my-images/641/fig1a.jpg/
13:52 Timmy_ like
14:54 Timmy_ hmm never mind, i got a working code, but it only creates a png of the final contig and not all of them, would it be possible to make pngs of all the contigs?
14:54 Timmy_ http://paste.scsys.co.uk/111967
14:54 Timmy_ http://paste.scsys.co.uk/111967
14:54 Timmy_ and the created png: http://imageshack.us/photo​/my-images/16/contigs.png/
15:15 rbuels Timmy_: you want a single image that shows the read alignments of all the contigs in the ace file?
15:15 rbuels (is must be a bacteria or virus then, heh)
15:16 Timmy_ one second
15:17 Timmy_ ok i changed the script a bit
15:17 Timmy_ and now it almost does wut i want it to wit just a minor exceptions
15:17 Timmy_ http://paste.scsys.co.uk/111969
15:18 Timmy_ and the created png file: http://imageshack.us/photo/​my-images/827/contigs.png/
15:18 rbuels Timmy_: you'll want to set the width of the panel to the sum of the widths of the contigs
15:18 Timmy_ yes exactly!
15:18 Timmy_ was about to say that
15:18 Timmy_ and also
15:18 rbuels Timmy_: you'll probably have to iterate over the ace file twice
15:18 Timmy_ add the contignames above the scales
15:19 rbuels Timmy_: as for adding the contignames, you can probably do that with raw GD drawing calls
15:19 rbuels Timmy_: if you can get to the GD image inside the panel
15:19 * rbuels looks up how to do that
15:19 Timmy_ k cool
15:19 Timmy_ and about the scale, i just want the scale to represent the lenght of each ocntig
15:19 rbuels Timmy_: yeah, it's got a gd() method that returns the GD::Image it made
15:19 Timmy_ for example one contig is 900b and another is 1200
15:20 Timmy_ no idea wut u mean with GD
15:20 Timmy_ links to info or sumting about that?
15:20 rbuels Timmy_: perldoc GD, perldoc GD::Image
15:21 rbuels Timmy_: that's the drawing library that is used to make the image
15:21 rbuels Timmy_: Bio::Graphics::Panel is basically a smart bio-wrapper around GD
15:22 rbuels (ah, i guess the GD::Image perldoc isn't useful.  perldoc GD is what you want)
15:23 Timmy_ hmm not much help there either lol
15:24 Timmy_ oh wait
15:24 Timmy_ i think i found it
15:27 Timmy_ or maybe not :(
15:30 rbuels Timmy_: instead of just calling ->png on the panel at the end, you'll want to get the gd image with ->gd, then draw your labels on it with GD calls, and *then* call png on it
15:33 rbuels you'll probably end up having to transform the coordinates of the reads also
15:34 Timmy_ hmm ive got someting like this now : http://imageshack.us/photo/​my-images/199/contigs.png/
15:34 rbuels the panel object really isn't made with doing this in mind
15:34 Timmy_ with: http://pastebin.com/qE426FwQ
15:34 Timmy_ dunno why that last contig scale is diffrent
15:34 rbuels omg imageshack is nuts
15:34 rbuels never seen so many damn ads
15:35 rbuels lol
15:36 rbuels hmm
15:36 Timmy_ im following the tutorial at example 4
15:36 Timmy_ on the Graphics HOWTO
15:36 Timmy_ that picture has a name above the scale
15:37 Timmy_ so it is possible to do it
15:37 Timmy_ figure 4
15:38 * rbuels looks
15:40 rbuels Timmy_: it's the -label => 1 option to the track
15:41 rbuels Timmy_: where the $full_length feature has a display_name
15:41 Timmy_ ah ur rite
15:41 Timmy_ its not
15:41 Timmy_ sec
15:41 rbuels Timmy_: the label is the display_name of the full_length feature
15:41 rbuels Timmy_: yeah, i thought you were wanting to lay all the contigs out horizontally
15:42 rbuels Timmy_: but it's a lot easier if you do them vertically as separate tracks
15:42 rbuels (like this)
15:42 Timmy_ sweet it worked
15:42 Timmy_ http://imageshack.us/photo​/my-images/52/contigs.png/
15:43 Timmy_ now all that remains is adjusting the scales according to contig length
15:44 rbuels you mean stretch each of them out to fill the fill width?
15:44 rbuels (do you really want to do that?)
15:44 Timmy_ no i mean
15:45 Timmy_ the way it is now
15:45 Timmy_ all the contigs are 1k long
15:45 Timmy_ but thats not true, cuz all the contigs have diffrent sizes
15:45 rbuels the last one isn't
15:45 Timmy_ ye
15:45 Timmy_ taht one is strange tho
15:46 Timmy_ i wonder how i can get the $length, wiouth puttin ght panel in the foreach loop
15:46 Timmy_ http://pastebin.com/h916w1Wh
15:46 rbuels Timmy_: oh, probably the longer ones are getting truncates
15:46 rbuels er, truncated
15:47 Timmy_ yes
15:47 rbuels Timmy_: cause the panel width is set to 1000
15:47 Timmy_ cuz its only 800pixels big
15:47 Timmy_ ye
15:47 rbuels Timmy_: er, panel length i mean
15:47 * pyrimidine thinks Timmy_ is a very brave person, using Bio::Assembly::IO, let alone with Bio::Graphics :P
15:47 Timmy_ lols
15:47 Timmy_ why?
15:48 rbuels Timmy_: you need to set the -length of the panel to the lengh of the longest contig
15:48 pyrimidine Oh, just that Bio:::Assembly is a bit of a mess
15:48 rbuels pyrimidine: ssshhhh it's working
15:48 Timmy_ but great examples tho
15:48 rbuels pyrimidine: shut *up*
15:48 Timmy_ ye
15:48 pyrimidine heh
15:48 Timmy_ working so far
15:48 Timmy_ :D
15:48 pyrimidine at least it's working
15:48 pyrimidine so there is hope
15:49 Timmy_ rbuels: ye but that would require to manually add the length of the longest contig
15:50 Timmy_ cant i do that dynamicly with a variable/
15:50 rbuels Timmy_: i don't know if you can set it at the end
15:50 * rbuels kind of doubts it
15:50 * Timmy_ test
15:51 Timmy_ ah so thats hwo taht works
15:51 Timmy_ :D
15:53 Timmy_ there, that looks a lot better: http://imageshack.us/photo​/my-images/28/contigs.png/
15:55 rbuels Timmy_: so you *can* set the panel length at the end?
15:55 Timmy_ no i just changed the panel length manually from 1000 to 1500
15:55 rbuels oh.  well i guess you could do that too
15:55 rbuels cheater.
15:55 Timmy_ :D
15:56 Timmy_ well
15:56 Timmy_ since there is no other way
15:56 rbuels Timmy_: sure there is, you can iterate through the file twice
15:56 rbuels Timmy_: once to find the max contig length, once to draw the contigs
15:56 Timmy_ ehm
15:57 rbuels it's not like this is a big file.  if you're drawing it in a single png, lol
15:57 Timmy_ well lol
15:57 Timmy_ actually it is, i just truncated it for testing purposees
15:57 * rbuels could *NOT* do that with his .ace files
15:57 Timmy_ the actual number of total contigs is around 100
15:57 rbuels hah, if you have big files, the pngs you are going to get from the full ones are going to be ridiculous
15:58 Timmy_ which full ones?
15:58 rbuels Timmy_: the full-size ace files
15:58 rbuels Timmy_: that's going to be one big png
15:58 Timmy_ ye
15:59 rbuels eh, i dunno
15:59 rbuels it might be ok
15:59 Timmy_ well the idea is to for example to create a png for each contig
15:59 Timmy_ and then add that png to a website
15:59 Timmy_ according to which contig was selected
16:00 rbuels that would work
16:00 Timmy_ same thing for a blast output
16:00 Timmy_ ill just display the blast ouput as a table on a site
16:00 Timmy_ with id, evalue, score etc
16:00 Timmy_ and then the user can click on hit
16:01 Timmy_ and then it would dis play a png of that hiot
16:01 Timmy_ wit its hsps and stuff
16:02 Timmy_ btw
16:02 Timmy_ this is the code: can u show where to put the loop to get the max contig lenght: http://pastebin.com/h916w1Wh
16:03 Timmy_ i guess a foreach loop at line 11?
16:04 rbuels Timmy_: you'll need to create a different Bio::Assembly::IO object
16:05 rbuels Timmy_: just write a subroutine that does it
16:05 rbuels sub max_contig_length {  my ( $ace_filename ) = @_;  .... }
16:05 rbuels and in that sub, go through the file
16:05 rbuels with another invocation of BIo::Assembly::IO
16:06 rbuels anyway, i've gotta get going
16:06 Timmy_ and also creating a new panel and stuff?
16:08 Timmy_ well, thnx for ur help tho, uve been most helpful :D
16:10 rbuels Timmy_: no, just iterating through the ace file and looking at the lengths of the contigs
16:10 rbuels Timmy_: not doing a whole panel thing
16:14 Timmy_ hmm, im sorry for being noobish, but without any code to look at its kinda vague to exactly know wut u mean, im alrdy getting the contig length at line 20
16:15 Timmy_ i just need to add that $length to line 12: my $panel = Bio::Graphics::Panel->new( -length    => $length,
16:15 Timmy_ for it to work i think
16:17 Timmy_ see figure 4 of the HOWTO: my $panel = Bio::Graphics::Panel->new( -length    => $result->query_length,
16:17 Timmy_ tahts what im tryin to do too
16:17 perl_splut might want to be careful about just blindly using the length of the contig as the width of the image
16:18 Timmy_ hmm howcome?
16:19 perl_splut there is a limit before the image becomes too big in pixels for a lot of programs to properly render
16:19 Timmy_ ah
16:19 Timmy_ well the contigs im working with
16:19 Timmy_ are not that long
16:19 Timmy_ they are made up of sequences of 75b
16:22 perl_splut I've used Bio::Graphics to do entire Genomes before
16:22 perl_splut learned my lesson from that, heheh
16:23 Timmy_ :D
16:23 perl_splut one image per chromosome. Required a poster printer and several sections to print each one out
16:23 perl_splut They used to have them hanging up in the lab for people to study
16:23 Timmy_ how big was the png file :D
16:24 * pyrimidine is kinda wondering why Gbrowse isn't being mentioned here....
16:24 perl_splut don't remember, but the posters were about 5' x 6'
16:25 Timmy_ meters?
16:25 perl_splut no
16:25 perl_splut 5' x 6'
16:25 perl_splut not 5m x 6m
16:25 Timmy_ and wut does a ' mean?
16:25 pyrimidine feet
16:25 Timmy_ oh lol
16:25 Timmy_ im eruopean dont think in feet
16:26 pyrimidine Timmy_: this is to be something hosted on a website?
16:26 perl_splut I've never used Gbrowse
16:26 Timmy_ yes
16:26 Timmy_ the idea is to create a table of blast output
16:27 pyrimidine I think this is a good use case for GBrowser
16:27 pyrimidine *GBrowse # fat fingers
16:27 Timmy_ not familiar wit that
16:27 pyrimidine Timmy_: http://gmod.org/wiki/GBrowse
16:30 Timmy_ looks interesting but a bit overkill for my project lol
16:30 pyrimidine ok
16:31 pyrimidine I'm just thinking down the road a bit (when other features have to be added to those images)
16:31 pyrimidine gene models, analyses, etc etc
16:31 pyrimidine it's a very common issue
16:31 perl_splut not here
16:32 perl_splut wet bench is far more of our work than bioinformatics
16:32 pyrimidine right, I guess it depends, then
16:32 Timmy_ im a bioinformatics student :D, wuts wet bench?
16:33 pyrimidine lab work
16:33 perl_splut actual lab work
16:33 Timmy_ ah
16:33 Timmy_ i had a lot of lab work the first year
16:33 pyrimidine I'm from the wet bench side, now purely computational
16:33 Timmy_ after that just progamming and datming shit
16:35 Timmy_ oh btw, is it possible to create a pcture witout saving it to png
16:36 Timmy_ pipe it directly to the webbrowser
16:36 Timmy_ with cgi or someting like that
16:36 Timmy_ cuz now i use script.pl > pic.png
16:36 Timmy_ to create those pics
16:36 perl_splut it wouldn't be a picture if you didn't convert it to something like a png
16:36 perl_splut you could output it as SVG
16:36 Timmy_ ah
16:37 Timmy_ svg is line xml
16:37 Timmy_ like
16:37 Timmy_ rite?
16:37 pyrimidine generate the HTML and embed the pic
16:37 perl_splut and therefore scalable to any zoom level
16:37 pyrimidine SVG is a very good option
16:39 Timmy_ hmm
16:39 Timmy_ examples?
16:39 pyrimidine Ah, GBrowse would generate the SVG for you, but alas...
16:40 pyrimidine http://www.w3schools.com/html/html_images.asp
16:40 perl_splut http://www.bioperl.org/wiki/Simp​le_graphical_alignment_overview
16:42 Timmy_ oh that looks nice
16:42 Timmy_ bookmarked
16:43 perl_splut http://www.bioperl.org/wiki/HOWTO:Graphics
16:44 pyrimidine heh, I wrote up that alignment code :)
16:45 perl_splut glad it is getting some use
16:45 Timmy_ ;d bioperl is cool, but i still cant get used to the object-oriented part lol, if it werent for those excellent examples and tutorials on the bioperl site i would be so lost lol
16:46 perl_splut object-oriented is easy... multi-threaded is hard
16:47 Timmy_ ye i get that a lot even at school lol
16:47 Timmy_ OO is the way to go and all that
16:47 perl_splut not always
16:47 Timmy_ but to me it just dun feel rite somehow
16:47 Timmy_ :D
16:47 perl_splut Java went totally OO and it makes doing certain, simple operations a pain
16:47 Timmy_ meh dont get me started on java lol
16:48 Timmy_ i had that in the first year
16:48 Timmy_ so much headaches then
16:48 Timmy_ :D
16:48 Timmy_ such a pain the butt
16:50 Timmy_ everyone in this channel is a bioperl dev?
16:50 perl_splut nope
16:50 pyrimidine lots of people quitting Java these days... # Oracle
16:50 pyrimidine Imabioperldev
16:51 pyrimidine rbuels as well
16:51 Timmy_ were u the one that said the Assembly modules were a mess?
16:51 perl_splut didn't Sun free Java before Oracle bought them?
16:51 pyrimidine sort of
16:51 Timmy_ new release coming anytime soon?
16:52 pyrimidine of bioperl?
16:52 Timmy_ or some major changes happening
16:52 Timmy_ ye
16:52 pyrimidine yee gads, pushed one out on May 18th
16:52 pyrimidine http://search.cpan.org/~cjfields/BioPerl-1.6.901/
16:53 pyrimidine and, yes, major changes happening
16:53 perl_splut that's not good enough... :)
16:53 Timmy_ :D
16:53 Timmy_ tahts the current version rite?
16:53 perl_splut must push out a major release every month... :)
16:53 perl_splut heheh
16:53 pyrimidine not a month (yet)
16:53 Timmy_ we need more tutorials and examples on the site
16:53 Timmy_ for total to semi-total naps like myself :D
16:53 perl_splut there's tons of them
16:54 pyrimidine docs are the hardest thing to write up
16:54 perl_splut http://www.bioperl.org/wiki/HOWTOs
16:54 pyrimidine ask any dev
16:54 Timmy_ ye i guess
16:54 perl_splut docs suck because end users come from all levels of capability
16:54 perl_splut can't assume any level of knowledge :(
16:55 perl_splut worse, most won't read the docs
16:55 perl_splut and then bitch that things don't work
16:55 pyrimidine perl_splut: that, and we currently don't have in-line testing for the example code, so it's hard to maintain
16:56 perl_splut tests are another hard thing for a dev to create
16:57 perl_splut especially for edge cases
16:58 Timmy_ oh btw, parsing blast output shgould always be done from a blast xml file rite?
16:58 perl_splut not necessarily
16:58 Timmy_ cuz i tried getting the $result->query_length from a -m 8 formatted blast out
16:58 Timmy_ and that dint work so well
16:59 Timmy_ it says on the searchio that its faster to parse from a xml
17:00 perl_splut faster doesn't mean it is the only way
17:00 Timmy_ true
17:00 pyrimidine Timmy_: that should work, but the parser format should be 'blasttable', not 'blast'
17:00 pyrimidine XML is 'blastxml'
17:01 Timmy_ ye i know, i tried that too but the result-query_length was 0
17:01 Timmy_ and when i changed to blastxml format
17:01 Timmy_ it displayed the proper query length
17:01 pyrimidine completely off-topic but awesome: http://ti.me/iD2sfo
17:02 pyrimidine well, XML is the most stable, long-term
17:02 pyrimidine but NCBI still manages to break even that every few years or so
17:02 perl_splut unintentionally
17:03 pyrimidine possibly
17:03 pyrimidine one instance was intentional but needed
17:03 perl_splut unintentional as in they aren't specifically trying to break BioPerl when making changes
17:04 pyrimidine right
17:04 perl_splut unlike say Blizzard or Sony changing the encryption on their network protocol to stop traffic sniffers from getting at the data
17:05 pyrimidine the funny thing is, NCBI themselves have long stated they reserve the right to change any output at any time (adding the caveat that XML would always be the most stable)
17:05 perl_splut they kind of have to to deal with new ideas for how to better output display
17:06 perl_splut I think more people look at the raw output rather than through something like BioPerl
17:06 perl_splut at least they do here
17:07 perl_splut human mind is less sensitive to extra tabs or newline characters when trying to understand data
17:07 pyrimidine bioperl (as with any of the toolkits) is just a means to distill/summarize loads of information down to something meaningful (say, 100K BLAST runs)
17:08 perl_splut yep, but more people do just a few blast runs than those that do 100k
17:09 pyrimidine right, so in those cases it's probably overkill (though it is nice if there is already a pipeline set up to run everything through)
17:09 pyrimidine just depends on one's needs
17:10 perl_splut true
17:45 Timmy_ left #bioperl
18:15 dnewkirk left #bioperl

| Channels | #bioperl index | Today | | Search | Google Search | Plain-Text | summary