Thanks for stopping by, it's me, John Park, and this is John Park's workshop here on Adafruit Industries video streaming television, not television, and I am glad you're here. We have people over in our YouTube chat, hello, and hey Johnny, hey Dave, nice to see you. We also have our Discord chat, if you're wondering, hey, that's not my Discord, that got weird, huh, well, let me fix that. I put the wrong thing in there, that's the jobs board. Hold on, off to a good start. Discord, where'd you go? There you are, yeah, there it is, there's the live broadcast chat, so if you're somewhere that does not seem to have an Adafruit chat going on, such as Twitch, we don't keep an eye on that one, you can head over to adafruit.it slash discord, to find the live broadcast chat channel, and that's where this conversation is going on, as well as conversations all day long on this and the other channels. So, let's see, what's happening already? DJ Devon says a snap, he's showing off Todd Bot's Pico step sequencer today, that's right, I am. I will be showing that off, as well as some related stuff. I'll show a little update on my split ortho keyboard, and what else? I've got a circuit python parsec, I've got a recap of the product pick of the week, I think there's some other things too. Implicit in one of these will be a bit of a gear report too, so. Let's see, first of all I'll mention, this caught me completely off guard. Today is the 250th episode of John Park's Workshop, and had I noticed sooner, I would have gotten a special banner graphic done by Bruce and posted about it on the blog and made a big party about it, but I will figure out a way to make that up to you. Maybe we'll do something special for the 256th or something, powers of two E like that. But what that means, yeah, 250 episodes of this show, what that means is I've got a coupon code for you and the coupon code is 250. If you type that word, T-W-O-F-I-F-T-Y, I hope I spelled it right, 250, type that into the coupon field in the Adafruit store on your way out, you'll get 10% off on anything you buy. That's anything real, physical, actual, we don't put that discount on gift certificate subscriptions and software.  So I don't know what that works out to, 250 into 52 weeks, that's about five years worth, been doing this show, wow, if my math is right-ish. And so yeah, so there's your coupon, use that, coupon code 250, get a nice discount. And thanks, by the way, everyone for coming and watching the show, supporting this show and the other live streams that we do on Adafruit because it really is a lot of fun to be able to get to do this, to share with you and have the community sort of in the same virtual room together during these live streams and in our chats. And it's a big way for us to get info out there about the stuff that we do, the stuff that you do, the things we build, and it helps, of course, to get people to buy stuff, which keeps the lights on here. So thanks, everyone. Let's see, it sounds like I was wrapping up the show sorry, didn't I, I'm not. So next up, I'll mention our jobs board. If you wanna look for work or if you wanna hire someone, you could do worse than heading over to jobs.adafruit.com. Let's see if I got the right page up this time for it. I do, hey, so there's our jobs board and you can head on over there. All you need is an Adafruit login, otherwise it's free to use and we promise never to give out your info, sell it, spam you, none of that stuff. But as long as you get a login for Adafruit, you can head over here and look for jobs. You can submit your own resume, you can submit job openings that you have and that can be anything from freelance to full-time, to remote, to in-person, and anything in between. So head on over to jobsadafruit.com, check that out. Next up, I'll mention this right here. I've got my other show that I do each week. That's this one, the product pick of the week, JP's product pick of the week. On it, I like to pick something that we've got new out or an oldie but goodie and go through it, show you how it works, do some demos, give you a big, huge discount during the show that that discount does not have a coupon code, it's just good during the live stream itself. And then I do a little one minute recap. So that was the product pick this week, this very useful, I'm using it in a project right now as you probably know, the split ortho keyboard is using this. And here's a little one minute recap of the shows, check this out. It is the TCA 8418 keypad matrix driver and GPIO expander. Here's an example of using it with telephone style keypads. I decided to solder the board four columns and two of the row pins. And then the extra two I have running since they're on the other side of the board using wires there. But that gives you this sort of neat little keypad that you can use for different projects. I have it plugged in over I squared C into, this is our Trinkie and plug that into a USB hub so we can imagine that's the side of your laptop or some other computer that you wanna plug into. Now I have immediate access to this cute little keypad. So here I'm just gonna put in a comment there and then you can see I can get 123A456B789C star zero pound D. It is the TCA 8418 keypad matrix and GPIO breakout. That's right. I need to get some more of those actually. I keep using them in projects. I have some, I may be using them for the upcoming project that I'm gonna kick off here today actually. So let's see what else. Hey, this is a great time to do a little circuit python parsec. What do you say? A circuit python. Alrighty. For the circuit python parsec today, I wanted to show you how you can use alarm in circuit python to create a deep sleep state. This is really useful for when you have battery powered projects that you want to conserve energy on. So if your project needs to do something after a certain interval or after a pin has been pressed, you can have it wake up, do its thing, and then shut itself back down. There's a couple of states of sleep. There's a light sleep and a deep sleep. I'll show you a deep sleep here today. So if you take a look here, I have a ESP32 S2 TFT feather and I'm just gonna plug in a LiPo battery. And what you'll see is it's gonna start up. It's gonna print a couple things to the screen. Good morning and then time to go to sleep. And now it has shut itself into this deep sleep mode which conserves energy like crazy. Then after a few seconds, it's going to power back up, run that little bit of code and then power back down again. So the way this is done in code, I'm importing the alarm library. Then I'm doing whatever the things are I want it to do when it wakes up. And this could be doing something like a remote relay or gathering some information and sending it somewhere over wifi. You can get complex with this. In this case, it's just printing something. And then we create this variable, time alarm equals alarm.time time alarm. And that is the monotonic time is equal to time monotonic plus seven. So I have seven seconds of sleep essentially. So this is creating the little countdown timer that's happening while it's asleep. Then we call this alarm, exit and deep sleep until alarms and then whatever that value was here. So now it essentially shuts down goes into deep sleep and it's just barely awake enough to count off that time. And then it powers back up, runs the code again. And so that is how you can use alarm. Let me say that again. So that is how you can use the alarm library in circuit Python to go into deep sleep and wake back up. And that is your circuit Python parsec. And by the way, one thing I'll mention to you is this can be an interesting one to work with because while you're plugged in over USB, it doesn't really, it kind of simulates things but it doesn't really go to sleep per se. You won't see, for example, I think that the screen doesn't shut off when I have this plugged in and the battery out. It's gonna try to do it and you can develop for it but you'll also find that if you get it shutting itself down, the circuit Python drive will disappear off of your machine. So it can be a little tricky to use just the straight time alarm. And then there's a variation on this where instead of using time, you can use a pin wake up. So you can essentially have a button that takes you out of deep sleep. But that is my little intro to some of that cool stuff. If you're interested in finding out more, you know, that was a quick demonstration of that. You can head to the learn system and look for alarm. There's a guide by Dan Halber. Actually, it might be called deep sleep. Let's search for deep sleep. Got this cute little sleeping blinker in there, night cap and a little bedroom scene there. So this is the guide that you wanna check out if you wanna learn the different modes that you can use, light sleep, deep sleep, the different chips that they work on as well as the modes of alarm versus pin for waking up. Let's see. Yeah, and so someone said they may have just fixed the deep sleep on the S2. There are some, yeah, if you look in the guide and also release notes for different versions of Circuit Python, this has been under development so there are different modes and chips where things work or don't work. So your mileage will vary depending. All right, let's see. So next up, let me have a look at the Discord here. Any other questions, thoughts? People were asking about the pound key slash hash key on the keypad and wondering why it's called pound. Someone said because you wanna, it's the heaviest key on the keyboard or it's the key you wanna pound really hard. I don't know actually, it's got other names too, right? Forget, there's some other funny names for that key. All right, let's see, next up. Let's, okay, let's talk about this PicoStep sequencer. Before I demo it, I'm gonna jump over here. So we're gonna start off with, actually, let's go back. We'll jump back a little bit. Let me go to this page here. So you may remember, I did a guide. Well, I've run past it. Okay, what's this one called? Step sequencer. We have a lot of step sequencers. Let's see, I think this one's called PicoStep. PicoParty, I think. Pico's, there it is. So this little step switch party, so this is a project I built when we came out with these little step switches, little LED step switches, 808 style. And I just wanted to get them up and running, using them as a simple GPIO. So this had essentially a direct input and some lighted keys, sending MIDI out or you can do other modes, the USB mode, I think I had another one. And that's running on the Pico, pretty straightforward. Code doesn't do too much, but it gets you up and running. Fast forward a little bit and our good friend, Todd Kurt, Todd Bot, developed this and the circuit and software to go with it that I want to show off here today. It's called the PicoStep sequencer. So this takes the idea and really refines it. This is a really cool, really refined sequencer. What it does, it keeps good time. It allows you to pick the tempo and then it runs through those eight steps in time and allows you to say either a step is on and it's gonna play a note over MIDI or it's not. It lets you pick what the note is that it's gonna play. Even lets you pick the amount of time that note is pressed during its step or the gate of the note. It lets you store multiple sequences, has a little screen for display. Let's you change the notes on the fly, preview them, pause, play. So those are some of the major features of it. And so if you look at this guide here, and this is on github, github.com slash Todd Bot slash PicoStepSeq, SEQ. Maybe Todd can put that in the chat. The, let me find the page here for it again. It's also got a really nice usage of the rotary encoder and push encoder for doing some of that interface stuff and a really cool looking three printed case, snap fit case. On the site, there's some demos of it in use. I'm gonna do some live demos here today. Mention the features. One of the really interesting and impressive features of it is that it can load sequences and save sequences to a JSON file on the Pico. And those are saved and can be loaded new when you power it back on. And you can build one yourself. So it's got a bomb for it, a little build of materials and a link to go and get yourself a PCB made. So this is a project you can go out and make right now. And what I wanted to do is show you, put it through its paces a little bit, also show you a cool piece of gear that I'm gonna play with it, but it'll work with anything that'll accept MIDI pretty much. There is, by the way, the code I'm running on it is the circuit Python code. He's also written it for Arduino. And then I wanna talk about a project I wanna work on that'll be sort of an extension of this. So let's jump over to the workbench over here. And I'm just gonna bring up my discord on the phone so I can see if you have any problems hearing this. I just wanna get the volume right on it. And let's go to broadcast chat, there we go. I need to tell my phone not to fall asleep, but oh well. So here's the Pico step seek itself. Let me zoom in on this, focus in on it. So you can see I've got it powered up here and coded over USB, some micro USB, because this is the Pico that's plugged in there. In fact, should be able to pop that case off. Let's see right there, a little Pico just plugged into some headers. And then we've got a little OLED screen, rotary encoder, opto isolator for MIDI and these are the MIDI out and in over TRS, I think type B, which is the tip ring sleeve arrangement of a little 3.5 millimeter stereo cable. And then eight of these lovely little step switches. So they have in out and I think these are direct, I don't think that's a diode matrix. I think those are direct GPIO and then the PWM of the LEDs is also a pin per. So there's no multiplexer on here. So I'll leave it open actually, it's kind of cool looking. Power this up and I'm gonna plug a MIDI out cable. That's going through, or rather, that's going into this right here. So I'm kind of, I'm gonna double up here and call this both a project exploration and a gear review. So this is the Roland JX-03, this is a desktop synth. And actually I'll jump back to the screen in a second and show you one of the reasons this is so cool is this is a modern recreation of a roughly 1983 synthesizer that was a keyboard synth, which had a somewhat convoluted method of accessing any of these parameters that you see knobs on here. And then there was a little side piece of equipment you could get that was even smaller than this, that was the knobs to adjust those parameters if you didn't want to do it over MIDI. This is perfect for me because it gets rid of the keyboard. I don't like to use keyboards because I don't really know how to play it. And it puts all the controls right there. It does have a built-in sequencer, but this one is a little bit more fun to use because it's a little more direct. So it can play a wide range of polyphonic or para-phonic synth voices using the two oscillators in here, the filter, VCA and modulation. So enough talk, let's play something. So I'm gonna take a look at the screen here. We'll get back to the little Roland and some of its controls, but if you take a look at the screen here, and any flicker you see is just a video artifact. We don't have flicker in the real world here that I'm seeing. So here you can see when it starts up, it's got, grab something to point with, it's got these eight steps and it tells us what note it's playing. So C E C C C A sharp C C. Some of those are in different octaves. So you can see that all this first set of C's are in the third octave, but then we go down an octave to octave two. Each of those steps also has a little bar over it that shows how long it plays the note within that step. So some of them can be shorter. Tells me that this is one sequence, actually has eight sequences stored on it that we can switch among. Tells me it beats per minute, it's at a hundred right now. Transposition, so it is at what it says right now, so that first note of C is what it's gonna play. When we want to transpose it by semitones, we can, you'll see this little transpose up or down, so we just shift it. And then there's a little pause icon there showing me that we're paused. So I'll hit play, and let me know in the chat if you can hear that. And if you can still hear me, if that mix is decent enough, you can turn it down or up. What you'll see is right now, it only plays on the lit notes, right? So we have the full sequence in there, but we're playing different, we're only playing two of those eight steps. So what I'm gonna do is just change one of the output pitches or MIDI notes that it's sending. And so that's this fifth step here. And what I'll do is just hold that and then adjust. So I've gone up to semitones to a D. So that's one way to just change your sequence. And then we can bring other notes back in. Okay, now what I'm gonna do is just change sequences entirely. And to do that, I'm just gonna hold the encoder down and press the second one. Could be louder, okay. Can I get this louder? Pick another sequence, pause there. So that's almost, you can use that as a song mode. So if you keep them in a set of keys that work together or the same key, you can have eight sequences and maybe even just let the first one play four times, the second one twice, the third one, kind of step your way through a little song, which is kind of neat. As you're changing these, you can also store them. And I haven't played around with that, but I think it will, after five seconds of a change, if you pause and play, it will just automatically write. I think there's also another method of key combos to get it to play or sorry, to get it to save that JSON file that it stores. So let's see, it also sends out over USB. So I'm not, right now I'm just powering it over USB, but you can do USB MIDI. So this can be plugged right into your computer, your iPhone, your iPad or other MIDI host type of device. So you don't need any of these classic MIDI cable types of things and it will allow you to have a really cool little step sequencer with you, just plug it right into your phone and play on that. And maybe, oh, you know what, I don't have, yeah, I don't have the adapter to do that on my phone here or I'd show a demo of that. So let me get a basic sequence playing again and then I'll just show you a couple little features. I'll just noodle around on the JX-03 here. So that's good right there. So here I've got presets. So this completely changes the sound of it because these are some really nice patches that are preset stored on here. And I can do things like then adjust the value. This is the release. So how long it tails off a note after it's played it. So you can get overlapping notes if you turn this up. You can also do things like change the two oscillators so one of them can be lower. If you can hear that too well, go higher. And then we can detune the second one.   So ended on that. Oh, sorry, you couldn't see the fun stuff I was punching in here. So I'll give this guy his little case back. Where'd you go? The little case top back on there. It's gotta be unplugged from USB to add that on there. Also really cool, Todd did a neat multi-material thing here, I think just pause the print and changed out the filament there so you get this cool contrast. So cool little gizmo. What I was thinking of doing, so let me actually jump back over to workstation for a second here. And let me go to, let me go to this page here. Actually I can go, go to that one. So this just came out, this is the little breakouts to make our step switches, these little guys here, a little friendlier to work with just because the pinout has some vertically oriented pins. They're in a column and they should not be tied together. They're meant to be separate pins. So this either needs to be on a PCB. I put that demo on a protoboard that does not have any of the pins tied like a breadboard, so that's easier to just sort of free wire stuff. But if you aren't making a custom PCB, these little breakouts are gonna make it a lot easier to design things you could leave it put together there and have a kind of spaced out little, what is it, six by six. I'm gonna snap them off of there and put them onto some perma-proto boards I think. And I might put one and a half of them side by side or something like that and make a 16 step sequencer. So my deal with that is actually just to start out with a similar code base as what Todd has on the Pico step seek, but have a 16 step thing and possibly some different hardware. And then see if I can make it modular enough to expand to multiple tracks, either with one row of 16 and multiple choices of which MIDI channel you're sending out to, for example, or which MIDI note in the case of a drum, often on channel 10, you can have MIDI drums based on the note that you're playing. Or maybe go multiple rows, which would be really cool, multiple physical rows of 16 and make a big humongous like 64, either single 64 step or 416 step tracks. So those are some ideas. This is gonna make it a lot easier, take those, put them on the perma-proto and then with that addition of 16 instead of eight, we kind of blow past the reasonable number of GPIO and PWM pins we have on something like the Pico or a feather. So I may do something like the KB2040, PWM16 of the pins and then use something like the TCA8418 to add the either a keyboard matrix or just straight GPIO to add the 16 button presses that I need. These things also you can sometimes get away with using the Grant Central. If you don't mind having something really big because the Grant Central has a ton of IO on it, but I think there's 16 analog ins on it, a bazillion PWMs, like 50 digital ins. So that one's another option. So that is my plan to take a whole bunch of these and make a nice variation on the sequencer. And hopefully that'll be something that you can put together. Todd's step sequencer right now, but this will be a variation. I'll be working with Todd on that and trying to lift as much of the code as possible. As someone mentioned in the chat, the code is not simple. It's actually quite impressive the fact that Todd's got the timing working really well in Circuit Python, even though he's redrawing to the screen, he had to do a lot of work to get just the smallest bits of the screen to redraw when necessary so that it wasn't slow over I squared C to refresh the OLED. So let's see. Oh yeah, Todd says in the chat, I've been working, let me bring up the chat here. I'm working on a 16 step version using a SPI display and the WS2811 LED driver to get an FIO kind of stalled on it. All right, let's try to possibly install this. So let's see. I think that covers it, so that's my plan. I'll be updating you as I go and showing off some work on that. I also might have a little mini hobby lighting project in the middle, I got a kind of a cool idea for doing some hobby lighting for painting and other small work. Yeah, somebody says, call me midi curious, the Pico step sequencer seems approachable. Somehow fear ends with me selling my card to afford synth patch cables. It doesn't have to, I promise. You can use this on any computer you have, just get a free helm, free midi capable synthesizer, or if you want to deal with patch cables, VCV rack is a good one. All right, good. All right, so thanks everyone for stopping by today. That, oh, I'm almost forgetting. I did have one more update I wanted to give. This is on a separate note. This is on the ortho split keyboard. So I got pretty much all of the hardware designed and worked out. So I showed my progress on that last week. Let me show you where it's at this week. Let me jump to this view again over here. And out of the way. So there's the completed. I have actually just one thing to do, which is recut this one without these extra holes that I accidentally put in it. Wasn't paying attention and those are holes that only need to exist on the bottom side to hold in the PCB for the key switches. So I still have some work to do on the lower and raise modes for switching out to different layers of the keys, but it does work with what you see here, including things like control keys, command keys, shift, all those things work. It's just lower and raise, aren't real. So I had to extend the top a little bit. If you look at the previous, this was the previous design here. It was shorter. Oh, sorry, that's, yeah, there you go. It was shorter. That ended up not being enough space to mount that QT pie in there nicely. And one of the challenges I had, I hadn't solved last week was, how do you mount the QT pie in there? QT pie does not have a mounting hole on it. It's so small. And so I borrowed a snap fit QT pie section from a 3D model that the Ruiz brothers made. And it's just a little carrier for the QT pie that I put a mounting hole on, rather than since I'm laser cutting the bottom here, but for the 3D printed version of this, you'll be able to just print it in place. So here you can see with the top removed. So this is my QT pie mounted upside down. And why did I do that? I don't even remember now. I think it was to get the USB-C port where I wanted it. I had that, yeah, that was too low. No, is that right? No, I wanted that lower. That might not matter anymore actually, since I changed some other stuff. But this snap fits just into this little piece here, which I have screwed into the case like that. Two mounting holes might be better, but so far it seems to be working well with one. So I can plug in USB from the side there. That one's too fat, I get a kind I was using. It's a little slimmer one. There we go. So you can see that that wiggles a little bit, but it's not terrible. Then I have the, you can see here, I've got kind of, it's about a perfect length of Stem-A-Q-T cable connecting it to the TC-8488 that's reading the matrix of this keyboard. And then the second one just has a TC-8488 and the cable runs through the hole into a little breakout. This is that little spark fun breakout. And then those are going to the other I squared C bus. So there's two I squared C buses on here. Since these share the same address and you can't change the address on them, that was my technique for getting both of these on here. Could with the new matrix, I squared C matrix sort of hub thing that we have coming out, you could do it all over one. That would be another option and that would allow you to also add even more of these depending on the scope of your project. So still have, I think I showed you these last week, three printed middle section with the little brass threaded inserts he said into there. And so that's how those six screws there hold this laser cut bottom onto it.  And so that's how the top plate mounts on there. The white was just what I had. It also makes it really easy to see the screws and things like that in the guide. So I may just leave it at that. That's not maybe my favorite color in the world for this, but it's, I think it works. And same with the middle there as black, that was just what filament I was using. I could probably find something a little cooler that would color match this look. But I do actually think it has kind of the intended feel of that severance on Apple TV kind of workstation dasher type of feel. And other options are to use some of our standoffs. I've just got rubber bumpers on here, but you could use our large aluminum keyboard standoffs to get a pretty nice angle on there, about like a four, five degree angle. If you put those on there, it'll raise that up a little bit, which you might like for ergonomics. Some people also like to do it like this. So you get a little angle going in here. So you have sort of a more natural wrist position pronation. So that is the hardware design. I will be, I've been shooting photos of that and writing up the guides so you can go and build your own split ortho keyboard if you like.  Because you can see this key just clears it and on this side it doesn't, this still presses, but if I wanted to plunge it further, it's gonna catch on there. So I gotta make those a little bigger. Also means you could stack multiple acrylic tops or print a taller middle section and then get the keys to be a little more flush, which I like the look of. I don't like when they stand up proud like that. So I'll probably do a little bit of an adjustment and maybe do two layers of the three millimeter acrylic there. So there, that's the update on the keyboard there. If anyone out there is ambitious and interested, I'd love to know if someone who's familiar with QMK or any of the other popular keyboard software could figure out a way to have it work with that type of configuration, which is fairly out there having a pair of I squared C key matrix breakouts. It would be, I think, a bit of custom work to get it to work. If you could, then you'd be able to do all the fancy like layer building in web pages and uploading new configs and stuff like that. Let's see. Yeah, DJ Devon says, these are right with a marker on the white. You could do a little white dry erase, rather drill dry erase marker work on that. So that is an option with that keyboard. All right, I think that's gonna do for today. Yeah, I noticed in the chat someone talked about, said, hey, don't forget about your keyboard. Thank you. I was so close to forgetting about the keyboard, but there it is. That'll do it for today. Thanks everyone again for stopping by. Some of you maybe up to 250 times. This is the 250th episode of the show. And with this coupon code, 250, T-W-O-F-I-F-T-Y, you will get 10% off in the Adafruit store on anything that's real. Nothing that's imaginary, such as gift certificate subscriptions and software, but physically real things you'll get the 10% off on. So just use that before midnight, Eastern Standard or Eastern Daylight, whichever we're on Eastern Time, and you will get the discount. Thanks, Andy Callaway. Yeah, thanks everyone so much for stopping by. That's gonna do it for today. I'm John Park. This has been John Park's Workshop. See you next time.


