def run_faToBit(fasta, path_to_results): utils.check_existence_or_raise(fasta) twobit = os.path.join(path_to_results, utils.get_name(fasta)+'.2bit') tmp = utils.atomic_tmp_file(twobit) params = ['faToTwoBit', '-noMask', fasta, tmp] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp,twobit) return twobit
def run_faToBit(fasta, path_to_results): utils.check_existence_or_raise(fasta) twobit = os.path.join(path_to_results, utils.get_name(fasta) + '.2bit') tmp = utils.atomic_tmp_file(twobit) params = ['faToTwoBit', '-noMask', fasta, tmp] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp, twobit) return twobit
def run_blat(fasta, ncrna, results): utils.check_existence_or_raise(fasta) blat_psl = os.path.join(results, utils.get_name(fasta) + '.psl') tmp = utils.atomic_tmp_file(blat_psl) params = ['blat', "-q=rna", fasta, ncrna, tmp] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp, blat_psl) return blat_psl
def run_wigToBigWig(fasta, wig, sizes, path_to_results): utils.check_existence_or_raise(wig) bigWig=os.path.join(path_to_results, utils.get_name(fasta)+'.gc5Base'+'.bw') tmp = utils.atomic_tmp_file(bigWig) params = ['wigToBigWig', wig, sizes, tmp] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp,bigWig) return bigWig
def run_gcPercent(fasta, twobit, path_to_results): utils.check_existence_or_raise(twobit) wig=os.path.join(path_to_results, 'gc5Base.'+utils.get_name(twobit)+'.wig') tmp = utils.atomic_tmp_file(wig) params = ['hgGcPercent', '-wigOut', '-doGaps', '-win=5', '-file='+tmp, '-verbose=0', utils.get_name(fasta), path_to_results] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp,wig) return wig
def run_wigToBigWig(fasta, wig, sizes, path_to_results): utils.check_existence_or_raise(wig) bigWig = os.path.join(path_to_results, utils.get_name(fasta) + '.gc5Base' + '.bw') tmp = utils.atomic_tmp_file(bigWig) params = ['wigToBigWig', wig, sizes, tmp] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp, bigWig) return bigWig
def run(config, dir, outputhal): utils.check_existence_or_raise(config) utils.create_dir_if_not_exists(dir) command = ['runProgressiveCactus.sh', '--batchSystem', 'parasol', '--bigBatchSystem', 'singleMachine', '--defaultMemory', '8589934593', '--bigMemoryThreshold', '8589934592', '--bigMaxMemory', '893353197568', '--bigMaxCpus', '25', '--maxThreads', '25', '--parasolCommand=/cluster/home/jcarmstr/bin/parasol -host=ku', '--retryCount', '3'] params = command + [config, dir, outputhal] print params subprocess.check_call(params) return outputhal
def run_gcPercent(fasta, twobit, path_to_results): utils.check_existence_or_raise(twobit) wig = os.path.join(path_to_results, 'gc5Base.' + utils.get_name(twobit) + '.wig') tmp = utils.atomic_tmp_file(wig) params = [ 'hgGcPercent', '-wigOut', '-doGaps', '-win=5', '-file=' + tmp, '-verbose=0', utils.get_name(fasta), path_to_results ] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp, wig) return wig
def run_filtering(sorted_psl, results) : utils.check_existence_or_raise(sorted_psl) stats = os.path.join(results,'filtering_stats') utils.create_dir_if_not_exists(stats) filtered_psl = os.path.join(results,utils.get_name(sorted_psl)+'.filtered.psl') tmp = utils.atomic_tmp_file(filtered_psl) params = ['pslCDnaFilter','-localNearBest=0.1 -ignoreNs -minCover=0.6 -repsAsMatch', ' -dropped='+os.path.join(stats,'dropped.out'), '-weirdOverlapped='+os.path.join(stats,'weird_overlapped.out'), '-alignStats='+os.path.join(stats,'align_stats.out'), '-statsOut='+os.path.join(stats,'overall_stats.out'), sorted_psl, tmp] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp, filtered_psl) return filtered_psl
def run_sorting(blat_psl, results) : print 'blat_psl is' ,blat_psl utils.check_existence_or_raise(blat_psl) sorted_psl = os.path.join(results,utils.get_name(blat_psl)+'.sorted.psl') tmp = utils.atomic_tmp_file(sorted_psl) params = ['sort', '-k 10,10', blat_psl, '>', tmp] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp, sorted_psl) sorted_psl_only_entries = os.path.join(results,utils.get_name(blat_psl)+'.sorted.only_entries.psl') tmp = utils.atomic_tmp_file(sorted_psl_only_entries) subprocess.call('tail -n +5 '+ sorted_psl + '| head -n -1 > ' + tmp, shell=True) utils.atomic_install(tmp, sorted_psl_only_entries) return sorted_psl_only_entries
def run(config, dir, outputhal): utils.check_existence_or_raise(config) utils.create_dir_if_not_exists(dir) command = [ 'runProgressiveCactus.sh', '--batchSystem', 'parasol', '--bigBatchSystem', 'singleMachine', '--defaultMemory', '8589934593', '--bigMemoryThreshold', '8589934592', '--bigMaxMemory', '893353197568', '--bigMaxCpus', '25', '--maxThreads', '25', '--parasolCommand=/cluster/home/jcarmstr/bin/parasol -host=ku', '--retryCount', '3' ] params = command + [config, dir, outputhal] print params subprocess.check_call(params) return outputhal
def run_pslToBigBed(blat_psl, sizes, results): utils.check_existence_or_raise(blat_psl) blat_bed=os.path.join(results,utils.get_name(blat_psl)+'.bed') tmp = utils.atomic_tmp_file(blat_bed) params = ['pslToBed', blat_psl, tmp] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp, blat_bed) sorted_bed = os.path.join(results,utils.get_name(blat_psl)+'.sorted.bed') tmp = utils.atomic_tmp_file(sorted_bed) params = ['bedSort', blat_bed, tmp] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp, sorted_bed) bigBed = os.path.join(results,utils.get_name(blat_psl)+'.bigBed') tmp = utils.atomic_tmp_file(bigBed) params = ['bedToBigBed', sorted_bed, sizes, tmp] subprocess.call(" ".join(params), shell=True) utils.atomic_install(tmp, bigBed)