1, snakemake介紹Snakemake是用Python3寫的一個流程化工具, 非常方便. 官網(wǎng)上的例子有點難度, 這里用最簡單的案例解釋一下snakemake的應用方法. easy_install3 snakemake 或者: pip3 install snakemake 也可以從源文件安裝: git clone https:///snakemake/snakemake.git 2, 一個簡單的案例思路:
echo "hello number1" >1.txt 3, 生成snakemake腳本生成一個名為:Snakemake的文件 (base) [dengfei@localhost example]$ cat Snakefile 這里有四個參數(shù):
4, snakemake -np使用-np查看轉化后的命令 (base) [dengfei@localhost example]$ snakemake -np 5, 執(zhí)行命令 snakemakesnakemake默認執(zhí)行的文件名是: Snakemake, 如果想要指定自己編寫的文件名, 可以加上參數(shù): —snakefile snakemake --snakefile a.snake 如果文件名是默認的Snakemake, 不用加參數(shù), 直接運行snakemake即可直接執(zhí)行. (base) [dengfei@localhost example]$ snakemake 查看結果: (base) [dengfei@localhost example]$ cat hebing.txt 可以看到, 使用snakemake, 成功的將1.txt 和2.txt 合并為hebing.txt. 6, 運行成功, 重新運行時顯示Nothing to be done, 即不會執(zhí)行. (base) [dengfei@localhost example]$ snakemake 如果heibng.txt文件被刪掉了, 再執(zhí)行, 就會重新執(zhí)行. 這是一小步, 也是一大步. |
|
來自: 育種數(shù)據(jù)分析 > 《待分類》