Blat module

biscot.Blat.blat_phase(contigs_sequence_dict)[source]

Executes Blat and modifies an AGP file based on the mappings found

Parameters

contigs_sequence_dict (dict(str: str)) – Dict containing contigs FASTA sequences

biscot.Blat.get_agp_changes(contigs_sequence_dict)[source]

Gets the best blat hit and writes what changes have to be made to the AGP file to incorporate the changes

Parameters

contigs_sequence_dict (dict(str: str)) – Dict containing contigs FASTA sequences

biscot.Blat.mute_agp_file()[source]

Loads an AGP file and a changes file and modifies the AGP file lines to incorporate the changes

biscot.Blat.parse_blat()[source]

Parses the pslReps output file to get various information about the best hit

Returns

(true if hit found - False otherwise, max score, reference size, contig_1 end, contig_2 end)

Return type

tuple(bool, int, int, int)

biscot.Blat.run_blat(contig_1, contig_1_start, contig_1_end, contig_1_orientation, contig_2, contig_2_start, contig_2_end, contig_2_orientation, contigs_sequence_dict)[source]

Launches Blat, then sorts the psl file and extracts the best match

Parameters
  • contig_1 (str) – Name of the first contig

  • contig_1_start (int) – Starting position of the sequence to extract

  • contig_1_end (int) – End position of the sequence to extract

  • contig_1_orientation (str) – Strand orientation of the first contig

  • contig_2 (str) – Name of the second contig

  • contig_2_start (int) – Starting position of the sequence to extract

  • contig_2_end (int) – End position of the sequence to extract

  • contig_2_orientation (str) – Strand orientation of the second contig

  • contigs_sequence_dict (dict(str, str)) – Dict containing the contigs fasta sequence

biscot.Blat.write_new_agp(new_agp_lines)[source]

Writes a new AGP file incorporating the Blat changes

Parameters

new_agp_lines (list(list(str))) – List containing the new AGP lines