transposonmapper.exporting

transposonmapper.exporting

transposonmapper.exporting.save_as_bed(file, tncoordinates_array, ref_tid, readnumb_array)[source]

This function writes in a .bed file located in the same folder as the bamfile, the information abot how many transposons were found in each genomic location.

Parameters
  • file (str) – Path with the filename extension included(e.g “data_file/bedfile_name.bed”) describing where do you want to store the results. By default it will be stored in the same location as the bamfile, with the same basename. Example, if the bamfile path is data_file/data_1.bam then the bed file will be data_file/data_1.bam.bed

  • tncoordinates_array (numpy array) – Second Output from the get_reads.py function : _,tncoordinates_array,_=get_reads(bam)

  • ref_tid (dict) – Output from the get_chromosome_names function : ref_tid = get_chromosome_names(bam)

  • readnumb_array (numpy array) – 1st Output from the get_reads.py function : readnumb_array,_,_=get_reads(bam)

transposonmapper.exporting.save_as_wig(wigfile, tncoordinates_array, ref_tid, readnumb_array)[source]

This function writes in a .wig file located in the same folder as the bamfile, the information abot how many transposons were found in each genomic location.

Parameters
  • wigfile (str) – Path with the filename extension included(e.g “data_file/wigfile_name.wig”) describing where do you want to store the results. By default it will be stored in the same location as the bamfile, with the same basename. Example, if the bamfile path is data_file/data_1.bam then the wig file will be data_file/data_1.bam.wig

  • tncoordinates_array (numpy array) – Second Output from the get_reads.py function : _,tncoordinates_array,_=get_reads(bam)

  • ref_tid (dict) – Output from the get_chromosome_names function : ref_tid = get_chromosome_names(bam)

  • readnumb_array (numpy array) – 1st Output from the get_reads.py function : readnumb_array,_,_=get_reads(bam)

transposonmapper.exporting.save_per_essential_insertions(filename, tn_coordinates, gene_coordinates, chr_lengths_cumsum, ref_tid_roman, aliases_designation)[source]

This function generates a .txt file with the insertions in the annotated essential genes in WT.

Parameters
  • filename (str) – Path with the filename extension included(e.g “data_file/file.txt”) describing where do you want to store the results. By default it will be stored in the same location as the bamfile, with the same basename. Example, if the bamfile path is data_file/data_1.bam then the file will be data_file/data_1.bam_peressential_insertions.txt

  • tn_coordinates (dict) – Last output of the function get_insertions _,_, tn_coordinates_per_gene = get_insertions_and_reads( gene_coordinates, tncoordinatescopy_array, readnumb_array)

  • gene_coordinates (dict) – Output of the function add_chromosome_length: gene_coordinates = add_chromosome_length( gene_coordinates, chr_lengths_cumsum, ref_tid_roman)

  • chr_lengths_cumsum (dict) – last output of the function get_sequence_length : _, chr_lengths_cumsum = get_sequence_length(bam)

  • ref_tid_roman (dict) – Dictionary describing roman names as keys , ref_romannums = chromosomename_roman_to_arabic()[1] ref_tid_roman = {key: value for key, value in zip(ref_romannums, ref_tid)}

  • aliases_designation (dict) – Last output of the function read_genes _, _, aliases_designation = read_genes( gff_file, essential_file, gene_name_file)

transposonmapper.exporting.save_per_gene(filename, tn_per_gene, reads_per_gene, aliases_designation)[source]

Create text file with transposons and reads per gene

NOTE THAT THE TRANSPOSON WITH THE HIGHEST READ COUNT IS IGNORED. E.G. IF THIS FILE IS COMPARED WITH THE _PERGENE_INSERTIONS.TXT FILE THE READS DON’T ADD UP (SEE https://groups.google.com/forum/#!category-topic/satayusers/bioinformatics/uaTpKsmgU6Q) TOO REMOVE THIS HACK, CHANGE THE INITIALIZATION OF THE VARIABLE readpergene

Parameters
  • filename (str) – Path with the filename extension included(e.g “data_file/file.txt”) describing where do you want to store the results. By default it will be stored in the same location as the bamfile, with the same basename. Example, if the bamfile path is data_file/data_1.bam then the file will be data_file/data_1.bam_pergene.txt

  • tn_per_gene (int) – The number of transposons found per gene

  • reads_per_gene (int) – The number of reads found per gene

  • aliases_designation (dict) – Last output of the function read_genes _, _, aliases_designation = read_genes( gff_file, essential_file, gene_name_file)

transposonmapper.exporting.save_per_gene_insertions(filename, tn_coordinates, gene_coordinates, chr_lengths_cumsum, ref_tid_roman, aliases_designation)[source]

This function write in txt file 5 columns of information about transposon insertions separated by tabs. The tabs are: Gene name,Chromosome,Start location,End location,Insertion locations,Reads per insertion location

Parameters
  • filename (str) – Path with the filename extension included(e.g “data_file/file.txt”) describing where do you want to store the results. By default it will be stored in the same location as the bamfile, with the same basename. Example, if the bamfile path is data_file/data_1.bam then the per_gene file will be data_file/data_1.bam_pergene_insertions.txt

  • tn_coordinates (dict) – Last output of the function get_insertions _,_, tn_coordinates_per_gene = get_insertions_and_reads( gene_coordinates, tncoordinatescopy_array, readnumb_array)

  • gene_coordinates (dict) – Output of the function add_chromosome_length: gene_coordinates = add_chromosome_length( gene_coordinates, chr_lengths_cumsum, ref_tid_roman)

  • chr_lengths_cumsum (dict) – last output of the function get_sequence_length : _, chr_lengths_cumsum = get_sequence_length(bam)

  • ref_tid_roman (dict) – Dictionary describing roman names as keys , ref_romannums = chromosomename_roman_to_arabic()[1] ref_tid_roman = {key: value for key, value in zip(ref_romannums, ref_tid)}

  • aliases_designation (dict) – Last output of the function read_genes _, _, aliases_designation = read_genes( gff_file, essential_file, gene_name_file)