2010年6月1日 星期二

Parse some DTP data

#! /usr/bin/perl
open (Input, "$data") || die "$!\n";

while(my $line = )
{
$line =~ s/[\r\n]//g;
if($line =~ /\"/){
$line=~ /(\".*\")/;
$tmpvalue= $1;
$tmpvalue=~ s/\,/\;/g;
$line=~ s /(\".*\")/$value/;
}

my @temp = split (/\,/, $line);
$tmpIDKey = $temp[0]."+".$temp[4];
push @IDKey,$tmpIDKey;
$tmpcellKey = $temp[7].":".$temp[8];
push @cellKey,$tmpcellKey;
$HashNSC{$tmpIDKey}{$tmpcellKey}=$temp[14];
}

# 取唯一Key值
%tmphash =();
my @one_IDKey =();
@one_IDKey = ( map{$tmphash{$_} = 1; ();}@IDKey or keys %tmphash);

# Open NCI60 cell lines reference
# if(exists) or not
# Write output file