#!/usr/bin/python

import map

@@ -15,16 +15,1268 @@
 hon%0A
-%0Aimport map
+import os%0Aimport shutil%0A%0Afrom map import mapfunctions%0Aimport common%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0Adef runAll(args):%0A%09%0A%09print('%5Cn%5Cn%5CnYou have requested to map fastq files')%0A%09print('%5CtWARNING:')%0A%09print('%5Ct%5CtIF USING ANY REFERENCES OTHER THAN THOSE I PROVIDE I CANNOT GUARANTEE RESULT ACCURACY')%0A%09print('%5Cn')%0A%0A%09%0A%09%0A%09#set up environment#%0A%09args.FastqDirectory = common.fixDirName(args.FastqDirectory)%0A%09%0A%09if not args.output:%0A%09%09samDir = os.path.dirname(args.FastqDirectory) + '/' + Sam + '/'%0A%09else:%0A%09%09samDir = common.fixDirName(args.output)%0A%09%0A%09tempDir = args.FastqDirectory + 'Temp/'%0A%09statsDir = args.FastqDirectory + 'MapStats/'%0A%09for i in %5BsamDir, tempDir, statsDir%5D:%0A%09%09common.makeDir(i)%0A%0A%09%09%0A%0A%09if not args.samples:%0A%09%09fastqFiles = %5B x for x in os.listdir(args.FastqDirectory) if 'fastq' in x.split('.')%5B-2:%5D %5D%0A%09else:%0A%09%09fastqFiles = common.importSampleList(args.samples)%09%09%0A%09fastqFiles = %5Bargs.FastqDirectory + x for x in fastqFiles%5D%09%0A%09%0A%09%0A%09%0A  %0A%0A%09#run multiprocessing of all mapping commands#%0A%09argList = %5B(x, args.species, args.trim, statsDir, tempDir, samDir) for x in fastqFiles%5D%0A%09%09%0A%09common.daemon(mapfunctions.runOne, argList, 'map fastq files', cpuPerProcess=8)%0A%0A%09%0A%0A%09%0A%09%0A%09#remove all temporary files#%0A%09shutil.rmtree(tempDir%5B:-1%5D)%0A  %0A  %0A%09%0A  %09print('Mapping complete%5Cn%5Cn%5Cn')%0A%0A%09%0A%09%0A%09%0A%09%0A%09%0A%09%0A%09%0A%09%0A%09
 %0A

Update runmap.py