Monday, November 28, 2011

R crash course

This is a follow up post for my R course held in Addis Ababa last week. You can find the description of the stay in the Inside Ethiopia (part 1) and Inside Ethiopia (part 2) blogposts, if interested. 

This post is a shorter and more practical one. I promised to multiple people to put the presentations online, so I thought I will make them available through my blog in combination with my Dropbox account. Here they are:

  1. Introduction to R
  2. Basic commands of R
  3. Statistics and programming in R

The other links I am referring to in the presentations are An Introduction to R, the R reference card and the other variations of cheat sheets.

You are free to re use and replicate the presenations, provided that the initial work is acknowledged.

Have fun with R! :)

Friday, November 25, 2011

Inside Ethiopia (part 2)

 This is a continuation of a previous story describing my experiences in Addis Ababa, Ethiopia.

Day2 (21.11.2011): Setting the scene

I just returned from the workshop, which was going on for the whole day. As I found out this workshop is sort of a feedback to the previous activities done by people from SLU and ILRI. The participants are from all around Africa, sharing their experiences, challenges they face as well as proposals for improvement for the current situation. Most of the day was taken by these presentations from representatives of 15+ countries, some additional ones from the FAO representative and ILRI people.

Two main take home messages, at least for me, was the need for improved collaboration between countries and the need of implementation of national recording schemes, or even better: the combination of these two. I will explain more in the next few lines.

One of the major challenges that every country mentioned was the lack of funding. This is an unhappy situation that it might well appear in other parts of the World as well. In addition there is the lack of trained personal and facilities for research (e.g. molecular labs).  To come out of this the need of intensified cross country collaboration was suggested, as the countries have often common issues to deal with. The lack of finances also forces the people to select priorities they should work on. 

One of the burning issues raised by multiple countries as both challenges and suggestions for improvements was the implementation of national performance and pedigree recording schemes. A short simplified description for those who don’t know: Performance recording is to measure the production of each individual animal (e.g. kg of milk), so when the farmers could select those with high production and eventually get better animals. The performance recording is the backbone of animal breeding virtually non-existent in most of the countries presenting today. The establishment of such a recording scheme is a huge task, so this is where the across country collaboration comes in. Additionally the same breed is often present in multiple countries eventually exchanging breeding stock, so there is a huge benefit of a compatible recording system for a certain breed or species at multiple places. The other key issue is that the recording is done on the farm level, so one has to convince the farmers to participate.  So the purpose of the recording is not only to have a nice database which is eventually used for selection, but also the farmers need to have benefit from their participation in the recording, which can be either getting information on the performance level of their animals so they can compare themselves to others or a proof of a high performance which increases the market value of their animals.

From the description above I left out many details, but I hope you got a feeling about the complexity of the issues. Frankly, this is one of the most challenging goal I can imagine. 

Day 3-4 (22.-23.11.2011): Two days later

I am coming back to write this report after two days of workshop. The participants were discussing various around conservation strategies of animal genetic resources and the needs of their respective countries. The open aim of this workshop is that the participants take over the initiative and move the things forward in the region. In order to achieve this goal they were divided to small groups of 4-5 people from 2-3 countries, so they can discuss future collaborations. Although one can not guarantee that they will eventually work together, the selection of the groups and their common sub-regional interests are good reason for optimism regarding their joint work.

I have to mention that yesterday I put forward some of my thoughts on data recording, basically proposing that one should try it with a single huge push. Right after during the coffee break I was confronted by a much wiser person than myself, telling me that the procedure as I outlined would lead to failure in African context. He was even pointing out a similar case from the past. I have to admit that it was not one of my brightest moments… But at least I learnt something new.

Half of today’s discussions were devoted to computer based applications such as the Animal genetics training resource and the Mistro database. It was a pleasant surprise that our ABG Hub (my blogpost) is linked from the main page of the Animal genetics training resource.

Tomorrow is THE day for me, where I will present the R to the workshop participants. Quite a few people were already asking questions or said that they are looking forward to my part of the workshop. The presentations are prepared, so let’s see what happens…

Day 5 (24. 11. 2011): The course and beyond

