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…

Tuesday, October 25, 2011

Out for Africa

When I was starting to write this blog wanted to focus on more "work type" topics, mostly dealing with agriculture or animal breeding. This was the initial plan, which has slightly adapted in the meantime. One thing I was clear about from the beginning that I would like to deal with my two main interests, the advancments in technology related issues and my passion for agriculture with special interest in developing countries.

While writing this post I am thinking about the reasons behind this. Although I had little formal education in "development studies" so far, I met a bunch of people from these regions. I have in mind my former and current colleagues and friends from the BOKU office or from the EMABG. Although I have never been in those countries, they became one of my main interests, through the people I met.

So you can imagine how excited I was when I got the opportunity to participate on the ILRI - SLU - FAO workshop called "Capacity building for sustainable use of animal genetic resources"  in Addis Ababa, Ethiopia end of November this year. I was even happier that I could be one of the presenters. According to the plan I will have half a day to present the R data analysis and programming environment to the participants. I had similar (although shorter) presentations few times before, mostly for EMABG students, so I have bit of an experience with it. Although this will be a different setting and a different audience, so I am going to adapt the contents accordingly.

I was traveling quite a lot inside Europe, but this will be my first jouney outside the continent. First one goes to Africa. 

Thursday, September 29, 2011

Survival Analysis - Theory and Application

Last week I experienced a summer school from the other end. Together with Hans Soelkner we gave a two day course on survival analysis focusing on its application. This was a  satelite workshop of the 19th Animal Science Days in Primosten, Croatia. The attendance was surprisingly good! :) We had 30 participants from 6-8 countries!

The view from the course venue...

As always the theory behind is important, so Hans spent the mornings with explaining the stuff right from the beginning. Afterwards it was my responsibility to turn it into practice, using the Survival Kit v6, a program package capable to analyze large databases. For those who know me the software choice is not such a surprise :)
(For those who wonder: I a involved in its development, so it is kind of an obvious choice.)

What can I tell... The course went ok, at least according to the written (and of course anonymous) feedback after the course. One thing I would do differently is that originally I planned much more for day 1, but ended up skipping half of the stuff. I could provide the basics of usage, one or two examles but nothing more. Hans warned me before but I thought it will be ok. Well... It was on the edge, to be honest.

On day 2 we started with an example repeating the approach from the previous day. This was done by the participants themselves, so I was very happy that most of them did it without any assistence, and those who required some advice got the results soon after the "early birds". So the first day was reasonably ok, I guess... After this one we continued the day with examples on including random effects and relationship matrices, eventually ending at breeding value estimations.

In overall the conference which followed aftervards was a very nice event. A number of presentations mostly from the Central/Eastern European region, providing a good overview about the work being done on participating universities.

Last but not least I would like to express my great thanks to Ino Curik and all organizers for the invitation and the very nice time in Croatia! Hope to return one day!? ;-)

Post publication note:
Attaching my Delicious bookmarks on survival analysis. More on Google...

Thursday, August 25, 2011

One week, five countries


Most of the time I try to post some stuff here that might be interesting to some of you (or at least I hope). But as you might have noticed I write some “personal” notes as well from time to time, about things that I want to keep in mind or not want to forget. This post is one of the personal ones as well.

Last week I had the opportunity to visit 5 European countries in 7 daysIt was a nice experience worth to remember, so I am posting it here with some accompanying photos.

Monday: Munich, Germany – actually I was the whole previous week there on the Synbreed Summer School The lake was not integral part of the  course, but I like the photo :) My work... One of the best so far I guess...
Monday evening: Wageningen, The Netherlands – The EMABG Welcome event was running, and I had 2 presentations there. Good time! (p.s. This is the main building of the animal breeding people there, but they will move to new locarion soon dubbed as the "New Zodiac", so likely it was my last visit in this building.)
 
Thursday: Vienna, Austria – I spent the shortest time here from the 5, basically landing by plane going through the city to the train station, but it counts ;)

Thursday evening: Slovakia – home sweet home


Friday: Budapest, Hungary – finally some leisure trip with my family to the Tropicarium (said to be the biggest in central Europe) 


Sunday: Slovakia, a "ranch" neaby Galanta. Family time again :)




Monday, August 22, 2011

Next Generation Sequencing: Departure to New Frontiers


Last week I have competed the Synbreed Summer School called “Next Generation SequenceAnalysis: Practice and Departure to New Frontiers. It was organized in Herrsching am Ammersee, Germany which is a place just near Munchen. The main organizers were animal breeding people from Technical University Munchen and researchers from the Helmholz Zentrum

I have to say: It was an exceptionally good summer school!




There were several thing in the course that were “out of the ordinary”, yet contributed for the course success (at least for my viewpoint).
1.       Focus on practical data handling: I liked this part very much. We went through everything, starting for the installation of the software up to imputation. It is not easy, but manageable.
2.       Usage of free software: I mean all software, including the operating system. Actually I had to install the Ubuntu Linux because of this. But now I am glad I did. The main interface is far from the command line feeling, which often keeps people from installing Linux. At least with this new Ubuntu graphical interface I had the feeling I am browsing a smartphone… Of course the things can become pretty complicated, depending on the actual aims of the user, but the basic navigation is without problems.
3.       Course given by PhD students: I was realizing this just by the end of the summer school. Not that PhD students are not good enough (in fact they were excellent), but I would expect somebody older “by default”. But I guess this was the strategy of the course to bring in people who are working with these things on daily basis,as they are the most qualified ones to introduce the techniques to us.
4.       Evening sessions: After the daily workload we often went for a beer-or-two, often ending in the billiard room. Good time! 

Except from the practical sessions there were also presenteres, who contributed to afternoon sessions. They were specialist in their fields highlighting various possibilities of sequence data. The list is as follows: Mario Caccamo and Jared Simpson on De novo assembly, Paul Kersey on Genome browsers and databases, Ben Hayes on Genomic selection, Agricultural genome projects and Perspectives of using sequence data, and last but not least Karl Schmid on  Next generation population genomics.

The list of software and other useful links:
  • Burrows Wheeler Aligner - for alligning short sequence reads
  • SAMtools - various utilities to manipulate allignments
  • SEQanswers - all-around forum for sequencing issues. They have a wiki too with the list of most popular software. If you are into sequencing, this is the place to dive deeper. 
Be sure to check out the "World map of sequencing" too. Well... I think it displays the number of sequencers by region, consequently the amount of effort put into sequencing everything what comes around. As of August 2011 it seems that the most powerfull players are the US and China as individual states. Europe comes third if we look at total sums.