I know. I did that one. I've been in that for some time. I just waited. Ew. I'm excited for the bus. I'm excited. I'm excited for the bus.   You're not even supposed to stand in the bus. On the busses? Oh. Okay. Is it a healthy bus? He doesn't even want to go. I don't care. You on about?


And now my year 23, going on my year 23 year, and again, I've seen this before. This isn't something that I've looked at now and I go, wow, I can't believe this is going on.  This is, oh, this is an opportunity. Welcome to Access to Trader, the number one community for those who are committed to taking control of their trading in order to achieve success, profitability, and longevity. Thank you for joining us. Here's Dan Shapiro to help you find your edge, master your process, and own your future. Hey guys, good morning everybody. Welcome to another edition of the Access to Trader.com. We can update show, hope everybody is doing well. So crazy start to the year, right? Again, you're not going to hear any, you know, you're not going to hear any pity parties coming out of me, anything negative coming out of me, anything that's somber, the idea that this is a funeral that we're all attending, this is the stock market, right? This is the absolute stock market. I know a lot of you guys are great, great people, and this is kind of your first entry to kind of what declining stock prices look like, right? This is literally the first time a lot of you guys have been trading for less than two, three years, and some of you guys have been trading for two, three months, and all you've seen has been steady rising stock prices. You've seen incredible moves, just absolute incredible moves, especially in the last five years, stocks going from three to 300, it's been crazy, but the one thing that most of you guys have not experienced has been the decline, and declining stock prices as the classes all over the board is real. And when you go back to the start of my career, again, this isn't the first time we talked about it, 2001 and 2003, I couldn't make a dime, right? I was coming off the euphoria of the internet craze and years and years later, I've realized and admitted it was completely lucky, right? I was completely lucky, my first 18 months in this business that the internet was here, and this is a free-for-all, doesn't make a difference what you bought, again, if you've ever watched that interview with me and Meyer Hoffman, the late great Meyer Hoffman, he said, you know, look, we got lucky, right? He didn't say in those words, but we got lucky. Basically, the market made you right. Any prices that you bought weren't important, as the point is, the market made you right, and that's what's been going on for three, four, five years, and a lot of, unfortunately, new traders got caught up into, doesn't make a difference where I buy, I could chase at any level, the market would always make me right, and that was great, and that was fantastic, and that was the case, and now it's not, right? And instead of sitting there, what I did from 2001 to 2003 didn't make a dime, was absolutely my worst moments in my life, those darkest moments, suicide was very, very real in my mind, I went over it many, many times, because I couldn't figure out, how could I have done so well during the internet craze and not make a penny throughout these years, and I was depressed, and it was incredibly tough time of my life, but I realized years later when my wife pretty much gave me an ultimatum, it's over, right?   Again, if you go from the 1927 crash, to kind of where we are this morning, you'll notice the same thing, the stock market will go up, traditionally go up and gulf in a lot of bad news, and then eventually it will go down again only to wipe out a whole generation of new traders and start the cycle right back again, and again, it's too early to say how deep this decline is going to be, but the one thing that I figured out by 2003, and although my wife did give me pretty much an ultimatum, say, hey, listen, that's cool at all, you did great during the dot-com craze, it's two years later, our money supply is depleting, well, what do you want to do next? You got to get a job, and I got a lifeline on another trading desk because of what we did during the dot-com era, and I got lucky again, it was the right place at the right time, but I finally figured out how to, I finally figured out because I bought some time in between 2004 to kind of 2007, I kind of bought myself some time to figure out how the game works very, very first innings at it, and it really did take me about 10 to 12 years to finally get comfortable in my own skin, and now my year 23, going on my year 23 a year, and again, I've seen this before, this isn't something that I've looked at now and I go, wow, I can't believe this is going on, we got to sit on our hands, this is an opportunity right now, so you have two choices, you could sit there, feel sorry for yourself, because you've never seen it before, which is fine, which is absolutely normal, or you can take the environment you have, and kind of try to make something out of it and put yourself in a position of strength instead of a position of weakness, again, this market did not fall for the first time in the last couple of days that everybody's so surprised, the market's been falling, you have a lot of these growth stories we've been talking about for once now, a lot of these growth stories have gotten destroyed, I mean, absolutely destroyed, you had NET, I mean, look at these moves, you had NET going from 221 into the 80s, you have UPST that had this incredible, I mean, there's a lot of it, some of these stocks have gotten 50, 70% haircuts, it's not something that you woke up to one day and say, wow, these stocks are really getting killed, yeah, and the only difference between now what you're seeing as far as the indexes go and what you started seeing in November was the stocks, and people realize this, people stop paying for potential, okay, it's like, again, if eventually, with all the Kobe Bryant's and Kevin Garnett's and Tracy McGrady's, they got drafted out of high school, they were great, they were paying for potential, there came the Kwami Browns, right, there came guys that you've never heard of before, and then eventually all these GMs, they said, oh, wait a minute, I don't know how great it is to draft these guys out of high school and they stop paying for potential and that's exactly what happened here, all these stocks had these massive, massive runs and people didn't care what prices they were buying, eventually they said, ah, we're good, and the only real reason Main Street really started feeling the facts, most people don't know what a UPST is, they don't know what an NET is, they don't know what a letter U is, but they know what Apple is, and most funds and mutual funds and index funds are holding it, they know what Amazon is because again, most index funds and mutual funds and hedge funds are owning them, and once those stocks start to get pulled, that's when people started paying attention, so yes, the sell-off came in November, right, of growth stories, but the real money flow, right, the institutional holdings that we've been seeing and talking about, and primarily I've been trading for years and years and years, the beta names, now they started feeling the effects and what you started seeing in November and you can make an argument, stocks being sold then, that's great, but my world, right, my world of these names, of these high beta mega cap technology names, once they started cracking, that's when the money flow started coming out and there was a buyer strike for institutional money flow, so nobody cared about UPST at 225 if a mutual fund doesn't even know this company's alive, but they start caring when Amazon starts cracking down, when Netflix starts cracking down, when Apple and Facebook and NVIDIA and Tesla, right, that's kind of a big deal and that's kind of where we are, and when you look at all the indexes, you know, it's really pretty, pretty ugly, right, you got an 11% decline on the queues, you know, three weeks into the year, right, you know, that's a pretty, pretty big decline, you got nearly a 7.6% decline just for the week, you know, very, very aggressive, but more important, it shouldn't, you know, especially if you've been watching this broadcast or just a pure enthusiasm from the chart basic technical analysis point of view, you saw the breakdowns, you saw the breakdowns off the 50s, you saw the breakdowns off the 100, you saw the breakdowns off of the 150-day moving average, just kind of watching this video the last few days, and here's the problem, you know, now we've closed below the 200-day moving average two days in a row, and that's a big deal because the longer we build below the 200-day moving average, the higher probability you're going to see further decline in prices, and when you look at the monthly chart just to give an idea where the potential next level can be, right, we talked about this on Wednesday or Thursday's video, any close below this macro trend line starts the next cycle to the next rising monthly support and the next monthly rising support, again, especially if you believe in the theory of stocks trading from supply to supply, well, you know, stocks trade then from demand to demand, and this demand is all the way to 328 on the Qs, which considering we closed at 351, yeah, you got a pretty good amount of downside to go. Now, again, I think because social media, and unfortunately, you guys, a lot of you guys are only just subjected to the views of social media, you know, the story is always buy the dip, bears never learn, buy the dip, bears never learn, bears learn, right, there's a reason why bears are bears and the reason why bulls are bulls, they're usually one-sided and they stay in that direction, and bears have been winning, even with this whole big cycle for the last five years, again, if you're a good technician or even a pretty decent technician, you could pick your spots to the downside, you don't need to catch stocks going to zero, maybe just catch stocks going to the channels, but you know, this is kind of their game, right? You know, I'm not a perma bull, I'm not a perma bear, I'm a perma realist, and you know, I've trade both sides of the market, I've seen this, I've seen this movie now from 2001 to 2003 to 2007 to 2009, the question is, and this is where something we don't have an answer to, the question is how long will this decline will be? The optimism, right, the optimism in all of us, right, because everybody loves the bull market, the optimism in all of us will turn around and say, wow, so it should only be another couple of days, eventually stocks are already oversold, they're not, guys, they're not, the queues have gone from 164 to 400, they're not oversold, that's the whole point, and again, you can start making that conversation, that argument in the first two weeks of 2001, after 9-11, in the first couple of weeks after 2007, when they started talking about the mortgage crisis, they lasted for two, three years, again, I'm not trying to scare anybody, and these are facts, you can go back and look at your charts, go back to your history books, this is exactly what happens, I would love, in a perfect world, for the bulls to kind of wash out, throw the baby out the bathwater this week, and reclaim the 200-day moving average, and start this really aggressive cycle back to the backup, nobody would love it more than me, again, I love a good bull run, but I also am a realist, I understand how to read chart prices, I understand how to read charts, and again, if you look at the monthly, right, the monthly view on the queues, and you have $3.28 is your next measure potential, not saying it's going to get there, but it's your next measure potential, you have eyes, and again, this is the greatest indicator in the world, without the whole fibonacci, and this is not the other thing, the VWOPs, and no matter, the channels, the indexes, right, if you have eyes, and you can see where your next potential landing spot is, and you have to be mentally prepared for that, and that's the most important thing, it's not fear monitoring, it's just kind of reality, and the most important part is guys, even if you are traders, you've got to get that whole, you know, buy the dip mentality out of your head, buy the dip, and I've been saying this for years, buy the dip is something that is in a bull market cycle that stocks are coming off their highs, and coming back into this 60 minute, either rising 60 minute channels, or rising daily support, when the stock market is underneath supply, and this is not just the queues, this is the queues, these are the spies, right, they're all beneath supply, under the diamonds, okay, this is not a time that you turn around and say, this is the first day underneath supply, the second day underneath supply, macro supply, that started years ago, this is not your first time and say, all right, Monday, here's my shopping list, the market can't possibly go any lower, these are gifts, these are free shares, this is free money, not so fast, right, not so fast, again guys, remember, stocks need to be above demand to go long and below supply to continue selling, and we are the mother load, right, we've closed, not like we closed below the five day, the shortest term sentiment, we've closed below the 200 day moving average, and that's the mother, mother, mother loads of demand, and that's gonna be an absolute issue, and when you look at the catalyst, or lack of catalyst, kind of coming up to this week, number one, you saw earnings kickoff this week, you saw the banks, you know, disappoint, right, you got banks disappoint, you got JP Morgan, you got Goldman Sachs, you had Netflix kickoff earnings, right, they kicked off earnings, the subscribers growth was not great, you had some news in the market about Peloton, and again, nobody should be turning around and say, wow, I can't believe it, I've been, I've been so, you know, I'm so stunned that the stock went down, I mean, the stock is just getting destroyed, right, so some news, some extra news that came out, and again, we don't know if it's even real, there's some news, there's some contrary news turning around and saying, well, the news of potential production halts on their treadmills and their bikes, yeah, that might not be true, we don't know, right, we saw the news come in on Thursday, the stock got destroyed, and then we got some defense coming in and say, hey, maybe, you know, maybe this is some false narratives that somebody started and the stock bounced back a little, we'll never know, right, we'll never know until we have a definitive statement coming summer, again, but the point is, look at the stock, do you really want to be long Peloton going into Monday, maybe it goes up, maybe it doesn't, right, maybe there's a Deccat bounce at some point, at some point, even Blackberry, right, you know, when everybody started switching to iPhones and Samsungs and even the Google Pixels, people turn around and say, how could Blackberry still be alive? Well, yeah, they have billions of dollars of intellectual properties, that's how Blackberry stayed alive, so Peloton could drift through a trifle, which kind of bounced back, but their intellectual property makes them sexy, that's why the stock will not go to zero, they also, by the way, have a tremendous cold following, again, I have a Peloton, I don't really use it, I've used it five times maybe in five years, but my wife does and there's a lot of people that have a tremendous, tremendous love for the product and it is a huge for cold following and the fact that they have X amount of millions of riders, that is value, combined with their intellectual property, so the stock will not go to zero, okay, I think it's very, very silly just the way Blackberry didn't go to zero, but again, do you really want to own the stock, just like owning anything else in the market coming in Monday and just because we've seen prices decline in the stock market, well now you're seeing it coming across of all asset classes, you see Bitcoin getting hit, right, you see Bitcoin getting hit, I'm personally waiting to make my first investment of Ethereum, I think at some point this weekend, I will, right now it's like 2,400, I can see drifting to 18, I know nothing about crypto, but if you believe in the whole theory that this is like the first stages of the next big thing of this whole blockchain, this, that, the other thing, hey, it's worth the shot, right? Anyway, from like 1,500 to 2,500, if you're willing to hold it five, 10 years, you gotta look at it yourself and this is the way I'm kinda looking at it, either Ethereum is gonna go to zero, it's gonna go back, it's gonna go to 10,000, either way, allocate some capital to where you are in five years, don't ever invest in something that you eventually can't see going to zero and again, is it possible, Ethereum in five, 10 years goes to 10,000? Absolutely, is it possible it goes to zero? Absolutely, right, there's no such things as guaranteed, so anything that you're investing long term, well, it has to be long term and you almost in the back of your heads have to say to yourself, I'm allocating these funds if they go to zero, it kinda sucks, but again, make sure they have no bearings on your long term financial goal, financial plan and make sure it doesn't hurt your wallet and you know, that's sitting there up 24 hours a day checking prices, that's what investment is, again, you can invest in precious metals, you can invest in art, you can invest in Bitcoin and Ethereum and anything else in the stock market, make sure again, it's not emotionally taking you to the woodshed and really damaging the overall quality of your life, so if you can't hold something, don't invest in it, if you can't wrap your mind around it, don't invest in it and the most important part is this is business, is a business, it's just like anything else, it's like the way a carpenter would handle his tools, just the way a waitress would handle her notepad, it's a business, handle this business just like anything else, detach yourself from this business, detach yourself from it from your personal life, from anything you have going on because at the end of the day, it's just another end to make means and it shouldn't concentrate and it should spill over into your personal life, so again, is it possible to get some sort of relief rally this week? Yeah, sure, of course, but again, the most important part and you've kind of seen it throughout the whole week, any single time, there's been any type of rally, literally, any type of rally in the queues and they get slammed, right? They go back into supply and then they get slammed, another rally and then they get slammed, that's been happening the whole week, so is it possible we have a dead cat rally this week? Yeah, at some point, right? But the key is that the queues, they have to reclaim this 367 level, they have to, if you're looking to swing a position, you're not looking to catch a knife, you're looking, at least technically, for the market to give you a green light, at least in the short term, to give yourself a point of reference, so if I'm looking for a longer term play, aren't you at least, if you wanna buy Microsoft, if you wanna buy Apple, shouldn't you at least wait for the queues to reclaim, for the bulls to reclaim back, short term technical damage and start closing above prices when they broke down? That's the smart play, you can't just sit there and go Microsoft is cheap at 300, then Microsoft is cheap at 280, Microsoft's cheap at 260, Microsoft's cheap's 240, there's no guarantees these things ever come up, so again, the optimism in all of us, are gonna turn around and say, hey, the market is way oversold, although it's not, it's gonna come back this week and may not, but the most important part is again guys, don't guess, okay, we're all bad guessers, don't guess, it's all about data, and right now, if you look at a lot of charts, then don't even look at the ones that are overextended, start looking at the ones that haven't broken down, so I'm very, I mean, again, how can you be bull biased? Again, possible, get a dead cat bounce at some point this week? Sure, absolutely, but I am by no chance, absolutely no chance, buy bias until we reclaim, until we reclaim at least the 200 day moving average on the queues, and again, if you look at a lot of charts, you're not looking at Amazon right now, you're not looking at Amazon after this breakdown here of 3124, that's 300 points lower, although again, it could go down, you're looking for stocks that just started breaking down, and again, we'll get to the pivots in a second, but you're looking for channels that haven't broken down yet, right? Like look at Xilinx, look at Airbnb, right? Look at Airbnb's channel, right? Look at a channel like ZS, right? Just first close confirming this whole channel. Look at a chart like Visa, right? About to confirm this whole channel here, right? Look at Monster that came back down, got rejected off the five day moving average, back to back days, look at which room it still has back to the downside. So you're not supposed to be looking at stocks that are already down 50, 70% for short, so you're looking for stocks that are breaking down out of the channels, and once they confirm those channels, if the market continues to be weak, those are the stocks that are gonna catch up and get pulled down just like everything else we're seeing. So obviously Netflix kicked off earning season, which is not a great thing for technology. It's one of the reasons why they got slammed on Friday. You got IBM on Monday. Let me see what else is on Monday. IBM, pretty much IBM is the biggest one. You got IBM on Monday, but then you start going into heavy technology. You got Microsoft on Tuesday, Microsoft, J&J, triple M. You got AXP, you got Texas Instruments. And then you got Wednesday, right? You got Wednesday, all eyes on Tesla. You got all eyes on Tesla. You got all eyes on Intel. You got Boeing. You got AT&T. You got Las Vegas Sands, Lands Research. You got a lot of slew, and then you start going into Apple on Thursday, Visa on Thursday, then next week, right? You got everything else. You got Amazon, Google, Facebook. So we're starting, right? We're starting into earning season. The question is, and I've experienced this in so many markets, a lot of times, unless the earnings just blow away the numbers, okay? No matter what they say, they're going to sell off the stock based on market conditions. And I kind of talked about that on right before Netflix's earnings, they would have to blow earnings away, okay? For the market not to just say, hey, who cares, keep on selling? And that's exactly what happens. So again, day two underneath, the 200-day moving average on the cues, first day on the spies, first day on the diamonds. Again, not a great look for the market. So let's talk about Fridays. Let's talk about Fridays. Pivots, oops, wrong one. Let's talk about Fridays. Pivots, again, you know, pretty much sell bias all across the board. Again, I don't want to buy anything.  I'm good, right? I'm good. I'm waiting for all these stocks. It's very, very rare. You're going to see a buy pivot until we start really, really reclaiming big support. So this was the big one, right? For all you guys who are swinging it overnight, you have to, they report on Wednesday. Maybe you get one more pull, but this was definitely the trade of the day, at least for me, 980 huge level of support. If it builds below, it can flush. Tesla got smoked, right? Just like everything else. Tesla got absolutely smoked. It took out the 980, and this is the first close off rising support. They do report on Wednesday.  Again, I don't know what's going to happen. I love Tesla, right? But again, loving a company loving channels are two different sides. Long short, I think if Tesla confirms, you can see here, you know, you had a 50 point move on Tesla. If Tesla confirms Friday's channels, it has room to about 912. So if you believe in the store, right? If you believe in the whole prospects on Tesla, maybe take a shot there, right? If that's your thing, right? If that's your thing for a longer term play, but yeah, there's a high probability. If we do confirm Friday's channels, we go back down to 912. Facebook got smoked, 313 has held three times pre-market for builds below can flush. Here was Facebook, right? Here was Facebook, all the way down to 303. I think as a shot, if it confirms Friday's prices goes down to 295, testing the December 3rd lows, that was good. Let's see here, let's see here. Peloton never got there. I'm still watching Peloton, Microsoft. Again, they're taking down the bigger names, right? 350, 300, huge level, if it builds below can flush more. Here was Microsoft, right? So here's Microsoft took out this whole channel here, traded down to like 95 and change. Again, if it confirms more, should get down to about 290 and kind of reflecting all the indexes that it's a part of. So again, more lower prices there as well. Xilinx held 184, I still like it. This thing loses that 184, it's gonna get hit. Dollar Tree, I wasn't watching. I sort of got down to like, I don't think Dollar Tree had a big move at all. Yeah, it only went down like a dollar and change. I still think Dollar Tree probably sees 122, but it's not really my thing. So here comes Facebook. There was actually a daily channel of 315, but it doesn't make a difference. 315, 313 went down to 303, Microsoft coming down. Tesla, I said cover more down here at 958, 960. It's traded down to 935 after hours. Here, it's getting smacked. Facebook's getting smacked. Everything's getting smacked, blah, blah, blah. So that's it, right? That's it. I don't have to be too creative, guys. Stay away from anything that is overextended. Again, yes, can Amazon still go lower? Absolutely, but again, I would always remember the theory. You always wanna be wrong, right? You always wanna be wrong jumping out of the first floor then jumping out of the 10th floor, right? So if you jump out of the first floor and you get hurt and they hold the ranges, you're gonna get a paper cup, right?  If you jump out of the 12th floor window after it already broke down here, you're gonna die, okay? So just remember, the same pivot, right? The same pivot come Monday morning on Tesla at 980 macro breakdown is a completely different story. If Tesla starts going to 930, 929, 10, completely different story. One part you could survive with a hickey. The other part, you got a severed head, so be careful, even though it's the same symbol, the highest, the further it goes from the pivot, from the daily macro channel, the higher probability your level of success is gonna start shrinking and shrinking and shrinking. That's why there's only one pivot and everything else is confirmation and continuation. Guys, have a great weekend.  We only have one life to live. There are no do-overs. Guys, God bless and I'll see you on Monday.


