def main(): if len(sys.argv) < 2: bb.fun_print_help("species_query", "species_target", "path_out", "chain_files(eg: rn5ToRn6,rn6ToMm10)","[query.ns.bed]", "[query.bed]") global_para() if not os.path.exists(PATH_OUT): bb.fun_print("create out path......", "red", "black", 1) os.mkdir(PATH_OUT) dict_pi = get_pi() psl_map() dict_exon_intron = read_exon_intron() write_exon_intron_length(dict_exon_intron) dict_cover = calculate_coverage(dict_exon_intron) list_ortho = find_ortho_pi(dict_cover) dict_synteny = get_synteny(dict_pi, list_ortho) run_lastz(dict_synteny, dict_pi, dict_cover) for i in dict_pi: if i not in list_ortho and i not in dict_synteny: LIST_OUT.append([i, 0, "none", "0", "0", "0", "chrNA", 1, 1, "+"]) file_out = bb.fun_open_file("{0}/{1}_{2}.conserve.tab".format(PATH_OUT, SPECIES1, SPECIES2), "w") for i in LIST_OUT: file_out.write(i[0]) for j in range(1, len(i)): file_out.write("\t" + str(i[j])) file_out.write("\n") file_out.close() os.system("rm {0}/temp*".format(PATH_OUT))
def main(): if len(sys.argv) < 2: bb.fun_print_help("in.fastq", "out.fastq") global RECODE RECODE = { "0": { "A": "A", "C": "C", "G": "G", "T": "T" }, "1": { "A": "C", "C": "A", "G": "T", "T": "G" }, "2": { "A": "G", "C": "T", "G": "A", "T": "C" }, "3": { "A": "T", "C": "G", "G": "C", "T": "A" } } file_solid = bb.fun_open_file(sys.argv[1]) file_illumina = bb.fun_open_file(sys.argv[2], "w") count = 0 for l in file_solid: count += 1 if count % 100000 == 0: sys.stdout.write(".") sys.stdout.flush() if l.startswith("@") or l.startswith("+"): file_illumina.write(l) elif l.startswith("!"): file_illumina.write(l[1:]) else: string_solid = l.strip() string_illumina = decode(string_solid) file_illumina.write(string_illumina + "\n") file_illumina.close()
def print_help(): if len(sys.argv) < 2: bb.fun_print_help(args)
def print_help(): if len(sys.argv) < 2: bb.fun_print_help("in.gtf", "out.bed12")
def print_help(): if len(sys.argv) < 2: bb.fun_print_help("in.bed2", "in.feature.sizes", "out.dir")
def print_help(): if len(sys.argv) < 4: bb.fun_print_help( "in.bed2", "chrom.size", "out.prefix", "factor", "CPU", "\nGenerally, bed2_to_bw.py will seperate uniqMappers and allMappers in Watson and Crick strand.\nYou can set CPU to 0 to suppress seperation." )
def print_help(): if len(sys.argv) < 2: bb.fun_print_help("in.bw", "gene.bed", "out.mat", "dataPoints")