use strict
#contact perlcoder weixin
my %hash
#NBI_Gossypium_hirsutum_v1.1.fasta
#open FH,"test.fasta"
open FH,"NBI_Gossypium_hirsutum_v1.1.fasta"
#my ($key,$value)=(shift <FH>,shift <FH>)
while(<FH>)
{
if($_=~/\S+/)
{
}
else
{
next
}
chomp
my ($key)=$_=~/>(\S+)/
my $value=<FH>
chomp($value)
$hash{$key}=$value
}
#__END__
#print join "\n",values %hash
open FH,"id.txt"
my $key
while(<FH>)
{
chomp
my ($key)=$_=~/(\S+)/
print $key,"\n"
print $hash{$key},"\n"
}
public static void main(String[] args) {// TODO Auto-generated method stub
Socket socket=null
BufferedReader sockIn
PrintWriter sockOut
try{
socket=new Socket("127.0.0.1",8888)
//建立socket连接,连接本机地址,8888端口
if(socket==null){
//判断是否连接
System.out.println("socket null,connection error")
System.exit(1)
}
#!/usr/bin/perl -wuse strict
die "perl $0 <bedfilename>\n" unless(@ARGV == 1)
open IN,$ARGV[0]
while(<IN>){
chomp
my @tmp=split/[\t ]+/,$_
print "$tmp[1]\t$tmp[5]\n"
}
close IN
将上面代码保存为run.pl,假设你的蛋白质序列文件为a.txt 运行的时候,在命令行输入 perl run.pl a.txt 回车即可
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)