my $cmd1 = "java -Xmx2G -jar $rootdir/celConverter/CelFileConverter.jar -m $rootdir/celConverter/Snp6FeatureMappings.csv -c $rootdir/cdf/GenomeWideSNP_6.fromDB.cdf -s $celdir/ -t $rootdir/outdir/raw"; system($cmd1); my $dir = "$rootdir/outdir/output2/$sample" . "_feature.TXT"; opendir(DIR, "$rootdir/outdir/raw") || "Cannot open the directory $!\n"; foreach my $file (readdir(DIR)){ if($file =~ /feature_intensity$/){ #my $cmd = "sh run_preprocessing.sh $rootdir/Matlab_Compilet_Runtime/v710/ $file $rootdir/info/ $rootdir/outdir/raw/ $rootdir/outdir/output/ $rootdir/outdir/ PRIMARY 0.5"; #warn "Running $cmd... \n"; #system($cmd); #outputs ploidy_3456_feature.TXT.csv #output from the previous system cmd. $file2 = "ploidy_" . $sample . "_feature.TXT.csv"; open FILE, "<", $dir/$file2" or "Cannot open the file $file2 $!\n"; while(){ chomp; my ($in_pi,$in_ploidy,$in_alpha) = split(/,/); my $cmd2 = "sh run_HMM.sh $rootdir/Matlab_Compilet_Runtime/v710/ $file $rootdir/info/ $rootdir/outdir/output/ $rootdir/outdir/ 10 $in_pi $in_ploidy $in_alpha"; warn "Running $cmd2\n"; system($cmd2); } close FILE; } }