spirepy

Submodules

Attributes

Classes

Study

A study from SPIRE.

Sample

A sample from SPIRE.

Package Contents

class spirepy.Study(name: str)[source]

A study from SPIRE.

This class represents a study from the SPIRE database. It automatically fetches metadata and automates the initialization of samples to further use to obtain its genomic, geographical or other types of data provided by it.

Parameters:

name (str) – Internal ID for the study.

name
get_metadata() polars.DataFrame[source]

Retrieve metadata for the study.

Returns:

A Dataframe with the study’s metadata.

Return type:

polars.DataFrame

get_samples() list[source]

Retrive a list of samples for the study.

Returns:

List of spirepy.sample.Sample that belong to the study.

Return type:

list

get_mags() polars.DataFrame[source]

Get a DataFrame with information regarding the MAGs.

Returns:

A Dataframe with the study’s MAGs.

Return type:

polars.DataFrame

download_assemblies(output: str)[source]

Download the assemblies into a specified folder.

Parameters:

output (str) – Output folder to download the assemblies to.

download_mags(output: str)[source]

Download the MAGs into a specified folder.

Parameters:

output (str) – Output folder to download the MAGs to.

download_genecalls(output: str)[source]

Download the genecalls into a specified folder.

Parameters:

output (str) – Output folder to download the genecalls to.

download_proteins(output: str)[source]

Download the proteins into a specified folder.

Parameters:

output (str) – Output folder to download the proteins to.

class spirepy.Sample(id: str, study: spirepy.study.Study = None)[source]

A sample from SPIRE.

This class represents a sample from the SPIRE database. It is designed to provide all the properties and methods to allow work with samples and provide tools for automation and scalability.

Parameters:
id
study = None
get_metadata() polars.DataFrame[source]

Retrieve the metadata for a sample.

Returns:

A Dataframe with the sample’s metadata.

Return type:

polars.DataFrame

get_mags() polars.DataFrame[source]

Retrieve the MAGs for a sample.

Returns:

A Dataframe with the sample’s MAGs.

Return type:

polars.DataFrame

get_eggnog_data() polars.DataFrame[source]

Retrive the EggNOG-mapper data for a sample.

Returns:

A Dataframe with the sample’s EggNOG-mapper data.

Return type:

polars.DataFrame

get_amr_annotations(mode: str = 'deeparg') None | polars.DataFrame[source]

Obtain the anti-microbial resistance annotations for the sample.

Parameters:

mode (str, optional) – Tool to select the AMR data from. Options are deepARG (deeparg), abricate-megares (megares) and abricate-vfdb (vfdb); defaults to deepARG.

Returns:

A Dataframe with the sample’s AMR data.

Return type:

polars.DataFrame

get_contig_depths() polars.DataFrame[source]

Obtain the contig depth data for the sample.

Returns:

A Dataframe with the sample’s contig depth data.

Return type:

polars.DataFrame

download_mags(out_folder: str)[source]

Download the MAGs into a specified folder.

Parameters:

output (str) – Output folder to download the MAGs to.

spirepy.is_release = True[source]