Down syndrome is the main cause of intellectual disability. It is caused by the trisomy of chromosome 21. And the intellectual disability is thought to arise from the defects in the process called neurogenesis, which is the process in which neurons themselves divide and generate neurons, which then make the human brain. In case of the Down syndrome, fine defects in the process of neurogenesis can result in the reduced number of neurons that are produced, which then will result in the reduced size of the brain and will cause the intellectual disability. In our lab at Human Technopole, we are interested in studying these processes at the molecular and cellular level to understand these defects. And we hope that our research in the future can lead to new prenatal therapies that will help these patients.


John Lipski, welcome to WPC-TV. You are a very distinguished economist, and now at Johns Hopkins University, SAIS, in Baltimore. And previously, of course, at the IMF. Now, tell me, you have a new president coming. What will be the economic effects of a Trump regime that you foresee? Oh, wouldn't it be nice if everyone knew for sure, but we don't. Certainly, he's expressed in the campaign certain preferences. There is, at least on paper, the outlines of an economic program. He hasn't named his top officials yet, and of course, he has to work with Congress. I think there is a consensus that there will be some initiative to increase infrastructure spending. Which you would approve. Well, let's see. In principle, it could be good, but in infrastructure, just because you call something an investment and spend a lot of money on it, doesn't make it productive. So you need to look at the details. The U.S. economy is not doing so badly on employment 4.9 percent. Growth could probably be a bit faster, but productivity growth needs to be a bit faster, too. So it's not immediately obvious that there's a big initiative needed in that direction, but he also has, President-elect Trump has indicated seriousness about tax reform, which is something that has been discussed and is certainly needed in the U.S., and if this results in an unblocking of a reform that has been frozen, that's a hopeful sign. You mean profits held overseas, which aren't being repatriated? Well, that's only a small part of, in general, the distortions that have been introduced by the corporate tax, by the details of the corporate tax rate. The U.S. has a very high corporate tax rate, and as a result, there's been a proliferation of all kinds of special treatment that effectively lowers the rate, but complicates and distorts the economy. Is there an instinct of protectionism within the Trump administration that you foresee? And does it worry? Well, you certainly talked about trying to renegotiate what he considers unfair trade deals, but the specifics have been lacking, and these things are not simple. And in trade deals, especially one, for example, as complex as the North American Free Trade Agreement, that there's a lot of, everything depends on everything. In other words, nothing's agreed until everything's agreed, so if you start moving little bits, then you'll find other bits starting to move, so this may be difficult. Now, John, you're often at this conference each year. What do you get from it? Oh, it's very, from someone based in the U.S. It's very interesting and refreshing to hear all the viewpoints, especially European viewpoints of current events, so it's an excellent opportunity. Excellent. As the Chinese say, we are living in interesting times. We're in very interesting times, and very interesting times for Europe in particular, with some structural changes underway with the shock of Brexit, the round of elections coming up, and the challenges, the geopolitical challenges to Europe as well as economic. I couldn't agree with you more. Now, this is, there's certainly a lot to talk about here. John Bersky, thank you so much for being with us. Happy to.


