 Hello everyone. I'm here today with James Fellows Yates and he's going to talk about inkscape and pipeline diagrams. Thank you very much. So this is a repeat of a, a talk I gave back at the last end of hackathon. And what I'll be talking about is basically how to you can make pretty diagrams aimed at improving your documentation. And this can be making more eye-catching or accessible for making people understand better sort of how to run your pipeline and how to interpret it. And so what I'll do is it give a very, very brief introduction to what you sort of things you can generate with a tool called inkscape. And then I'll give a live demo of how you use inkscape and sort of the main components and functionality that I use to make and the different pipeline map constructions. Which sort of become semi famous, at least on Twitter. And then I'll basically show you how I will construct pipeline diagrams such as this. And the tool that we're talking about today is inkscape, which is an open source, pretty close to professional quality software, which can run on Linux OSX and Windows, which is really nice. It's kind of equivalent to Adobe Illustrator, I think it is. But open source, so it's free and accessible to everybody. And it's a really, really nice and very quite polished tool and I really enjoy it a lot and I've been using it for quite a few years now. The reason why we want to use inkscape is primarily because the difference between raster and vector images. So when you take a photo for example on your phone or the digital camera, the images that you generate are raster images. And really, really closely basically start getting these very pixely squares of different, different cuts. And which is very nice in many ways, but when you're re-dealing with the web, so which are where a lot of bioinformatic documentation is displayed on, and we people like to zoom in and zoom out and stretch things and modify things in this way. And also, like your images look very, very nice, clean and clear. When you're dealing with a particular web documentation, we prefer a format called vector images, and in particular, what we'll be using today is SPG. And so the really nice thing is that basically you can zoom, stretch, manipulate, and you always have these smooth, very high-definition lines. These SPGs are constructed, which are basically based on sort of coordinate system, is that they are very portable, so you can take different components, break it up over a particular image and import it into other images. So here are some examples of sort of vector images or things you can do to sort of improve your documentation in terms of graphic design when it comes to bioinformatic pipelines, like an NFCOR. This, for example, designed a logo. So here's a couple of examples of NFCOR, so Sarek and EGAR, is another one I made for a different project. Logos are very good way of making your pipelines look a bit more professional and sort of more eye-catching in that way, and people are more likely going to trust sort of the quality of the pipeline, sort of when it has a brand identity, which is a nice little productive procrastination if you ever need that. And you can also make workflow diagrams. This is one from EGAR again. This is more a general broad overview, which helps to people sort of understand what are the major components of the pipeline and what it does. It doesn't go into too much detail. Here's the deceptions and the tools it uses. And if you want something more detailed, you can make something like this, which much more shows the direct connections between the different components and different tools of the pipeline. And so these sort of give you two different purposes. One, this is more for like setting the pipeline. This is what it does to depict someone's interest, for example, putting in like a publication. Whereas this is more for the user who's actually going to be interacting with the pipeline and trying to run it. So there are different stages and levels of these such pipeline diagrams you can use to help make your pipeline more accessible from the concept of like what does it do. And this format is the one that became quite popular recently, but I've been playing out other variants. So this is a new one that I'm coming up with for a tax profiler. So you can don't have to stick with the particular one that I showed in the previous slide. You can play around with this as well. But all of these diagrams, all these images are done in Inkscape. In addition, he doesn't have to just be diagrams to show what you can do in your documentation. Another thing that we did with Eager, which was also quite popular and I was quite proud of is that my co-author, Zandra, drew these very nice sort of schematic slash cartoony diagrams for the output documentation, which helps people to understand better and what they should be looking for when they're doing like quality control in their pipeline runs. So for example, she took what you see get from multi QC. So for example, fast QC in this case, the first QC section, and drew little cartoony versions of what you should be seeing and separated by the three different boxes. But with little notes saying exactly what you are seeing in this and what how you should basically interpret your results here, which acts a very nice quick sort of fast reference for people to understand what your pipeline is done, the other end. And also it adds a little bit of fun, a little bit of color to otherwise often very dry documentation, which can be often be very dull and particularly for very big pipelines like Eager and Cerec. When you have a lot of output documentation such things can break things up a little bit easier and make it more again more accessible and more fun for user to use. And there's other things you can do inkscape. So for example, and this is a couple of other things I've done. This was a sort of a schematic overview of how to interpret ancient deep or sort of some characteristics of ancient DNA, again done all in inkscape. And actually all of these little emojis they've been bought from another project with open moji. Everything's SVG and it's very easy to drag and drop it into the my into this particular my image, recolor things, change the size and so on. So it's really, really nice and that's all benefits from this vector imaging format. And also you can do more realistic drawings by tracing and again doing this in inkscape. And it's not so cartoony is all the other previous objects. So this is a tooth cut in half and showing how to sample engine DNA. And then you can basically loaded the rest image into inkscape trace over the top, and basically then fill in the colors and you can get a particularly good representation of the object, which again is then very manipulative after. So that sort of things you can do inkscape. And now what I'd like to do is actually go into inkscape itself and show you some of the basic functionalities that you would need to do to make one of the pipeline diagrams such as this one. So when you open inkscape, it should look something like this. And the out the UIs should be relatively familiar you've got toolbar right at the top, you've got other tools on the sides as well. And, and it may look a little bit different depending on what sort of operating system you are you're working on but generally this is the sort of the outline you have at least in the latest version. And also note, we should hopefully see on my screen is a sort of a key logo so you should be able to see what I'm typing. So in the case I use like a shortcut you can also see that to keep an eye on that as well. So the most basic thing you can do in inkscape or with a vector image program is making objects and and shapes. So I'm going to write make here an object which is a circle. I can make squares, you can make triangles and convert to stars and things like hexagons or whatever. And you can also resize these as you can see that when I click on an object, it often will have either arrows like this, which you can resize like so. And also sometimes if you click on this path editor which I explained in a second, you can also edit with these squares and triangles here. And you don't have to make sort of fixed shapes like that you must do lines with a bezier tool here. So if I click here and click here, I make a line there. And with this bezier tool, you're generating essentially things called paths. And so these objects are sort of fancy parts, but you can also create your own random shapes you would like to make for example like this. So if you're not fixed to having sharp corners or sharp edges, you can also bend edges, for example. And also you can modify the actual corners with the button with the options up here to make them curved as well. And so often this path system is how you do like a tracing map as I explained the previous slide. And you can also you can also modify these as well. You can sort of break them apart to the nodes, for example, right button. Like so and then join them together again. And there's many, many different ways you can manipulate these. So another thing you can do is to group objects together so you have these two objects and let's say you want to basically you're happy with the way they are positioned now and you want to keep this relationship. You can manipulate just the image. So we can click both. So holding shift and click on the second one, you can press control G for example to move together and you can see now I'm moving both the same time but they're not using the position. And furthermore, the objects have a sort of order so they're sort of overlapping each other. So these you can actually modify the, the, that's probably by a color pairing, sorry one second, try this. And so what you can see here that actually sort of the two rings overlapping each other and by pressing page up and page down I'm moving, which is playing on top. You can also move the button to here as well which does the same thing. And also move to the very top of the stack so you can have as many objects as you want. For example, and I can send this is pink one right to the bottom as well, like this. And then another thing you can do because everything's based on a coordinate system is sort of semi programmatically reorder everything and aligning and distributing them based on some rule or something like this. So let's say I select all of these objects and I want to put them all in a single line. If I go to object, and then align distribute should open a panel on the right hand side here, your various options on how to arrange and distribute your different objects. I'm all in a horizontal line. I can press this button here, so central horizontal axis, and they're all going to align here. The same thing also goes for a vertical distribution. Another thing is that maybe you want to have everything somewhat equally spaced out you can see these are closer than these ones and so on. And you can do this with these buttons to hit here on distribute. And then I can blame like that and you can see now that basically everything is pretty much older than exactly the same way. These objects you can also scale and transform so scaling for example like I said before you can drag like with the arrows here, but you can also go to the transform under the object menu here. And you can scale up programmatically again. So I want to be twice the size. I use these twice the size now. And if I get to square, you can also rotate things as well. So let's say, what if I could be angled and get to sort of diamond. And you can also do text and all the text in the is also a vector based. So you can re reorder it detach them separate them out and so on. So again clicking this text tool here and start writing something. I will say that the latest version of in scapes I think I've actually actually installed the beta version is a bit slow with the, with the text for some reason I'm not entirely sure why. So it might be a bit slower here but you get the idea, you can make it bigger like this. And you can also color in the same way as sort of the objects as well. So another nice thing and important thing for the pipeline diagrams is you often want to be able to, as well as align and distribute things as you were doing here is sort of bind them together in a consistent the objects together in a consistent manner. So, if you press the hash key on your keyboard you can get a grid and also in the settings under document properties you can change the size of the grid and the style. And with this it makes it easier for you to position things correctly. And also when you have a grid on you can turn on a snapping tool that you can see up up here, which can also turn on with the percent key. With this you can have different types of edge snapping so what I mean by that is, let's say I have turned on the midpoint snapping. You can see now this little square coming popping up, and it's basically moving your object or the middle of the object in this case to the closest point on the grid here. So this goes for the top corner here. You have to get a feeling for exactly where to hold the object but basically it'll snap it so this way I can make sure, for example, manually. I can see on the grid I want to have everything along this line here and I'll basically use the snapping to basically hold that accordingly. And with coloring. So you can see here in these objects currently I have only cut the outline of the object this is called a stroke. You can also fill in as well. For example, if I click. Oh, sorry. If I go to file, then fill in stroke. Here's another menu here, and you can set the colors or not. Why is that because there we go. The transparency all objects can be transparent as well. You can see that basically. This is the outer line is stroke. And inside the object you can have to fill and these can be independently set which is very nice. And this applies to any object you want, you can change the colors based on hex colors if you want or RGB wheels, you can also set different stroke styles so the moment. And more obvious easy as a solid line, you also change the thickness of the of the outline, and you can also change the style in terms of dashes. Let's move that example. And like so. So there's a lot of flexibility in this in this moment as well. And so for example if you wanted to go with a web based in color. And like I said you can use these hex in this hex codes done the bottom so as an example. If I were to go to the nf core graphics guidelines page is under the documentation and contributing. You can see for example here under fonts and colors, we have the official RGB values and also the hex value for this particular the NF core green. So if you have a switch back here, I can change the stroke of this object to green as so, again, or the film in this case sorry. And turning off transparency and now this is the NF core green. And sometimes in some cases you may not want an SVG is the final image you want to have in a different format. That is also possible to do so if you go to file and export. For example, as a PNG image, you can just change it at different resolutions, depending on sort of what you're going to be printing a web and things like that as well. And this means that you also have that flexibility for a different formats. And how we're doing for time. Okay. Now we can move on to the question which is how would you actually create the pipeline diagrams. Now you could create all the different components yourself separately. But that, speaking from experience. The first time I did this that can take a little time. So what we made for the NF core and website on the game the graphics design guidelines is actually a cheat sheet with all the different components you can use to make a pretty even even even the space and distributed pipeline diagram. You also have other components here you can download for example example of other pipelines if you want to modify these take the license or licenses over here. There's different components for example for Sarek and Maxime a very nice file icons which you can also download and using your own pipeline diagrams. But for this example I'll just use the ones for the pipeline and components which I made before. So let me save this as a file and then drag this particular fine to my escape here. Okay. And you can see here now I've got all of the objects there. So like I emphasize before, nice thing about SVG images because of business coordinate systems, and they can be rendered in many different ways and also downloading and importing this file into my document means I can add the different components of this and reuse them. So for example, I could take, let's say my starting point and drag this over here. If I follow the grid I will snap it with a midpoint snap here. Then I could take the straight line here and drag this over here and stick it on there. And then I could put another station and put that here. But let's say now I want to do a split. So I want to have basically two different lines because I say optional pipelines or mutually exclusive optional steps the pipeline. I can copy and paste this over here. And then by pressing H or V I can also flip and rotate the objects in that manner. I can snap with the midpoint here and the same thing here. There we go the point. And an important thing to to emphasize as you may have already noticed I'm just copying and pasting and like, I'd say 80% of my inkscape work is basically copying and pasting components over already made. And that is why we made this cheat sheet. So I'd highly recommend to basically be using this as well but of course you can modify them in whatever way you want. But to get a basic outline I'd recommend trying something like this. And so modifying this I don't like the screen color and I prefer to group this I want a different color I can say changes to red. And up here I would like this to have a purple and this one to be a blue or blue. And basically just keep working on this and construct things. And in this sort of very Lego like fashion is my sort of main and a recommendation in this case. I can then also basically had a station name, let's say input. This down here. So step one, you want to change the font of your of your texts. So for example if you want to use the NF core font we have the things called Maven pro exactly you can set this here as well. And the final thing is maybe once you've completed your your image you want to not have this weird a for sort of sized page. You can also actually go to file looking properties and modify the sort of layout in this way so for example setting is horizontal, sorry, landscape, and also you resize the page to content for this button here. You can see that basically the page has been resized to cover all the different drawings that you may have in the particular document. And this is pretty much it. And the one other thing I would recommend doing before actually starting such a diagram is already have a working sort of doodle or diagram of your of your pipeline. Sometimes this can get a bit fiddly when you're trying to work out exactly where everything should be spaced. So for example for NF core tax profiler, we used Google drawings and to basically sketch out already all of the different parts of the pipeline. It's a bit easier to move things around here by snapping them together. And then you can use this basically as a reference to how to make your actual final work for documentation. For example, we could take the example at the top. If I can. Yeah, I said is the input of the two splits here then I'd sort of set it up like this and basically follow along the guidelines I do that here. So that is pretty much it that is the basics of what you need to learn and sort of recap you have all these objects you can make. But generally when you come into the pipeline diagrams is better to try and reuse components already made copying pasting is your friend. You can color things by the menu and objects and fill in stroke and you have the Phil, which is the sort of the outline of the object and the stroke of the outline the object and the fill is the inside of the object. You can stretch manipulate all of the objects either sort of manually by these handles or also programmatically with the transform and line and distribute objects. And so otherwise, also have fun doing it again is productive procrastination it does make a influence a lot of people and call it I for example on the ego pipeline, and because of such workflow diagrams. And we have a graphics design channel on Slack, which also is graphics, which you can join as well if you have any questions. But otherwise, I think that is it. So thank you very much questions. Thank you very much. So, are there any questions in the audience. I have also allowed yourself to allow to unmute yourself now. If anyone wants to say something. Otherwise. Thank you very much James and I want to also thank the John Zuckerberg initiative for funding these talks. And as usual, you can continue the discussion on bite size select channel bite size. Yes. Thank you again.