一、在任意文件夹下面创建形如 1/2/3/4/5/6/7/8/9 格式的文件夹系列。
(base) ynxie 19:55:09 ~
$ mkdir lianxi
(base) ynxie 19:55:42 ~
$ cd lianxi/
(base) ynxie 19:55:46 ~/lianxi
$ mkdir -p 1/2/3/4/5/6/7/8/9
(base) ynxie 19:56:00 ~/lianxi
$ tree .
.
└── 1
└── 2
└── 3
└── 4
└── 5
└── 6
└── 7
└── 8
└── 9
9 directories, 0 files
(base) ynxie 19:56:05 ~/lianxi
$
二、在创建好的文件夹下面,比如我的是 /Users/jimmy/tmp/1/2/3/4/5/6/7/8/9 ,里面创建文本文件 me.txt
(base) ynxie 20:04:20 ~/lianxi/1/2/3/4/5/6/7/8/9
$ touch me.txt
(base) ynxie 20:04:36 ~/lianxi/1/2/3/4/5/6/7/8/9
$ ls
me.txt
############
(base) ynxie 20:05:23 ~
$ touch ~/lianxi/1/2/3/4/5/6/7/8/9 me.txt
(base) ynxie 20:05:38 ~
$ cd ~/lianxi/1/2/3/4/5/6/7/8/9
(base) ynxie 20:05:48 ~/lianxi/1/2/3/4/5/6/7/8/9
$ ls
me.txt
三、在文本文件 me.txt 里面输入内容:
(base) ynxie 20:05:50 ~/lianxi/1/2/3/4/5/6/7/8/9
$ vim me.txt
(base) ynxie 20:10:29 ~/lianxi/1/2/3/4/5/6/7/8/9
$ cat me.txt
Go to: http://www.biotrainee.com/
I love bioinfomatics.
And you ?
四、删除上面创建的文件夹 1/2/3/4/5/6/7/8/9 及文本文件 me.txt
(base) ynxie 20:15:44 ~
$ rm -r lianxi/
(base) ynxie 20:16:38 ~
$ ls
五、在任意文件夹下面创建 folder1~5这5个文件夹,然后每个文件夹下面继续创建 folder1~5这5个文件夹,效果如下:
(base) ynxie 20:16:40 ~
$ mkdir lianxi
(base) ynxie 20:49:43 ~
$ cd lianxi/
(base) ynxie 20:49:46 ~/lianxi
$ mkdir -p folder_{1..5}/folder_{1..5}
(base) ynxie 20:49:50 ~/lianxi
$ tree .
.
├── folder_1
│ ├── folder_1
│ ├── folder_2
│ ├── folder_3
│ ├── folder_4
│ └── folder_5
├── folder_2
│ ├── folder_1
│ ├── folder_2
│ ├── folder_3
│ ├── folder_4
│ └── folder_5
├── folder_3
│ ├── folder_1
│ ├── folder_2
│ ├── folder_3
│ ├── folder_4
│ └── folder_5
├── folder_4
│ ├── folder_1
│ ├── folder_2
│ ├── folder_3
│ ├── folder_4
│ └── folder_5
└── folder_5
├── folder_1
├── folder_2
├── folder_3
├── folder_4
└── folder_5
30 directories, 0 files
六、在第五题创建的每一个文件夹下面都 创建第二题文本文件 me.txt ,内容也要一样。(这个题目难度超纲,建议一个月后再回过头来做)
~
七,再次删除掉前面几个步骤建立的文件夹及文件
(base) ynxie 20:49:54 ~/lianxi
$ rm -r folder_{1..5}
八、下载 http://www.biotrainee.com/jmzeng/igv/test.bed 文件,后在里面选择含有 H3K4me3的那一行是第几行,该文件总共有几行。
(base) ynxie 20:53:52 ~/lianxi
$ wget -c http://www.biotrainee.com/jmzeng/igv/test.bed
$ nl ./test.bed | grep "H3K4me3"
九、下载 http://www.biotrainee.com/jmzeng/rmDuplicate.zip 文件,并且解压,查看里面的文件夹结构。
(base) ynxie 22:07:37 ~/lianxi
$ wget http://www.biotrainee.com/jmzeng/rmDuplicate.zip
(base) ynxie 22:10:52 ~/lianxi
$ tree .
.
├── rmDuplicate
│ ├── picard
│ │ ├── paired
│ │ │ ├── readme.txt
│ │ │ ├── tmp.header
│ │ │ ├── tmp.MarkDuplicates.log
│ │ │ ├── tmp.metrics
│ │ │ ├── tmp.rmdup.bai
│ │ │ ├── tmp.rmdup.bam
│ │ │ ├── tmp.sam
│ │ │ └── tmp.sorted.bam
│ │ └── single
│ │ ├── readme.txt
│ │ ├── tmp.header
│ │ ├── tmp.MarkDuplicates.log
│ │ ├── tmp.metrics
│ │ ├── tmp.rmdup.bai
│ │ ├── tmp.rmdup.bam
│ │ ├── tmp.sam
│ │ └── tmp.sorted.bam
│ └── samtools
│ ├── paired
│ │ ├── readme.txt
│ │ ├── tmp.header
│ │ ├── tmp.rmdup.bam
│ │ ├── tmp.rmdup.vcf.gz
│ │ ├── tmp.sam
│ │ ├── tmp.sorted.bam
│ │ └── tmp.sorted.vcf.gz
│ └── single
│ ├── readme.txt
│ ├── tmp.header
│ ├── tmp.rmdup.bam
│ ├── tmp.rmdup.vcf.gz
│ ├── tmp.sam
│ ├── tmp.sorted.bam
│ └── tmp.sorted.vcf.gz
├── rmDuplicate.zip
└── test.bed
7 directories, 32 files
十、打开第九题解压的文件,进入 rmDuplicate/samtools/single 文件夹里面,查看后缀为 .sam的文件,搞清楚 生物信息学里面的SAM/BAM 定义是什么。
(base) ynxie 22:16:05 ~/lianxi/rmDuplicate/samtools/single
$ ls -l *.bam
-rw-rw-r-- 1 ynxie ynxie 8984 Nov 12 2016 tmp.rmdup.bam
-rw-rw-r-- 1 ynxie ynxie 10295 Nov 12 2016 tmp.sorted.bam
十一、安装 samtools 软件
source activate rna
conda install -y samtools
十二、打开 后缀为BAM 的文件,找到产生该文件的命令。 提示一下命令是:
(base) ynxie 22:32:09 ~/lianxi/rmDuplicate/samtools/single
$ find . -name "*.bam"
./tmp.sorted.bam
./tmp.rmdup.bam