elif not args.gtf_file: if __name__ == '__main__': p = Pool((args.ncores)) p.map(shuffle_bedtools_no_gtf, n_rand) concatFiles(args.outfile + '.datamatrix/shuffled.entry.*.bed', args.outfile + '.datamatrix/shuffled.bed') list( map(os.remove, glob.glob(args.outfile + ".datamatrix/shuffled.entry.*.bed"))) cat_command = " ".join(['cat '+args.outfile+'.datamatrix/shuffled.bed '+\ args.outfile+'.datamatrix/input_list.bed > '+\ args.outfile+'.datamatrix/genomic_ranges.bed']) p = Popen(cat_command, stdout=PIPE, shell=True) p.communicate() if args.n_rand == 0: print() print("Skipping randomized background step") cat_command = " ".join([ 'cat ' + args.outfile + '.datamatrix/input_list.bed > ' + args.outfile + '.datamatrix/genomic_ranges.bed' ]) p = Popen(cat_command, stdout=PIPE, shell=True) p.communicate() bed = BedTool(args.outfile + '.datamatrix/genomic_ranges.bed').to_dataframe().reset_index() if strd == False: