Getting Started with Git on Google Code

I recently wrote another script (that no one will ever use, most likely) that I wanted to release under an open source license. I hoped onto Google Code, but rather than choose SVN for my version control system, I selected Git on a whim. I’d been meaning to give it a try.

I was surprised to find that git wasn’t installed automatically with Mac OS X. I had to grab an older version from here, since I’m a bit behind the times with my operating system. This installed git at /usr/local/git/bin/git. So far so good.

I set up my ~/.netrc to have my Google login info:

$ cat ~/.netrc
machine code.google.com login christina.bergey@gmail.com password GOOGLEPASSWORD

I then cloned my new, empty repository with:

git clone https://christina.bergey@code.google.com/p/bsnp-to-fasta-via-bed

Moved into the directory and copied the script there:

cd bsnp-to-fasta-via-bed/
cp ../BSNP_to_FASTA_via_BED.pl .

And then added it, committed it, and pushed it:

git add BSNP_to_FASTA_via_BED.pl 
git commit -m "Added script"
git push origin master

And got an error. Luckily the answer was pretty easy to find and only involved removing “christina.bergey@” from my directory’s .git/config file. Done!


The script, BSNP-to-FASTA-via-BED.pl, (for the one other soul that might someday benefit from its existence) is a simple bit of Perl that takes as input a file of SNPs from the Bayesian SNP calling program BSNP and a BED file of intervals and outputs a FASTA file containing sequences for each of those intervals. It’s a bit kludgy, but it gets the job done. Plus, it was a nice excuse to try Git.

Wallace Adopts an Orangutan (and Shoots Another)

The collected letters of Alfred Russel Wallace, co-discoverer of the theory of evolution by means of natural selection, have been digitized and made available as part of the Brtish Natural History Museum’s Wallace Letters Online project. I was poking around and found this account of his adoption of a baby orangutan during his eight year journey which passed through through Sarawak (on Borneo, now part of Malaysia) and which directly preceded the development of his theory. The letter was sent to Frances (“Fanny”) Sims (née Wallace) on the 25th of June, 1855 while Wallace was on the Sadong River.

Baby Orangutan 2

I am afraid you would call it an ugly baby for it has a very dark skin and red hair, a very large mouth but very pretty little hands & feet. It has now cut its two lower front teeth & the uppers are coming. At first it would not sleep at night alone but cried very much but I made a pillow of an old stocking, which it likes to hug and now sleeps very soundly. It has very strong lungs and sometimes screams tremendously so I hope it will live. But I must now tell you how I came to take charge of it. Don’t be alarmed, I was the cause of its mother’s death. It happened as follows, — I was out shooting in the jungle and saw something up in a tree which of course I thought was a large monkey or orang utan, so I fired at it and down fell this little baby in its mothers arms. What she did up a tree of course I can’t imagine, but as she ran about in the branches very quickly I presume she was a “wild” “woman of the woods” so have preserved her skin & skeleton and am endeavouring to bring up her only daughter and hope some day to introduce her to fashionable society at the Zoological Gardens.. When its mother fell mortally wounded the poor baby was plunged head over ears in a swamp about the consistence of pea soup and looked very pitiful. It clung to me very tight hard when I carried it home & having got its little hands unawares into my beard, it clutched so tight that I had great difficulty in making it leave go. Its mother poor creature had very long hair, & while she was running about the trees like a mad woman, the poor little baby had to hold on tight fast to prevent itself from falling, which accounts for the remarkable strength of its little fingers & toes which catch hold of everything with the firmness of a young vice. About a week ago I bought a little monkey with a long tail, and as the baby was very lonely while we were out in the day time, I put the little monkey into the cradle to keep it warm. You will perhaps say (or my mother will) that this was not proper,– “how could I do such a thing”,– but I assure you the baby likes it exceedingly, and they are excellent friends. When the monkey wants to run away by himself a little as he often does, baby clutches him by the tail & ears & drags him back, and if the monkey does succeed in escaping, screams violently till he is brought back again. Of course, baby cannot walk yet, but I let it crawl about on the floor a little to exercise its limbs, but it is the most wonderful baby I ever saw and has such strength in its arms that it will catch hold of my trousers & hang underneath my leg for a quarter of an hour together without being the least tired, all the time trying to suck, thinking no doubt it has got hold of its poor dear mother. When it finds no milk is to be got, there comes another scream & I have to put in [it] back in its cradle and give it “Toby” the little monkey, to hug, which quiets it immediately. From this short account you will see that my baby is no common baby, and I may safely say, what so many have said before with much less truth, “There never was such a baby as my baby”– and I am sure nobody ever had such a dear little duck of a darling of a little brown hairy baby before!..

The baby died after three months, and Wallace published a report on his pet in the Annals & Magazine of Natural History (May 1856). Here he contrasts the ape and monkey:

It was curious to observe the difference between [the orangutan and the macaque (Macacus cynomolgus)]. The Mias [orangutan] like a young baby lying on its back quite helpless, rolling lazily from side to side, stretching out its four hands into the air wishing to grasp something, but unable to guide its fingers to any particular object, and when dissatisfied opening wide its almost toothless mouth and expressing its wants by an infantine scream. The little monkey, on the other hand, in constant motion, running and jumping about wherever it pleased, examining everything with its fingers and seizing hold of the smallest objects with the greatest precision, balancing itself on the edge of the box, or running up a post and helping itself to everything eatable that came in its way. There could not be a greater contrast, and the baby Mias [orangutan] looked more baby-like by the comparison.

(Wallace letters collection via Metafilter. Baby orang photo by Flickr user Tony Hisgett.)

Working Together in R

Noam Ross has a great series of tips for doing collaborative research in R. Some things I learned:

  • dput:

    Running dput creates text that can be entered into R make an identical structure […] If your dataset is large, simply use dput(head(mtcars)) to share only the first few rows.”

  • Gists:

    Gist is a simple way to share snippets and pastes with others. All gists are git repositories, so they are automatically versioned, forkable and usable as a git repository.”

  • Developing R packages:

    “Hadley Wickham has written a great guide to developing R packages, which can be found here.”

  • knitr:

    knitr is bundled with Rstudio. (So are Git and package creation tools based on devtools.)

Definitely check out the rest if you ever share R code!

(Via Revolutions.)