3.Bash and Github
How to set up multiple jobs as a pipeline
1) Github
(1) Desktop Version for Mac or Windows
I downloaded the desktop version of github on mac.
(2) Terminal Version for Linux or Mac
Setup:
1) add a setting file:
~/.gitconfig:
2) Copy your ssh key to github website (set up ssh key) 3) Add a repository in github website
Clone a repository:
git clone git@github.com:lulab/RNAfinder_Server.git
Add:
Change:
Remove:
Pull (update):
Case study: how to use google to solve question
Q1: How to install terminal version of git in mac?
A1: google "install git _on _mac" --> I got the answer
Q2: After I installed git, I got such error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun"
A2: google this whole sentence --> I got the answer
2) Bash Examples
Example I
install software and tools in a brand-new OS
(1) 安装vim
(2) 打开一个空shell文件
(3) 复制如下shell脚本到smyinstall.sh内。此shell文件会自动安装包括:R-2.15.3,perl-5.26.1等
(4) 执行shell脚本
Example II
backup files using rsync and crontab
(0) install rsync and crontab
(1) Prepare a backup script, for example, "~/backup.sh"
(2) Using "crontab" command to execute the backup script routinely, and record in a log file, for example,
execute the command "~/backup.sh > ~/backup.log" in 5:10am everyday:
3) Tips
awk
input STANDIN in your script
grep non ATGC nucleotides in fasta file
A tee in your pipe
Exit Status
Name dir with today's date
4)More Readings and Practices
Teaching Video:Week II. 3. Bash
for Beginners
阅读和练习《鸟哥的Linux私房菜-基础学习篇》如下章节:
第11章 认识与学习bash 第12章 正则表达式与文件格式化处理 第13章 学习shell script
for Advanced Readers
Additional Tutorial: Bash
<<Bioinformatics Data Skills>>
5) Git for Scientists
6) Bioinformatics Data
12) Bioinformatics Shell Scripting, Writing Pipelines, and Parallelizing Tasks
5)Homework
利用google等工具找到如何让awk读输入文件时只按照tab来做separator?
学习和完成这里面的作业:Additional Tutorial : Bash (Teaching Video:Week II. Bash and R -- Shared by Li)
6) Video
6a) Bash and Github
Last updated