guido.genome

Module Contents

Classes

Genome

Functions

check_file(filename, supported_ext)

Check if file exists and has the right extension.

load_genome_from_file(guido_file)

Load a genome from a .guido file. This file is created when a genome is

guido.genome.check_file(filename, supported_ext)[source]

Check if file exists and has the right extension.

Parameters:
filenamestr

Path to the file.

supported_extstr

Supported file extensions.

Returns:
bool

True if file exists and has the right extension, False otherwise.

class guido.genome.Genome(genome_name, genome_file_abspath=None, annotation_file_abspath=None, bowtie_index_abspath=None)[source]
property is_built[source]

Check if genome index is built.

Returns:
Bool

True if genome index is built, False otherwise.

property sequence[source]
build(n_threads=1, save_pickle=True, bowtie_ignore=False, bowtie_path='')[source]

Build genome index.

This method creates index files for the genome and annotation files and saves them in a .guido file in the same directory as the genome Fasta file. This file can be later loaded using guido.genome.load_genome_from_file() without having to re-build the index.

Parameters:
n_threadsint, optional

Number of threads, by default 1

save_picklebool, optional

Pickle the dictionary into .guido file, by default True

bowtie_ignorebool, optional

Ignore building bowtie index. Use if you already have bowtie index built, by default False

bowtie_pathstr, optional

Path to bowtie binary if it’s not in the path, by default “”

guido.genome.load_genome_from_file(guido_file)[source]

Load a genome from a .guido file. This file is created when a genome is built. It contains all the information needed to use the genome. Guido files are saved in the same directory as the genome FASTA file. They are named after the genome name and have the .guido extension. Genome object can be created by using the :method:`build` method.

Parameters:
guido_filestr

Path to the .guido file.

Returns:
Genome

Genome object.