#!/usr/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
use File::Basename;
use JSON;
my $usage=<
Usage:
perl dz_merge.pl /PATH/TO/meta.json /path/to/cartfile /path/to/filename
USAGE
if(@ARGV==0){die $usage};
my $file1=$ARGV[0];
my $file2=$ARGV[1];
my $file3=$ARGV[2];
my $js;
open(RF,$file1) || die "wrong json doc";
while (my $line=){
$js .= "$line";
}
close(RF);
my $json=decode_json($js);
my %hash;
my %gene_exp;
if (-e ($file2."/dz_result.txt")){
unlink ($file2."/dz_result.txt");
}
my @cat_file=glob($file2."/*.txt");
#print @cat_file;
for my $doc (0..$#cat_file){
my $bas