In this lesson we'll discuss the seqinfo part of GenomicRanges objects, your siqinfo you've seen that it contains information about the length and the names of the chromosomes. And it's mundane to spend some time talking about how to manipulate the siginfo, but in practice it's something that we do again and again and it pays to be on top of it. Now one of the first things you do when you deal with, let's say weird siginfo for slots is that you try to get rid of some of the chromosomes. This is very common. Even for analysis you may restrict you analysis to the six chromosomes or the autosomes. Or you may for convenience just want to look at chromosome 22, which is the smallest chromosome. So let's look at how we do that. So let's make a GRanges with two chromosomes. You can do this using various functions. One way is you use seqlevels, and you use the force argument to seqlevels. This looks a little weird, but it works well and you see it used again and again in other people's code. You say force = TRUE And now you give it a list of chromosomes that you want to keep. So in this case here, we have now dropped everything on chromosome two. Or everything that's not chromosome one from the object. Let's recreate the object. And inside a package called genome info TP which is automatically loaded when you load genomic ranges. There's a set of functions for manipulating and dealing with seglevels. So there's two convenient functions DropSeqlevels and keepSeqlevels. They do exactly what you would expect. Say dropSeqlevels(gr) and now you want to say drop chromosome two. We get back something back where we have drop chromosome two in the same way we keep a set of seqlevels in order get the same result. I want to keep chromosome one which is the same as dropping chromosome two. And I get the same thing. There's also support for dropping weirdly looking chromosome names. So let's change a weirdly looking chromosome name, which I usually, for some organism, small context. So here we are really talking about small contexts from a well assembled genome. There's a function called keepStandardChromosomes. And, well basically keeps the standalone chromosomes. What exactly is a standalone chromosome, takes a little while getting used to, and I would encourage you to just run it and see what comes out of it. Now, it's also a sad truth that chromosome names is a pain in the butt at times. Different sources and different data sets lying around on the internet use different chromosome styles. So some call them chromosome one. Some call them chr01 for sorting, some calls them chrI, or just 1, or capital I. And there's a lot of different styles, and these different styles depend on different sources and they depend, they can also be different from organism to organism. A genomic for bb. There is functionality for quickly converting between different styles. That's convenient. Say you're doing analysis where you get data from a lot of different sources, and you want to make sure they all use the same chromosome names, and you want to use the same styling for the chromosome names. So let's go back here and have our example thing, where we have chromosome one and chromosome two inside of g ranges. And the way you do this using GenoInfoDB is you set up first that big term New Styles where you say mapSeqlevels gr and then you have to give it the style name and this here let's use NCBI style. It's not the gr, it's the seqlevels. And this here converts from chromosome one, two and NCBI style, let's look at what it looks like. Well, it's a very simple vector here, it converts chromosome one into one and chromosome two into two. And the way we now rename the thing as we say, our g ranges is equal to rename Seq, levels, GR comma new style, hyphen, like so. And now I have a harmonized with style of Seq things. Sometimes this can go wrong, if you have weirdly looking chromosomes or there are some chromosomes that have entered it wrongly. And then you can examine the thing that you can examine this new style latency, whether or not it looks sensible. In the future, we hope that it will be as easy to harmonize sequence lengths, which is something we often want in our objects as well. Currently the best way of doing that, the easiest way, is probably grabbing the sequence lengths from the different BSgenome packages. Where you can do a seqinfo on a BSgenome package or BSgenome object, and you get back a genome level information that's ready to go into the GenomicRanges.