Today I held my course, teaching about 20 people about the basics of R. (attach photo of the room, upload presentations in a separate blogpost). It went reasonably well with lots of questions from the “students”. Clearly they were very interested in the program as it gives a zero cost alternative to SAS. I started on with the installation and the very basic features slowly going towards statistics and data visualization. I constructed the presentations in a way that I could drop the programming part if necessary. And was necessary indeed, as I run out of time in the mid of the “statistics and visualization” part. But I have to say that we explored some of the features of R in more detail. The people were particularly interested in data loading from text files and Excel which were not covered very deeply in the initial plan. Also they asked various questions about genetic analysis, with focus on animal breeding data. I answered what I could or pointed out resources where they could find more. I guess it would make sense to make a course in R with a special focus on animal breeding and genetic analysis related issues, it was clear for me that there would be a clear interest for something like that.

Just after the lunch we hoped on a bus and went out to the town to do some shopping. Frankly, it was one of the most devastating experiences I ever had. (ref to a blog post, or some pictures to the end of this post). We visited two places in Addis. One of them was near the main post office with a bunch of small shops selling traditional clothing, small statues and such things, but clearly oriented on tourists. The other place (as far as I could guess) was a more central one with huge concentrations of jewelry shops, mostly gold and silver.  I saw a similar environment as few days ago, so I knew what to expect. There were people trying to sell various stuff which I kind of expected, but there were also small children all around, asking people for money. One can find this in any major city in any country, but the sheer numbers were shocking for me. I saw children even younger than my son alone on the streets, mothers with children on their backs, people sleeping on the streets. Just a shocking experience. I am not sure if I want to go back there again. 

What I also know is that my denial does not change anything. Why is that some people bath in money, others don’t have anything? 

Day 6 (25.11.2011): Homecoming

Yesterday ended with an unexpected twist and I saw yet another side of Ethiopia. All workshop participants were invited to a restaurant with traditional music and dances. As I steped through the door I found myself in a huge hall with low tables and plenty of people inside. Majority of them were tourists I guess. Of course there were two guards and a security check at the entrance. After the previous experiences in town I was not in a high mood to go for such a place, but since this was the last evening of the workshop I went on. At some point I was pulled up to the stage and served as an entertainment show for the rest of the guests. Apparently they liked it, as I received many congratulations from friends and strangers alike.

 Today is the packing and leaving day. Already packed most of the things, but I will fly only during the night. I will go around the campus once more and then close the chapter of my first ever visit of Ethiopia. Most likely the work will go on, as many of the course participants will re-connect via email, but for now I am happy to go home.

Inside Ethiopia (part 1)

Yesterday I arrived to Ethiopia, first time ever. So I thought it would be good to note down the experiences while they are fresh, catching the current feelings and ideas. I want to do this day by day and finally put it on my blog. 

Inside of the ILRI campus

 Day 0 (19.11.2011): Arrival

I started from my place in Vienna around 6 to catch the plane going to Frankfurt and from there to Addis Ababa. Everything went well. Surprisingly on the plane to Frankfurt I got the emergency exit place, so plenty of space to stretch the legs. The luck was not doubled on the six hour flight of economy class, but it was still ok. When we landed in Addis I had the sequence of events in my mind: I need visa for entrance to the country, collect my bag, change money and find the driver who will take me to accommodation place. But of course it turned out to be a bit more complicated.

I found the “Visa on arrival” place immediately, but I was not sure if I should collect my bag first. Frankly this was the preferred option for me, but I realized quite quickly that this is just not possible. The 2 minutes I spent with asking around caused that the queue for the visa doubled. So I went to this one and waited there. At the same time I was thinking that there is no way I can catch my bag on the belt in the next hall. But had simply no other option… After a short time I found out that I was quite lucky with the waiting time for the visa, as the number of people in the row doubled again (e.g. 4-5 times of the original queue size). I rushed through the visa procedure paying the 17 Euro fee, went to the bank nearby to change in some Euros to Birrs and then to the passport checking place, which they called “immigration office” or something like that. When queuing there for the third time from my arrival two things caught my attention (except from the huge mass of people waiting in the hall). 

The first one was a young man around 20 who was telling the people at our side of the hall where to go. The strange thing was that he didn’t wear any kind of uniform or a sign of an employee. As for me he could be any random person form the street. But obviously it was his job, as he was in front of the properly dressed officers the whole time even speaking with them. 

The other one was a sad story. I don’t know any details, just describing what I saw. There was this young lady around her 30 brought by a guard to sit down nearby. Not that she would like to flee, but she barely stood on her legs any cried all the time. Something terrible should have happened, but no idea what it was. Hopefully some manageable problem as loss of passport, or maybe she was denied to enter the country. I don’t know… But I hope they managed to solve the problems shortly after.

