oligo.tools.Tools

class oligo.tools.Tools(genome, fa, config_path, blat=False)[source]
Parameters:
genome{‘mm9’, ‘mm10’, ‘hg18’, ‘hg19’, ‘hg38’}

Genome build

fastr

Path to reference genome fasta

Attributes:
blatbool

Check off-target binding using BLAT instead of STAR (not recommended for large designs), default = False

fastastr

Name of fasta file for oligo sequences, default = oligo_seqs.fa

oligo_seqsdict

Contains all oligo sequences after generating oligos

Methods

align_to_genome([s_idx])

Aligns oligos to the genome using BLAT or STAR

calculate_density([sam, blat_file])

Calculates the repeat scores and off-target binding for each oligo based on their scores from RepeatMasker and STAR/BLAT.

detect_repeats()

Detects repeat sequences in oligos, using RepeatMasker

extract_repeats()

Extracts information of repeat content from RepeatMasker output file for every oligo

write_fasta()

Writes oligo_seqs attribute to fasta file

write_oligo_info()

Writes oligo stats to oligo_info.txt

align_to_genome(s_idx='')[source]

Aligns oligos to the genome using BLAT or STAR

Parameters:
s_idxstr

Path to the directory containing the STAR index for this genome (not required if blat=True)

Raises:
AttributeError

If blat = False but s_idx is not specified

FileNotFoundError

If a fasta file with the name specified by the fasta attribute is not found

calculate_density(sam='oligos_Aligned.out.sam', blat_file='blat_out.psl')[source]

Calculates the repeat scores and off-target binding for each oligo based on their scores from RepeatMasker and STAR/BLAT. Outputs results to oligo_info.txt.

Parameters:
samstr

Path to STAR alignment (.sam) file from align_to_genome (not required if `blat`=True), default = oligos_Aligned.out.sam

blat_filestr

Path to BLAT alignment (.psl) file from align_to_genome (not required if `blat`=False), default = blat_out.psl

detect_repeats()[source]

Detects repeat sequences in oligos, using RepeatMasker

extract_repeats()[source]

Extracts information of repeat content from RepeatMasker output file for every oligo

write_fasta()[source]

Writes oligo_seqs attribute to fasta file

write_oligo_info()[source]

Writes oligo stats to oligo_info.txt

Private methods

Tools._create_attr(oligo)[source]

Creates oligo, oligo_seqs and _assoc attributes

Tools._get_gc(x)[source]

Calculates GC percentage of a DNA sequence

Tools._populate_oligo_stats()[source]

Populates _oligo_stats attribute with default values

Tools._run_command(options, cmd, msg)[source]

Runs a command using subprocess

Tools._sort_file()[source]

Sorts oligo output file