#!/bin/bash #$ -N mapping #$ -cwd #$ -V #$ -e """+outputTrashDir+""" #$ -o """+outputTrashDir+""" #$ -q long.q #$ -pe parallel_smp """+str(nbThreads)+""" #$ -t 1-"""+str(count-1)+""" #$ -tc """+str(args.nbJobValue)+""" #$ -S /bin/bash /bin/bash """+outputSHDir+"""${SGE_TASK_ID}_mapping.sh""" with open(SGENameFile, "w") as SGEFile: SGEFile.write(headerSGE) print("\n - Execution summary:") print("\n You want run MutilmappingX for %s fasta,\ The script are created all fasta-MutilmappingX.sh for all fasta into %s,\n\ For run all sub-script in qsub, %s was created.\n\ It lunch programm with job array and run %s job max:\n" %(count-1,outputSHDir,SGENameFile, args.nbJobValue)) printCol.green("\tqsub %s" % SGENameFile) print("\nStop time: ", strftime("%d-%m-%Y_%H:%M:%S", localtime())) print("#################################################################") print("# End of execution #") print("#################################################################")
else: raise IOError, 'invalid file' header = ''.join(cache) # Ouvre le header avec le parseur egglib from_header il sert à comprendre que c'est un fichier vcf vcf = egglib.io.VcfParser.from_header(header) else: # Ouvre le vcf avec le parseur egglib vcfFileOpen = egglib.io.VcfParser(str(vcfFile)) vcf = vcfFileOpen samples = [vcf.get_sample(i) for i in xrange(vcf.num_samples)] # liste des individus print 'number of samples: %s\n' % vcf.num_samples printCol.green('samples: %s' % "\t".join(samples)) if compress: if ".gz" not in outFileName: outputFile = gzip.open(outFileName+'.gz', 'wb') else: outputFile = open(outFileName,"w") txtout = 'Chromosome\tPosition\tReference\t%s\n' % "\t".join(samples) outputFile.write(txtout) dicoAlreadyFind = {} reset = 0 for line in vcfFileOpen: if extention == "gz": # Parcours des positions du vcf si compresser chrom, pos, nall = vcf.read_line(line)