makefile流程搭建学习——一个生信小流程搭建Fasta_stat

makefile流程搭建学习——一个生信小流程搭建Fasta_stat

建议有些Makefile文件编辑,python和perl知识,方便后面理解
这里可能和我前面设计的Fasta_stat的目录有点出入,但是基本功能实现,其他的就先这样吧。

1. Fasta_stat

确定目标
输入文件:test.fa。完成三个目标:cutadapt(去除adapt序列),gc.py(统计GC含量),length.pl(统计序列长度)
输出文件:test_clean.fa,gc和length文件
设计目录
请添加图片描述

这里提到的cutadapt安装和基本使用,gc,py,stat.pl,run.ini,Fasta_stat_run.py以及测试数据及结果,下面都有举例,大家可以预览,然后自行完成,若需要源代码请私信我奥~

2. 安装cutadapt,并测试,可以正确运行

请添加图片描述
** 对test.fa进行adapt去除,得到test_clean.fa **
请添加图片描述
** 这里我是想直接在shell脚本中进行conda虚拟环境cutadapt的激活和使用**

3. 准备gc.py和stat.pl,并测试,可以正确运行

请添加图片描述
现在,已经将三个任务都完成了,现在就可以完成Makefile的撰写

4. 撰写run.ini文件,Makefile配置文件

请添加图片描述

5. 撰写Fasta_stat_run.py,自动化生成Makefile文件和run.sh

#执行Fasta_stat_run.py
/usr/bin/python3 /home/zhaohuiyao/test/makefile/Fasta_stat/Fasta_stat_run.py -i /home/zhaohuiyao/test/makefile/Fasta_stat/test/test.fa -o /home/zhaohuiyao/test/makefile/Fasta_stat/test -ca '-g AGATCGGAAGAGCACACGTCTGAACTCCAGTCA'
#输入:fasta文件绝对路径,输出目录全路径,以及cutadapt的参数
#输出:在输出目录下生成新的目录/home/zhaohuiyao/test/makefile/Fasta_stat/test/Fasta_stat_test/,并在该目录下生成两个文件Makefile和run.sh
#执行/bin/bash run.sh或者nohup /bin/bash ./run.sh 2>&1 &
#你也会在/home/zhaohuiyao/test/makefile/Fasta_stat/db/目录下发现test.txt的生成,包括一些信息

请添加图片描述
请添加图片描述

zhaohuiyao@lenovo-ThinkStation-P920:~/test/makefile/Fasta_stat/db$ cat ./test.txt
This is cutadapt 1.18 with Python 3.7.13
Command line parameters: -g AGATCGGAAGAGCACACGTCTGAACTCCAGTCA /home/zhaohuiyao/test/makefile/Fasta_stat/test/test.fa -o /home/zhaohuiyao/test/makefile/Fasta_stat/test/Fasta_stat_test/test_clean.fa
Processing reads on 1 core in single-end mode ...
Finished in 0.00 s (332 us/read; 0.18 M reads/minute).

=== Summary ===

Total reads processed:                       4
Reads with adapters:                         3 (75.0%)
Reads written (passing filters):             4 (100.0%)

Total basepairs processed:           600 bp
Total written (filtered):            501 bp (83.5%)

=== Adapter 1 ===

Sequence: AGATCGGAAGAGCACACGTCTGAACTCCAGTCA; Type: regular 5'; Length: 33; Trimmed: 3 times.

No. of allowed errors:
0-9 bp: 0; 10-19 bp: 1; 20-29 bp: 2; 30-33 bp: 3

Overview of removed sequences
length	count	expect	max.err	error counts
27	1	0.0	2	1
33	1	0.0	3	1
39	1	0.0	3	1

fasta file:  /home/zhaohuiyao/test/makefile/Fasta_stat/test/Fasta_stat_test/test_clean.fa
2022-05-05 21:24:39 - gc.py - INFO - /home/zhaohuiyao/test/makefile/Fasta_stat/test/Fasta_stat_test/test_clean.fa is exists
GC_content  0.3313373253493014
Total_read:	4
Total_length:	501
end on 2022年 05月 05日 星期四 21:24:39 CST

以上就是该Fasta_stat的自动化流程的一个小项目,但是主要是学会用Makefile写流程,后面就是对生成不同项目的Makefile,是填充式的,若有问题或代码,请私信我。

以后我会再接再厉,和大家共同进步。加油!!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值