a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by lm
lm  ·  2385 days ago  ·  link  ·    ·  parent  ·  post: Pubski: October 4, 2017

I gave a talk on Bash yesterday; you can see the slides if you're interested.

Figured out that it'll take 3-4 weeks to print my lab book, which effectively means it needs to be ready to print by the last week of November, so that's where my Thanksgiving break is going to go...





Devac  ·  2385 days ago  ·  link  ·  
This comment has been deleted.
lm  ·  2385 days ago  ·  link  ·  

I wish I had speaker notes or something from the talk because I hit 1 and 3 in person (and showed off ^r history search too). I didn't know about #2, though! And I'll add that scripting guide to the book as well.

Cumol  ·  2384 days ago  ·  link  ·  

I was just trying to figure out how to write a for loop in bash a few minutes ago. I feel like this stuff should be standard curriculum for ANYONE studying science!

lm  ·  2384 days ago  ·  link  ·  

You should most definitely check out https://software-carpentry.org/lessons/ -- it's targeted at non-CS people doing data science and is quite well written.

Also, to toot my own horn, I have written a course on this sort of stuff: http://web.mst.edu/~nmjxv3/cs1001/

Cumol  ·  2383 days ago  ·  link  ·  

Thank you! I will check it out :)

Devac  ·  2384 days ago  ·  link  ·  
This comment has been deleted.
lm  ·  2384 days ago  ·  link  ·  

Extra-fun fact: You can do C++ style for loops too!

  for ((i = 0; i < 10; i++)); do echo $i; done;
Cumol  ·  2384 days ago  ·  link  ·  

I had troubles figuring out something else. I have two input files and 4 output files per sequence and 115 of those. So I needed a for loop that takes the name of the sequence (blabla001_1.seq) finds the second part of the pair (blabla002_2.seq) then feeds that into a java command that gives 4 outputs using the names of the files.

I am used to writing scripts in R so I didn't know how to do that for bash. At the end I found a script that is supposed to do it, took it apart and understood how it works. 10 minutes ago I got my results :)

Devac  ·  2384 days ago  ·  link  ·  
This comment has been deleted.
Cumol  ·  2383 days ago  ·  link  ·  

You are correct, the example was wrong. They bolded numbers should be the same :)

Some things work with xargs or GNU parallel but not everything... :(

Devac  ·  2383 days ago  ·  link  ·  
This comment has been deleted.
Cumol  ·  2383 days ago  ·  link  ·  

As I am rather fresh to programming and (because of bioconductor) my first language is R, I haven't checked out anything else but Python is on my list because more and more data analysis tools are showing up for python...