查看两个table表之间基因共有ID,各自特有ID,如果共有分别输出各自共有的结果和合并的共有结果,数据1.DEG.xls,2.DEG.xls
查找pep.faa文件和1.DEG.xls第一列共有的编号,分别输出共有,特有的结果
3.1. DEG.xls第一列基因编号加上功能描述, 没有功能的用 - 替代; 基因功能文件:all.gene.func.txt
4.找出snp.anno.xls文件内targetScanS ,esp6500si_all , GnomAD_EAS_AF, CADD表头分别位于第几列,并输出
5去除snp.anno.xls文件内Ori_REF,Ori_ALT, shared_hom, shared_het, OMIM这些列
引用 皆我百晓生 小程序回复内容作答:
脚本1的修改如下:
use strict;
use warnings;
my $data_path = "/mnt/sdb/share/bin/linux-demo/program/table";
my $script = "/mnt/sdb/share/bin/find_identical.pl";
my $output_dir = "/mnt/sdb/share/bin/linux-demo/program/output";
# 1. 查找两个表之间基因共有ID和各自特有ID
my $table1 = "1.DEG.xls";
my $table2 = "2.DEG.xls";
system("perl $script -i1 $data_path/$table1 -i2 $data_path/$table2 -o1 $output_dir/$table1.common.txt -o2 $output_dir/$table2.common.txt -om $output_dir/merged.common.txt");
# 2. 查找共有编号,输出共有和特有的结果
my $pep_faa_file = "pep.faa";
my $deg_file = "1.DEG.xls";
system("perl $script -i1 $data_path/$pep_faa_file -i2 $data_path/$deg_file -o1 $output_dir/pep_faa_common.txt -o2 $output_dir/pep_faa_unique.txt");
# 3. DEG.xls第一列基因编号加上功能描述
my $gene_func_file = "all.gene.func.txt";
my $deg_col1_file = "1.DEG_col1_func.txt";
system("perl $script -i1 $data_path/$deg_file -i2 $data_path/$gene_func_file -o1 $output_dir/$deg_col1_file -add_func");
# 4. 查找表头对应的列号
my $snp_anno_file = "snp.anno.xls";
my $snp_anno_col_file = "snp_anno_col.txt";
system("perl $script -i1 $data_path/$snp_anno_file -o1 $output_dir/$snp_anno_col_file -header_cols targetScanS,esp6500si_all,GnomAD_EAS_AF,CADD");
# 5. 去除指定列
my $snp_anno_clean_file = "snp_anno_clean.xls";
system("perl $script -i1 $data_path/$snp_anno_file -o1 $output_dir/$snp_anno_clean_file -remove_cols Ori_REF,Ori_ALT,shared_hom,shared_het,OMIM");
上述脚本根据要求修改了参数和输出文件路径,每个任务都使用了system
函数调用了find_identical.pl
脚本,并传递了相应的参数。
请注意,以上执行的命令仅供参考,具体使用时请根据实际情况进行调整。