Hey folks, in recent episodes of Code Club, we have been using tools from the tidyverse to do our own rarefaction analysis of the number of different taxa in a variety of microbial communities. We've been doing a lot of the heavy lifting ourselves, and I think that's been useful to help us learn more about rarefaction, working with random processes, and then also just getting more practice, more reps, using tools from dplyr and other functions and packages from the tidyverse. Well, in today's episode, I am going to show you how you can streamline your analysis by using tools built into a great package for ecological analysis called vegan. So today, we will use vegan to look at rarefying our data to a specific number of sequences. We'll also look at the probability of seeing any of our different taxa for that level of sampling effort, and then we'll also generate refraction curves for our 227 different samples. And we'll see how we can get the data out of a vegan object and into a object that we can use to make a nice plot using ggplot2. Here's the r script that I'll be working with today vegan underscore rarefi.r. If you want to get a copy of this script as well as all the data so that you can follow along, and that's something I really encourage people to do it because you'll learn it so much better if you're following along and you're playing with the data and your code. Anyway, if you want to get this down below in the description, there's a link to a blog post for today's episode. You can use that information along with this video that I have up here in the corner to figure out how to get caught up with where we are today. So again, you can follow along, and that is the best way to learn this material. So again, we read in the tidyverse tools, and then there is this big chunk of code for reading in data from a file that's in data called mice.shared. Mice.shared was generated using a tool called mother. That's pretty specific to analyzing 16S ribosomal RNA gene sequences. Mother also will do rarefaction for you. So if you're getting data out of mother, you know, you may as well just stay in there and do the rarefaction there. I realize that not everyone is working with microbial ecology data or even using mother if you are using microbial ecology data. So that's why I want to spend a little bit of time showing you how we can go through a object, a data frame, a tibble like shared, which has a column for the sample ID, a column for the different taxa and then a column for the number of times we saw each taxa in each of our samples. I will go ahead and load everything here. I also have a function that is in this script for calculating the number of otus or taxa that you would expect to see for a given level of sampling effort. Looking at shared, we again see those three columns that I mentioned. As I mentioned, we're going to do a lot with vegan today, so I need to go ahead and load the vegan package. And if you don't have it installed, be sure that you go over to the packages tab in the lower right window of our studio and install vegan. And then we have access to all the great vegan functions by using library vegan. Now, one of the things that we see when we do this is that the following object is masked by .globalenv because vegan has a function called rarefi and I have a function called rarefi. So what I'm going to do is I'm going to rename rarefi to be my rarefi. So we'll do that. Again, we have this as a tibble where we have three columns and to have data that's properly formatted to go into vegan, we actually need this to be a data frame where taxa are across the columns, our samples are in the rows, and that our sample names are the row names. So we need to do a little bit of work to get this tidy data frame into a good working shape for going into vegan. So I'll take my shared data and pipe that into pivot wider, and we will then do names from name and our values from value. I don't think we actually need those two columns, names from and values from when the names are name and value. I think those are the default names that it automatically looks for. I like to leave it in there again to be explicit and to show you that if you have different column names, you can still do this pivot wider. Something else I want to add in here is to say values fill and I'll say equals zero. So what's happening again, if we look back up at our shared file, that the samples, this first column is the group, those will be in the rows are otus or taxa, those will be in the columns. And so you can imagine that as you pivot wider, there might be row column combinations, sample otu or taxa combinations that aren't in the tidy version. And so what what pivot wider does is it puts in an NA value by default. So what I'm saying is instead of putting in an NA value, please put a zero in. And so again, what we see is that we then get this wide data frame. So I'm going to convert this into a data frame. So as that data frame. And the reason I need to convert it to a data frame is because I need to put my samples, my groups as the row names, tables do not allow row names. And so what I can then call this will be shared D F. And then I can say row names, shared D F, and that's going to be shared D F dollar sign group. And then I can take shared D F and say that that is shared D F. And I'm going to use the square brace notation, and I'm going to get to the column, I'm going to say minus one to remove the first column from shared D F. And so now if I look at str on shared D F, I find that I've got all my different columns for my different taxa, the different otus. And I've got 227 rows and 1588 columns. So we're in good shape. That is now stored as a data frame, we're ready to take that now into vegan to do things like rare faction. And so what I will do is to do rare fi, and I will take shared D F. And I'm going to verify it to the smallest size sample. Well, how do we get that? Well, let's step back here and let's go back up to shared. And we'll do a group by group, right? And then we'll do a summarize. And we'll say n seeks equals the sum of value. And so now what we get is a column for our group and n seeks. I'm going to do another summarize on this. And we'll do min equals min on n seeks. And so that gives us 1828. And I'll go ahead and do a poll on min. And we will then assign the output to min and seeks. And so now if you look at min and seeks, we get 1828, that's great. And then I can plug that in here, min and seeks. So I get back 1403.62, which doesn't seem right for a number of reasons. So first of all, I'm only getting one value, I should be getting 227 values, one for each of the samples. And I think that's actually the value across all of my samples. So I think what's happening is that I'm using my version of rarefi, which I had changed to be my rarefi, as you recall. But I think it's still using the other version of rarefi my version of rarefi instead of vegans, right? So one way that we could check that would be to say vegan, colon, colon rarefi. And what the vegan colon colon does is tells are, hey, I know there's multiple versions of rarefi out there, use the version from vegan, please. That gives us a quite a bit different output, right? Now we get different richness values for each of our samples. So I could keep doing vegan colon colon rarefi. But if I want to keep things straight without having to worry about that vegan colon colon approach, what I could do is restart R. And then because I have my rarefi or rarefi renamed my rarefi, then when it reruns everything, it should have things straight. Alternatively, I'm going to go ahead and clear out my environment so that my environment is now empty. And I can then go ahead and rerun everything should work. Again, I have the the vegan rarefi here. But if I remove that vegan colon colon, again, I now have the correct version of rarefi. And if I look back in my environment tab, I see the functions I have my rarefi, I don't have rarefi there anymore. So we're in good shape. Again, that's a little thing that you run into from time to time when you have clashing functions that are coming from different packages, or you know, something that's in a package that, you know, you're writing your own version of so just be aware that you could also do that vegan colon colon rarefi. All right. So again, we have seen now how we can get out a vector of values that are rarefied to a specific number of observations. It's a named vector with 227 values, each value has a separate name. Well, I can also pipe this into as underscore tibble. And I could say row names equals group. And now I get a tibble, where I've got a group column and the value. I could also go ahead and pipe this and do a select group. And I'll say vegan equals value. And one thing I wonder is, is vegan using the exact rarefaction? Or are they using the bootstrap, the randomized process? I'll call those vegans. And then I'm going to do the same type of thing, but with my rarefi. And so again, we'll have shared and we'll pipe that to group by group, right? And then we'll do a summarize. And we will say mine equals my rarefi. And then we want the value column, and we'll do it to min and seeks. And this then gives us my output, right? And I'll then call this mine. And then I will do an inner join between these things. So I'll do inner join vegans, mine by group. And so now I've got those two columns, and I could then do a mutate. I'll call it diff of vegan minus mine. And I'll go ahead and do a summarize mean diff and SD diff. And so what we get is that there is no difference. So it does appear that vegan is using the exact calculation for rarefying your data. So why would you want to rarefy the data using a random approach? Well, this exact approach only works for something like richness. As we've seen in previous episodes, things like diversity metrics such as the Shannon weaver index and the Simpson index, they can be sensitive to sampling effort. And so there isn't a exact solution for determining the diversity at a specific number of sequences or observations for those diversity metrics. So in that case, it would be useful to go ahead and actually do the empirical rarefaction approach. Very good. So now we have the expected number of taxa that we would see for a given sampling depth across all of our samples. And we've also seen up here on lines 42 through 44, how we can get it basically out of that named vector and create a table so that we could go on and do other things like plot the data or you know, anything else we'd want within the tidyverse. The next command I want to share with you is our rarefying. So our rarefying allows us to get a single sub sampling of the data to then do whatever you'd want with it say, right? Now, basically, this would be like one iteration of the rarefaction step. So we can do our rarefying. And we can then give it again, shared the f and I'll do sample equals min and seeks. And so then this gives back just a mess. And we can then pipe this to as tibble. And we'll say row names equals group. That gives us a tibble. And then we could make it long by doing pivot longer and do minus group. And we're right back to where we started again, our rarefying gets you one sub sampling of all your data. You can think of rarefaction as basically doing 100 or 1000s of these sub sampling steps and then pooling all the data together. So if you wanted, you could take this data, calculate say Shannon diversity, and then repeat our rarefying calculating Shannon diversity, repeat that 100 or 1000 times, and then get out an average Shannon diversity to again get an empirical version of rarefaction on like the Shannon weaver diversity index. Another great tool from vegan is D rarefi. And so this then tells you the probability of seeing a specific taxa for a level of sampling effort. So we can say shared the f and we'll say sample equals min and seeks. Again, we get a really gigantic data frame that's quite wide. I'm going to grab these couple lines of code from what I had up above here with our rarefi to then output the group, the name of the taxa, as well as the probability of seeing this taxa say O2 in F3D0, if we got min and sequences, right? And so what you'll see is that the output here to a tibble is a bit truncated, right? For most of these values always see as one. Others we maybe get three total significant digits like one zero and zero. And so three significant digits is the default number of significant digits that a tibble will share with you. If we want to increase the number of significant digits, we can alter the options for how we display values in a tibble. To do this, I'm going to say old equals options. So I can then give options pillar dot sig fig equals seven. And if I look at old, I see null. And so what that means is that it previously had used null, which is tells pillar, which is the package that tibble DF uses to figure out the significant digits to use the default. So the old version was using the default. Now we are using seven significant digits to the right of the decimal place. Now when I run D rare fi, I get seven significant digits, right? And so you can see that O2U2 is pretty close to, you know, dead on that we're going to see O2U2 when we get min and seeks, right? And so if I perhaps looked at the tail of this, we would see that some, you know, this O2U2053 has about a 23% chance of being seen in sample M69. Whereas these other taxa, we're not going to see them ever really if we sample to min and seeks, which again was 1828. Cool. So if I want to go back then to the default, then what I could do is options old. And now if I rerun this, we'll see that we go right back to what we had before, which was three significant digits to the right of the decimal place. Okay. So again, this was a useful tool to see how we can calculate the probability of seeing each taxa in each sample for a given level of sampling effort, and how we can use the options function with the pillar dot sig fig argument to set the number of significant digits we want. Again, we could take this up to 10 or whatever we'd want to see those decimals to the right of the decimal place. So the last function I want to spend time talking with you today about is rare curve, rare curve, we'll take in our shared DF data frame and make refraction curves. So we could do rare curve. And then I can give that shared DF. And then I can say step equals 50. And so what step equals 50 does is it says only output the data every 50 observations. So I don't need to see 123456789 all the way up to like 10 or 20,000. Instead, it'll go 151, 101, 151, right? You know, we might even go up to 100. Let's do that. What we get out of rare curve is those 227 refraction curves. And we get a text box for each sample on top of those curves. This is a figure that's generated in base R. I'm not interested in using base R. I'd like to know how I can get the data for the curves out of base R and into GG plot two. And so what I'll do is I'll go ahead and pipe this into str. So the str function reveals that the output of rare curve is that figure, but it's also a list. And I know it's a list because I've got that dollar sign, but it's not keeping the name of each of the samples next to that dollar sign. And so that's a bit annoying. But the other thing that's interesting is that each element in this list is a named vector. And so we can see here, say 142.159.6 and so forth, are the number of expected OTS or taxa that we would see for sampling 101, 201, 301 and so forth, right? And so then what we want is we want to get this out of this kind of funky list and into a table so we can then go into GG plot. So I'm going to go ahead and save this as my rare curve data. I'm going to take rare curve data. And I'm going to use map DFR on rare curve data. And basically what this will do is it'll take each element of the list, which is rare curve data, and I'm going to then do bind rows. And so what bind rows will do is it'll bind together each of those elements to make a data frame. And what we'll see is that we have N101 and so forth. These are our sampling depths going across the column names. And then our rows are our different samples. We're going to need to bring back in those sample names. But if I were to say come out here and do select, I'll do N1001. And I'll see that I've got a bunch of NA values, right? And so these would be samples that didn't have 10,001 sequences. And so what's happening with bind rows is it's plugging in NA values, where there's a value missing for that column. Okay, so we kind of have an idea of what the data look like. I'm going to go ahead and pipe this into a bind calls function. So I'll take the row names of shared DF. And then yeah, and then we'll kind of put the stuff coming through the pipeline to the right of those row names. And this then gives me the groups, although I didn't give it a name. So I'll call that group equals row names shared DF. And so now what we get sure enough is a column for our group, and then our different taxa. So now because I want to work towards putting this into ggplot to make the line plot, I need to go ahead and pivot longer to make it tidy. So I'll do pivot longer. And we'll do everything but the group column. Very good. And so the next thing I want to do is go ahead and take that name column and turn it into the number of sequences. It's currently a type character because it has the n and then the number. And so I'll do a mutate. And we'll do n seeks equals str replace. And I will then say name. And I'm going to take the n and replace it with nothing. And I'm going to wrap this in as dot numeric to convert the text into a number. And so sure enough, now we have n seeks as a double. And I can go ahead and do a select minus name. The name column isn't causing any problem. But let's let's get rid of that. And now what we can do is we can go ahead and do ggplot as x equals n seeks y equals value. And we'll do group equals group. And we'll do a geom line. And looking at our figure, we get some really funky output here. It almost looks like I use geom point rather than geom line. And when I come back to my console, I see it removed 76,118 rows because they contained missing values. So if you remember, when we looked at the right side of the output of our map DFR, there are a bunch of NA values. Well, that's what's going on here. So we need to go ahead and get rid of those NA values. So after pivot longer, I'm going to go ahead and do a drop NA and feed that into the rest of the pipeline. So there we go. We have 227 refraction curves. That's not super helpful. You know, something that we might add to this would be a vertical line to indicate the depth of sampling that we've been using that min and seeks. So I'm going to go ahead and before running geom line, I'm going to run geom v line. And I'll say x intercept equals min and seeks. And I will make this color equals gray. And add that to there. And I'm going to go ahead and do theme classic. And so what I get is the vertical line to indicate where 1828 was, which is the value of min and seeks. And that that kind of shows us where we're looking at for you know, our level of sampling effort. Again, with 227 samples in this refraction curve, it gets to be kind of nasty, right? Like you really can't see anything going on in here. And, you know, I don't think there's much value in looking at the refraction curves. I would far rather look at the output of rare fine and then convert that into a tibble, so that I could kind of go on my way and looking at statistical analyses comparing, you know, different time points in these animals lives and whether or not, you know, something happened between different time points to change their number of taxa in their community. So I hope you find this discussion useful of how we can use vegan. In previous episodes, I've talked about how we can basically make our own versions of these functions. It is nice to be able to use vegan and get vegan to do it all for us. Oftentimes, the packages like vegan are far better engineered than what we can do on our own. It also kind of removes a lot of the guesswork. Sometimes the math in these functions is a lot more than we want to kind of carry on our own. And so it is nice to be able to rely on something like vegan. At the same time, I do think there is value in going back through those previous episodes so you can understand the mechanics, what's going on in these different functions. If you had to code it yourself, how would you do it? As we've seen, these functions aren't doing anything super complicated. And so, you know, we're gaining a bit by being able to use vegan, but it's also not something that we can't do on our own. Hopefully this episode also underscores the value of getting really flexible and comfortable using tools from the tidyverse. The output from these vegan functions is a little bit gnarly, right? And so the ability to figure out how to get them into a tibble so that we can do things like pivot longer, pivot wider, group by summarize, ggplot. It's all really powerful and really useful and things that we need to keep practicing on so that we can get better and more comfortable doing. So, I encourage you to keep practicing with this and we'll see you next time for another episode of CodeClub.


