Bash tutorial for biologists?
3
4
Entering edit mode
9.6 years ago
Parham ★ 1.6k

Hi,

I am wondering if any one can recommend a simple yet applicable tutorial for learning bash to be used for doing bioinformatics. The reason I am asking here is that there are so many tutorials out there and to my opinion some of them are too much and some are not targeting my needs, since many are written for developers and advanced users. So please let me know if you know good ones!

Cheers,
Parham

bash • 7.4k views
ADD COMMENT
1
Entering edit mode

Hey, here is my guide for bash, specifically aimed for biologists. The examples are all relevant and it starts at absolute beginning. If you're interested, there is a free python course on courseera (very highly rated), check that out as well (bash only has limited use, but having programming skills is invaluable).

ADD REPLY
3
Entering edit mode

"bash has limited use"? BLASPHEMY

ADD REPLY
0
Entering edit mode

The first link doesn't work.

ADD REPLY
3
Entering edit mode
9.6 years ago
Josh Herr 5.8k

As a Software Carpentry (and Data Carpentry) instructor, I would recommend the Introduction to the Shell tutorial materials in the lesson material. Once you are comfortable with those tutorials, Data Carpentry is developing Shell tutorials specifically for bioinformatics.

There are a ton of other resources out there for more specific questions... Best of luck!

ADD COMMENT
2
Entering edit mode

This looks like a very convenient way to start. Thanks for suggesting.

Thanks every one else for recommendations and all the jokes :D

ADD REPLY
0
Entering edit mode

Welcome to the world of bioinformatics, where we are all scientists enough to not trust generic statements, and geek enough to enjoy niche nuances!

ADD REPLY
0
Entering edit mode

This page is missing a > for making middle.sh . Useful though since I had to use my brain :D

ADD REPLY
0
Entering edit mode

I'm not following your comment here -- not too important, but if we have a typo I can fix it. Can you clarify just exactly what you mean in the above comment?

ADD REPLY
1
Entering edit mode

In the initial stages, where you add the first pipe to middle.sh, writing into the file has not been elaborated. Parham assumed the reader is supposed to use cat > middle.sh so you can write into the file. I'd personally go for emacs middle.sh to avoid any uncertainty.

ADD REPLY
0
Entering edit mode

Ram great job reading my thoughts, that was smart :)

ADD REPLY
0
Entering edit mode

Thank you :)

ADD REPLY
0
Entering edit mode

Sorry for not being clear enough. The folder doesn't have a middle.sh so I had to create it. Therefore I posted about it since its a tutorial for beginners they won't get confused. cat middle.sh doesn't have any output.

By the way I am using biolinux 8 which is Ubuntu basically, in case the bash works different in it!

ADD REPLY
8
Entering edit mode
9.6 years ago

Unix and Perl Primer for Biologists

Keith Bradnam & Ian Korf

http://korflab.ucdavis.edu/Unix_and_Perl/

ADD COMMENT
4
Entering edit mode
9.6 years ago
Ram 44k

EDIT: Go look at Pierre's answer.

I don't think you'll need a bash tutorial tailored to biologists. If you've worked on a Mac or a PC, try doing your everyday stuff without a mouse, on a terminal. That'll set you on the right path.

Besides coreutils (such as mkdir, cd, cp, mv, rm, ls, etc), you'll find cut, sort, uniq, tr and find really useful. And the three core text processing utilities - grep, sed and awk - will revolutionarize the way you think of a Search/Replace operation on text editors.

You'll also have to learn pipes, to get a series of tasks done, and redirection, to read from and write to files.

Learn the $(command) syntax to store the output of commands in variables. Once done, move on to loops using variables and then loops that use output from commands. In parallel, also focus on the differences between the single, double and back quotes.

But, bash has so many options that unless you use these frequently, you'll forget them. And then, like all of us, you'll run man command_name and re-learn them in a minute.

Oh, and to conclude: https://xkcd.com/1168/

ADD COMMENT
1
Entering edit mode

There truly is an XKCD comic for all occasions.

ADD REPLY
1
Entering edit mode

I was looking for an xkcd on the "all occasions" meme, but then this happened: https://xkcd.com/917/

ADD REPLY
0
Entering edit mode

about tar, I recently found out that tar -xf can extract ANY kind of tar compressed files (auto detecting the format)! My life is so much easier now!

ADD REPLY
0
Entering edit mode

Your life can even be one character simpler with tar xf :)

ADD REPLY
0
Entering edit mode

That's the new and improved tar. I like to play it safe conservative (no one's playing safe with a -f) with tar -xzvf for tgz and tar -xjvf for tbz2.

ADD REPLY
1
Entering edit mode

To this day, I cannot extract or tar/zip up a folder without putting on an Arnold accent and shouting "Xtract Zee Files!" or "Compress Zee Files!" to myself. If the files are particularly special, its 'Xtract Zee Valuable Files!'. 50% of the time it works every time.

ADD REPLY
1
Entering edit mode

That does sound hilarious! :)

ADD REPLY

Login before adding your answer.

Traffic: 3099 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6