JoshuaTree2.py
def pairwise_circos(fasta_1, fasta_2, gff_1, gff_2, link_file, chrom_file1, chrom_file2, gene_info, loci_threshold, n_chromosomes, work_dir, variable_thickness, thickness_factor, bundle_links, link_gap, switch_lines, no_output_circos):
    """Run pairwise circos in local directory."""
    work_dir += '/'
    genome1 = Genome(fasta_file=fasta_1, bed_file=work_dir+gff_1.split('.')[-2]+'.bed', protID=gff_1.split('.')[-2], gff_file=gff_1, gene_info=gene_info)
    genome1.export_karyotype(work_dir+fasta_1[:fasta_1.rfind('.')]+'.karyotype.txt',n_chromosomes, chrom_file=chrom_file1)
    genome2 = Genome(fasta_file=fasta_2, bed_file=work_dir+gff_2.split('.')[-2]+'.bed', protID=gff_2.split('.')[-2], gff_file=gff_2, gene_info=gene_info)
    genome2.export_karyotype(work_dir+fasta_2[:fasta_2.rfind('.')]+'.karyotype.txt',n_chromosomes, chrom_file=chrom_file2)
    if not link_file:
        genome1.extract_CDS()
        genome2.extract_CDS()
    pairwise_synteny = PairwiseSynteny(genome1,genome2,link_file,loci_threshold=loci_threshold)
    pairwise_synteny.generate_synteny_structure('./')
    pairwise_synteny.synteny_structure_2_link(work_dir+'/%s.%s.link.txt'%(pairwise_synteny.q_genome.protID,pairwise_synteny.s_genome.protID), bundle_links = bundle_links, link_gap = link_gap)
    if not no_output_circos:
        circos_obj = Circos(pairwise_synteny)
        circos_obj.generate_config(ticks = work_dir+'./txticks.conf', ideogram = work_dir+'/txideogram.conf', links_and_rules = work_dir+'/linksAndrules.conf', config=work_dir+'/circos.conf', variable_thickness=variable_thickness, thickness_factor=thickness_factor, switch_lines=switch_lines)
        circos_obj.run_circos(work_dir)
Run pairwise circos in local directory.
Run pairwise circos in local directory.
Run pairwise circos in local directory .
def pairwise_circos(fasta_1, fasta_2, gff_1, gff_2, link_file, chrom_file1, chrom_file2, gene_info, loci_threshold, n_chromosomes, work_dir, variable_thickness, thickness_factor, bundle_links, link_gap, switch_lines, no_output_circos):
    work_dir += '/'
    genome1 = Genome(fasta_file=fasta_1, bed_file=work_dir+gff_1.split('.')[-2]+'.bed', protID=gff_1.split('.')[-2], gff_file=gff_1, gene_info=gene_info)
    genome1.export_karyotype(work_dir+fasta_1[:fasta_1.rfind('.')]+'.karyotype.txt',n_chromosomes, chrom_file=chrom_file1)
    genome2 = Genome(fasta_file=fasta_2, bed_file=work_dir+gff_2.split('.')[-2]+'.bed', protID=gff_2.split('.')[-2], gff_file=gff_2, gene_info=gene_info)
    genome2.export_karyotype(work_dir+fasta_2[:fasta_2.rfind('.')]+'.karyotype.txt',n_chromosomes, chrom_file=chrom_file2)
    if not link_file:
        genome1.extract_CDS()
        genome2.extract_CDS()
    pairwise_synteny = PairwiseSynteny(genome1,genome2,link_file,loci_threshold=loci_threshold)
    pairwise_synteny.generate_synteny_structure('./')
    pairwise_synteny.synteny_structure_2_link(work_dir+'/%s.%s.link.txt'%(pairwise_synteny.q_genome.protID,pairwise_synteny.s_genome.protID), bundle_links = bundle_links, link_gap = link_gap)
    if not no_output_circos:
        circos_obj = Circos(pairwise_synteny)
        circos_obj.generate_config(ticks = work_dir+'./txticks.conf', ideogram = work_dir+'/txideogram.conf', links_and_rules = work_dir+'/linksAndrules.conf', config=work_dir+'/circos.conf', variable_thickness=variable_thickness, thickness_factor=thickness_factor, switch_lines=switch_lines)
        circos_obj.run_circos(work_dir)
def pairwise_circos ( fasta_1 , fasta_2 , gff_1 , gff_2 , link_file , chrom_file1 , chrom_file2 , gene_info , loci_threshold , n_chromosomes , work_dir , variable_thickness , thickness_factor , bundle_links , link_gap , switch_lines , no_output_circos ) : work_dir += '/' genome1 = Genome ( fasta_file = fasta_1 , bed_file = work_dir + gff_1 . split ( '.' ) [ - 2 ] + '.bed' , protID = gff_1 . split ( '.' ) [ - 2 ] , gff_file = gff_1 , gene_info = gene_info ) genome1 . export_karyotype ( work_dir + fasta_1 [ : fasta_1 . rfind ( '.' ) ] + '.karyotype.txt' , n_chromosomes , chrom_file = chrom_file1 ) genome2 = Genome ( fasta_file = fasta_2 , bed_file = work_dir + gff_2 . split ( '.' ) [ - 2 ] + '.bed' , protID = gff_2 . split ( '.' ) [ - 2 ] , gff_file = gff_2 , gene_info = gene_info ) genome2 . export_karyotype ( work_dir + fasta_2 [ : fasta_2 . rfind ( '.' ) ] + '.karyotype.txt' , n_chromosomes , chrom_file = chrom_file2 ) if not link_file : genome1 . extract_CDS ( ) genome2 . extract_CDS ( ) pairwise_synteny = PairwiseSynteny ( genome1 , genome2 , link_file , loci_threshold = loci_threshold ) pairwise_synteny . generate_synteny_structure ( './' ) pairwise_synteny . synteny_structure_2_link ( work_dir + '/%s.%s.link.txt' % ( pairwise_synteny . q_genome . protID , pairwise_synteny . s_genome . protID ) , bundle_links = bundle_links , link_gap = link_gap ) if not no_output_circos : circos_obj = Circos ( pairwise_synteny ) circos_obj . generate_config ( ticks = work_dir + './txticks.conf' , ideogram = work_dir + '/txideogram.conf' , links_and_rules = work_dir + '/linksAndrules.conf' , config = work_dir + '/circos.conf' , variable_thickness = variable_thickness , thickness_factor = thickness_factor , switch_lines = switch_lines ) circos_obj . run_circos ( work_dir )
Run pairwise circos in local directory.
Run pairwise circos in local directory .
"""Run pairwise circos in local directory."""
fasta_1
fasta_2
gff_1
gff_2
link_file
chrom_file1
chrom_file2
gene_info
loci_threshold
n_chromosomes
work_dir
variable_thickness
thickness_factor
bundle_links
link_gap
switch_lines
no_output_circos