Everybody forced here ripping 21-22 one-on-one basketball hobby ten bucks full case number 34 tiered randoms team style Fine. Yeah, there's the results. You can always find these late sports cards calm sounds good stuff. Let's do it Good luck everybody. Thank you for joining Yeah, I made my mission to pull the force Whitaker Super Fracturado Somehow yeah, I have to buy my own box and I force Whitaker Nobody would believe it though. They really all you bought it Did you know that Thanksgiving is less than two weeks away? Or what how far away is Thanksgiving? Three weeks. Oh, no, it's two weeks away. That's kind of scary. I Don't know man. It just feels like Halloween just happened. It did. Yeah, it did. Yeah, I guess that's how it works Three weeks apart Yeah, because the time changed this I Don't know you wake up and it's bright outside already because I wake up like up to work I go home and go to sleep That's that's the life of the card shop right crown three towns T. Wolves 55 and 99 you go T. Wolves So when you sent out the because that show next weekend, I was like, oh, I like to go to that I'm like all I do is Like man like Lane now We all just work on a car job and you want to card shows days off Redemption dual jersey auto card 14 Chris Paul CP 3 for the Sun's it's a second tier hit for miles H I knew CP had the spotlights or the sneaker. I didn't know that he had Actual autos I didn't know I didn't expect it. There you go Sun's You just put a sticker on one back to Got rookie magic Jalen Suggs one of 30 nice parallel Yeah, I know that's why I know I know he's I was there. I know happened wait you were there. Yep. That was me Got rookie Jersey auto Kings Davey on Mitchell 77 of 99 There you go Kings. Yeah, we need to get rid of it What is it? This is the last year seriously. Yeah, don't don't lie to me. All right Don't joke around about things that'll be great gold Kevin Durant three out of ten nice card nets Gold spider. What does he go by Durantula? None of those. He doesn't like those dizzy easy sniper Easy sniper. That's a good one Got a dual Jersey auto Pacers buddy healed 74 of 99 Pacers buddy healed Yeah, six my dad has to be out the door at 4 a.m. Every day for work He's probably done early usually You know, I'm taking that do whatever you want in the evening for a little bit John Collins Hawks 35 out of 99 John Collins Hawks one break Got thunder prime patch auto Josh giddy Bingo, okay. See that's miles each top tier team miles is having a heck of a break. Let's go Four color patch on the rookie auto Joshua giddy. Yeah. Yeah, sorry. I don't giddy up like wait No, I mean I wouldn't want to try it. He did it so well We could bring him back in for it But we just get that we should get him to do it and then we have Halley make a little dancing Blake They hit the buttons dance That would be amazing Can't be that hard to do Although I know nothing about it spurs Mono Ginobili 12 out of 25 talk to her Monday God rookie auto Grizzly Zaire Williams 50s or 36 and 99.  Thanks again for joining man Just ten to go ten to go in Star Wars Gold again here. It's here in Fox for the Kings never at seven to ten 12 total spots for the night. That is it Lot of personal orders have been coming in to Charles a live Charles Barkley 75th team signatures sons 9 of 25 Sons again, dude Nice Chuck. He's most of the time a redemption. He'd be famous. So, you know, who was he better for in your opinion sons or sixers sixers Right anyone MVP was like he was really good with the Suns, but I think he was And like he had better team success, but Come on Thomas moments Come on. All right. We've got Westbrook Lakers number three out of 30 We got a timeless Believe so Thomas moments R. J. Barrett 48 of 49 nicks Another second to your head for Lee. Did he win MVP in Boat? Did he was that rich? Yeah. Oh, here we go Here we go He's talking to me. We talking about Coleslaw I Got red subbonus Kings 15 out of 15 with the Sack Town Jersey Are they allowed to call that Yeah, yeah, Franz Wagner dual Jersey rookie auto Orlando 69 of 99 When a Peter M with the magic sweet Franz two more guys I'm gonna check personals after this. There's two total Almanac spots for tonight left And there's only 10 spots in that Star Wars chrome black case coming up in a bit here So let's get this filled up guys. I might have to bring it back Gold do a nice one Miami seven of ten Nice do a sweet gold there Timeless timeless moments. I think no no rookie Jersey auto. I got I got faked out I'm I'm wanting it too bad right now I do a home accident rookie Jersey auto of Zaire Williams nice break for the Grizzlies had the rookie auto and now the rookie Jersey auto 15 of 25 Guess save it for the big hits though Next like gigantic card. I pull whatever it may be something that will get like recognized around the hobby I have to say something outrageous Like Coleslaw like Coleslaw and then We like this guy young coleslaw Was really like that coleslaw over a latent Richmond feet and all the breakers too much coleslaw Sneaker. Wow. That's a really cool one actually Rashid Wallace on the sneaker spot Pistons 42 of 99 Wow Do that is really cool actually She could you imagine if he played today kids would be like If Rashid played today He would dominate. Yeah, he would he would Six sheet he was that Jinx Jinx Stefan. I said six sheet. He was that like stretch big that she was unguardable Three-point shooter good defender. You've got a rookie auto sixers Charles Bassie on the back 49 out of 99 That'll do it everybody Another fun night of one-on-one breaks. We've got Star Wars chrome black coming up next