Back to me. When I went through the immigrations I found the belt for the Frankfurt plane with lots of suitcases on it. Obviously most of the people were like me spending long time in the queues. So I waited some time there but my bag was not appearing anywhere. Just about the time I started to get worried I found my bag on the floor in the middle with about 10-12 other bags. Just laying around. Somebody put them down and just left them. Very strange. After that point it was a clear way of finding the driver who took me to the ILRI campus where I got my room.

Day 1 (20.11.2011): First errands

This is the day I started to write this post. It is noon local time, and about 10 a.m. at home.
I went for breakfast where I met couple of other guys from the workshop. As it turned out they hadn’t changed money yet and were looking for a bank. The one on the ILRI campus is closed on Sundays so the only solution was the city, more precisely the Hilton hotel. At first I was considering if I should go with them, but then I thought I will use the free time and the company of people to see the city as well. We wanted to take a taxi, but the guy who took me the evening before appeared (bringing somebody else to the campus) so we asked him if he can give us a ride. 

At the Hilton area it is hard not to notice the bunch of guards, some just with “normal” accessories, but I saw at least one with a Kalashnikov . Then I thought, “OK, these guys are serious around here!” Of course a security check at the entrance with metal detectors. 

As almost none of the shops were opened, we went back to the campus, where is a supermarket for food and a shopping mall with various things. And yet the next surprise here: Security checks again! This time without detectors, but 2 guards at entrance and several other ones inside for a not-so-big mall seemed to be a bit too much for me. Anyway, not all the shops were opened, so this would be a place to revisit some day.

The other thing I have to mention is the general impression from the place. There is a HUGE difference between the campus where I stay and the outside world in the city. Here everything is very nice, good roads, palm trees, cafeteria and dinner place, swimming pool, tennis and squash courts. So you get the idea. 

The city outside is totally different. Judging from this car trip, it seems that the entire city is being built just now. You see huge concrete skeletons of buildings in different stage of construction. But as for me it seemed that there is much more work to be done before the first inhabitants arrive. It would not be a bad thing, but if you see really many of them along the road you start to wonder if they will be finished in a reasonable time. Maybe it is just my impression, but it seems that they started quite some time ago and struggling to finish them. 

The other major thing is the road infrastructure in the city and the driving habits. Let’s start with the driving. Imagine a highway 2 lanes in each direction separated in the middle by small raised pavement.  Our driver took the one on the right side, but he consistently drive on its left side. Then the discussion came up if the driving habits are the same as in England, to which he responded yes, that’s why he is taking the left side of the road. But this did not explain why we are taking the right side of the highway. After a few turns and small streets full of people and small shops we arrived to a major road of the size similar to the highway, but not separated in the middle. In here the driver went for the left-most lane, with a short explanation that he knows that this is strange, but this is how it goes around here. Confused? So was I.  (Note: The drives in the city in other occasions were not this chaotic, pretty much European style.  Although the drivers had no problem to stop in the middle of the street for some time creating minor traffic jams all around.)

The other difficulty a driver will face in Addis that the infrastructure for pedestrians is not well developed, non existent or the pedestrians tend to ignore it. I saw plenty of people crossing the 4 lane highway at any point. Sometimes we encountered a person in our way in every 50 meters, sometimes a person walking on the inside (!!!) lane, although there was a fair enough and much safer zone for the pedestrians on the outer side. Sometimes this was missing as well, so we had people walking near the road, or the best: a “custom” market on the side of the road, effectively blocking one lane from the 2 lane highway! No more comments… Just amazing. I really don’t understand this. At all.
The poverty (for my European standards) was noticeable on almost every step. One could see this on the clothes of some (but definitely not all!) people and on most of the small houses. I have to say that I also saw quite many middle class apartments in huge houses, so to say that poverty is everywhere would not be a fair statement. I have seen too little so far to judge this. It is a different country, different continent, so I have to see more. 

Evening update:
Just returned from the local pub/dinner place, which supposed to serve as a meeting place for people and it is also used for dinners on Sundays. I met a guy from Sudan and we ended up near the bar discussing some more-or-less serious issues. The nice addition to the evening was the Chelsea vs. Liverpool football match broadcasted live. I knew from before that people in Africa are quite big fans of football, which seemed to be proven during this evening as well. Quite a few of us watched Liverpool defeating Chelsea, which was good news for some, not so good for others. As for me I enjoyed the match and the Ethiopian beer, and rolled back to the accommodation place with the final whistle. 

Tomorrow the workshop is starting. I am quite curious about it…