#! /usr/bin/perl use strict; ##This program concatenates the output files together and creates an option file for scoring. print "Enter the base name of the output files: "; my $outFile = ; chomp ($outFile); print "Enter the number of nodes used: "; my $nodes = ; chomp ($nodes); print "Enter the csfasta file name: "; my $inputFile1 = ; chomp ($inputFile1); if (not (-e "$inputFile1")) { print "File does not exist. Exiting program\n"; exit; } print "Enter the reference genome file name: "; my $ref = ; chomp ($ref); print "Enter the RAM available: "; my $reads = ; chomp ($reads); print "Combining binary files...\n"; if (-e ($outFile."1".".best")) { cat ($outFile, ".best"); } print "Combining text files...\n"; if (-e ($outFile."1".".best.txt")) { cat ($outFile, ".best.txt"); } open (INPUT, ">scoring.pref"); print INPUT "$ref\n"; print INPUT "$inputFile1\n"; print INPUT "Qual.qual\n"; print INPUT "$outFile\n"; print INPUT "0\n"; print INPUT "$reads\n"; print INPUT "0\n"; print INPUT "false\n"; print INPUT "true\n"; print INPUT "-1\n"; print "To score, run: [socs] scoring.pref --score\n"; sub cat { my $outFile = shift; my $ext = shift; my $out = $outFile.$ext; open (OUT, ">$out"); my $i; my $file; my $line; for ($i = 1; $i <= $nodes; $i++) { $file = $outFile.$i.$ext; print $file, "\n"; if (-e "$file") { open (INPUT, "$file"); while (defined ($line = )) { print OUT $line; } print OUT "\n"; close INPUT; } else { print "File $file does not exist\n"; } } close OUT; }