 Salut, Maxime ici, une fois plus tard. Je voudrais remercier la initiative de la chaîne The Coback pour nous aider à faire des talks de bite-size. Aujourd'hui, Fillyoules de Sekerra nous expliqueraient comment contribuer au next row. J'ai vu ça avant et c'est assez amusant et impressionnant. Comme toujours, vous pourrez vous amusez-vous à la fin de la discussion pour avoir votre question. Mais pour savoir si vous avez des questions, n'hésitez pas à les parler en chat. D'ailleurs, vous pouvez les demander en slag et vous pourrez l'entraîner plus tard. Alors, à vous Fillyoules, n'oubliez pas de partager votre écran. Oui, merci. Merci Maxime et bienvenue à tous. Merci d'avoir regardé ce jour-là. J'étais en train de parler d'une récorde pour un peu plus de temps pour un talk de bite-size. Je pense qu'on était en train de parler avant. Est-ce qu'il y a quelque chose pour aujourd'hui? Je suis venu avec une idée pendant une rencontre. J'ai fait un lunch et j'ai eu environ 5 minutes à préparer. Et là, on est là. C'est une aventure pour nous tous. Mais c'est un peu un topic fun, je pense. Si quelqu'un ne me connaît pas, je suis Fill. Je travaille sur Sekerra, comme Maxime dit, et j'ai été en train de parler pour beaucoup de temps. J'ai aidé à trouver le start. Et j'aime bien faire ces petits demos de vie avec vous. Le topic d'aujourd'hui est de nexflow, c'est quelque chose qu'on parle d'un peu surprenant. On a beaucoup de temps à créer des pipelines NFCORE, avec nexflow, comme un langage programme, ou à construire des infrastructures autour des projets, comme CICD, ou des websites, etc. Mais il y a relativement quelques gens qui ne travaillent pas avec nexflow, et c'est ce que je veux parler d'un peu aujourd'hui. L'idée pour ça, c'est qu'il y a un récit de nexflow, que je n'ai pas pu faire. Je pense que c'est probablement l'un des deux ou trois nexflow, que je n'ai pas fait dans les dernières 8 ans. Ce n'est pas très bien, et c'est un expérience. J'ai pensé que je vais vous en parler, et on va voir si nous pouvons aller ensemble. Il va être de haut niveau. Le nexflow, en itself, est en groovy, et je n'ai pas l'expérience avec groovy à tout. C'est un aspect de la vue des beginners pour contribuer au projet, si vous voulez. Donc, je vais partager mon écran. Je ne sais pas si je peux le mettre dans l'écran. Comment est-ce que c'est ? Je suis très petit. C'est-à-dire grouillard ? Je vais juste le faire normalement. Right. So, Many of you will have seen stuff I've written before. By the way, shout if the text is too small or anything. But one of the things I really like to do is I like to make things kind of pretty. I did much of the work in the early days with the NFCore Tools package. And that's got nice colours. And when you do NFCore download, it uses a... It has like a progress bar showing you and stuff like this. And many of the tools I've done, I've kind of try and put some effort into making the... Making it visually attractive and accessible and that includes on the terminal where things have traditionally had pretty rubbish kind of display. Now, almost a running joke at this point is how much I like a library called Rich. Which is biochapp called Wilma Guggen, who's now spun this out into a company called Textualize. But really, the start of all that was this Python library called Rich. And it's a library you can use to put into your applications to easily do nice styling in the terminal. So you can just say, I want to do some red text or whatever, bold magenta, and it will just work. And you don't really need to think about it very much. On the back end, what the library is doing is it's doing something called... Creating what's called ANSI codes, ANSI, which are kind of control codes, which are sent to the terminal, which don't print anything onto a terminal, but they tell the terminal, okay, now use this foreground color or this background color or change the text in this way or that way. ANSI code is almost like a mini language of its own. And it's a complete pain to write manually. You never want to do that. So libraries such as Rich just give you a nicer syntax to be able to apply these ANSI codes onto what's being printed to the terminal. Okay, so I've done quite a lot with Rich over the years. I've built a couple of libraries on top of Rich and other things. And that's fine. But the problem is once you start making all these applications look nice in the terminal, you start to notice the ones which are not very pretty and colorful. And so a while ago, I've been talking about it for a long time, but I put an issue onto the next flow repo back in May, saying it would be nicer if we could have some color on the next flow logs that we all spend so much time looking at. And I mocked something up basically. And because I'm used to Python and I'm used to Rich library and everything, I did little Python scripts. But I just copied and output static string from an extra run and just colored it manually to see how it would look in the terminal. No, this was on the floor. And so I came up with this and was like, we should do this. And that was very nice. But Paolo was like, yeah, I'm not sure we're going to be able to do this very easily because next flow is built in Groovy, which is built on top of Java. And there isn't any other libraries like Rich where you can just sort of do this easily. Of course, that's like a red rag triple. So I couldn't let this sit there and just nothing happened. So eventually I sort of started playing with a bit more and Paolo said, you know, if you want to do it, you do it. So I have no choice. There was no one who was going to do it for me. I tried my hardest. So what did I do? I cloned the next flow repo. I forked it and cloned it just as you would with anything else. Hit fork and then hit, you know, clone, get a repo clone. And I loaded it up. And the next flow repo is massive. There is, I don't know how many hundreds or thousands of files in here. So what I did was I ran a next flow. Next, I'm going to make a sub directory called testing, just empty directory. And I'm going to do next flow run hello. If you've never done this before, this is running a pipeline which is on GitHub called next flow hello. And it just does something very simple. And this is the output I was getting which is black and white. And I can, okay, this must be written somewhere in the code. So I'm just going to search for it on a global search on the project level. You can see it comes up in a docs a bunch. So let's exclude any markdown files. There's a log file in the snippets. And then there's two files which come up with it and this looks kind of promising. Log.info next flow. Okay, so even though I really have nothing, no idea at all about Groovy code or next flow project or anything, quite quickly I can sort of find my way to resource code here. This looks sensible. I can kind of understand what's going on here. Right, so if I change something then to just see if I can edit it. Bill was here. And run it again. But it didn't work. So nothing happens. The output was exactly the same even though the source code was changed. Now, across the reason for this is that next flow I have installed and it's sat on my path as a binary file and everything. So even though I've cloned the repository, the source code is not what I'm actually running when I run next flow. So the first question then is how do I run the source code? I think that there is now some documentation about this on the next play websites under contributing at the bottom which is a fairly new part of the documentation. This used to be kept in a few readme files on the repo which no one had ever found. And Ben German at Sakira rechatté about it and he moved this now actually some documentation about how next flow is built and how to contribute to it. But the short version is that if you look in the top level of next flow projects, there's a special file which is a bash file called launch.sh. You don't need to know what it is or what it does or how it works. We don't care about that. But I'm in my testing directory and I can go up one level launch and I can do run exactly the same but if this could just be the word next flow instead of next flow run hello I'm going to do launch run hello and now this is running the local code base for next flow. But it still didn't update. So I'm missing one step. I'm actually going to jump into a second terminal window here but I'm still in the same github repository as a testing directory. Now I'm just in the root. There's another important file which is basically if you've never used make scripts before it's a way to automate steps kind of a bit like a mini pipeline in a way. Some people make pipelines and of course make makers based on this. There are some instructions in here you can do a bunch of things with the make file but the only one we care about is a command called compile This is the key. So now when I do make compile all the code within the repo is going to build source code and then when I rerun launch it will actually should this change source code will be in the build distribution and when I run it it should show up on the terminal in theory we'll see build successful that's a good first step because if it fails we're in trouble and now if I do launch there we go it shows up. That's the crux of a whole talk today really but that's the main thing I wanted to sort of show which is like that is how you clone the get up and repo from next float make some source code changes and then get it to actually run locally so you can test it and play around with it and stuff everything else I did on that pull request was pretty much like a continuation of this where I messed around more and tried to figure out how the code was working and ended up finding that there was a file in here called ANSI log observer which is all the code basically which runs the ANSI logging which is this stuff and so I started to search for other strings like process there you go there is the string which is being generated which has got the process stuff so I just went through all this code bit by bit and sort of messed around with it and played with it and changed some behavior and added in some colors and the way I did color is not that you need to know is re-audio using a library in next float called jancy which used the existing functionality which was already being included in next float jancy is not as good as rich but it works fine ok so at this point I go now draw the owl there are many steps which took me a long time between the start point and the end point but that's not very interesting or educational so now I'm just going to sort of skip ahead and show you a little bit about what the end product looked like as a treat for listening to me up until this point so I'm going to just check out just going to get rid of my changes and I'm going to get pull because this has actually been merged on semester so if I pull you can see all the code just updated here and this is all my new code and you can see stuff like now but this is one case where I did actually have to write manual ANSI codes this is why you don't want to do it normally and you can see there's a bunch of new stuff here so now let's try it out as a little sneak peek of what will be coming to your next load distribution the next time there's an edge release and you update do launch.sh run hello and we have some beautiful coloured output I'm going to go on a bit of a slight digression now and tell you a little bit about what I did in this even though it's not really part of the focus of the talk but I think it's interesting and I'm curious to get the feedback from everybody so if I just kick off Docker and then instead of running hello which is so small it's actually kind of difficult to see stuff I'm going to do run NFCore RNAseq minus results what am I talking about minus profile test Docker now now again my locally developed software with a real pipeline here you can use this launch script exactly the same as you would with the next load binary and when it actually gets to kicking off all the processes you'll see a few changes which I've done here which is kind of fun firstly there's lots of processes which haven't started yet and next load shows you all of these by default so you can sort of see the whole pipeline but when you don't have much space for those processes they'll push everything that's actually running off the top of the screen so now they are hidden by default once you run out of vertical space so it's telling you that next load is hiding some of the processes which are waiting for tasks but if there's anything that's actually running it it will still show up some other changes now if there's not enough space to show the whole process name instead of just chopping off the end of it I've changed it so it chops off the start of it because usually the end of the process selector is the interesting bit you can see there's a bunch of different syntax highlighting now so it's easier to see the actual process name which again is the most interesting bit of a fully qualified name and things like the label and it's also we've got some nice colouring just to sort of highlight things which are running properly that's sort of pretty much it really I'm going to wrap up there so I'm curious to see what everyone thinks of these changes hopefully you like them but feel free to give some feedback on that the last thing I want to touch is that contributing to nextflow is not always about code itself messing around with groovy code is fun but the other thing which of course many people and really anyone can contribute to is a documentation and so everything that you see under the nextflow docs here is all part of the nextflow repository as well and all public and under the docs directory this is built using Sphinx RST but over the last year or so in 2023 Ben did a curriculum effort and converted all of the RST documentation into Markdown so now it's exactly the same syntax as all the other documentation that we write everywhere else it's just Markdown you can just jump in and write some code or fix some docs this is a great way to contribute you don't need to mess around with any of this complex stuff you can just jump in edit the Markdown file and open a pull request locally but there's not really any need because if you open a pull request where you've edited the docs you'll get automatic previews of those documentation so you see it rendered in the pull request same as the NFCore website ok with that I'm going to wrap up and happy to sort of take any questions amazing that was really impressive but yes I knew that already but yes definitely When is Rich coming to Groovy for next law I saw a when I posted on Twitter about this yesterday Will McGuggan who wrote the Rich library commented on it with a GIF and I sort of made a joke that he should rewrite Rich for Java it would be nice unfortunately Rich packages don't know how many tens of thousands of lines of code so I'm not going to be doing that anytime soon but I would love it if someone did I think that's a nice project for someone ok anyone else has any question you should be able to I think everyone should be able to unmute themselves yes the real test is to see how many pull requests start coming into the next flow now just to fix a typo in a log message or something like that that's the kind of thing I'd love to see I remember for me I've made like a couple of pierres like for the docs like a couple of pierres as well for the run names objective in the name of the scientist any french like a scientist I might be responsible for that ok he's one of my name generator.groovy maybe sorry it's not me because he's well known but search for french there you go maxime's contributions yeah there's always space for more names Matthias asks is the ascii sock in next flow run socks colourised now no it's not that's not called next flow code that's just a next flow pipeline so just like I showed the next flow run hello is actually githubrebo at nextflowio slash hello the next flow run socks is at nextflowio slash socks I did think so anyone who's not aware about next flow run socks just to say in jokes slash Easter egg that came out via the hackathons and summits last year when we were giving away both socks and also we had a running t-shirt for the people who went on a run but also just anyone and it said on the next flow run faster and next flow run socks I think maybe it said on the socks itself so we made an actual pipeline it works so you can run that in your terminal now shall I try it yes show it it's a whisper with colours there you go it's an emoji so it does have some colours Matthias in this case I think it picks what type of sock you get randomly so if I keep running it maybe I get different socks maybe it's always the same one yes but maybe your your is updated try the latest one oh ok yeah cool then thank you again see you everyone and see you soon thanks everyone