用perl提取字符串子集的代码:给定某一序列物理位置,寻找其上下游的序列。
供大家学习参考。
#!/usr/bin/perl
use warnings;
use strict;
my @file1;
my $x,;
open(INFILE1, "E:/chr1.txt");
open(INFILE2, "E:/SNP_position.txt");
open OUT1,'+>E:/60_10000_seq.txt';
chomp(my @contents = <INFILE1>);
my $all_text = join('', @contents);
foreach $x(<INFILE2>){
chomp $x;