CodonU.file_handler

Submodules

Package Contents

Functions

set_entrez_param(→ None)

Sets entrez parameters

get_gb

make_dir(→ None)

Makes a directory if not present already

read_file(→ pandas.DataFrame)

Returns a dataframe from given csv file

write_nucleotide_fasta(accession_id, file_path)

Creates a fasta file of nucleotides if not exists previously or is empty

write_protein_fasta

write_exome_fasta(accession_id, file_path[, exclude_stops])

Creates a fasta file of all exones if not exists previously or is empty

CodonU.file_handler.set_entrez_param(email: str | None = None, api_key: str | None = None) None

Sets entrez parameters

Parameters:
  • email – Email of the user (optional)

  • api_key – API key of the user (optional)

Raises:
CodonU.file_handler.get_gb(accession_id: str) Bio.SeqRecord.SeqRecord

Gets the Sequence Record object from a given accession number

Parameters:

accession_id – Provided accession number

Returns:

The Sequence Record object

CodonU.file_handler.make_dir(path: str) None

Makes a directory if not present already

Parameters:

path – Path of the directory

CodonU.file_handler.read_file(file_name: str) pandas.DataFrame

Returns a dataframe from given csv file

Parameters:

file_name – Name or path to csv file

Returns:

The data frame object

CodonU.file_handler.write_nucleotide_fasta(accession_id: str, file_path: str)

Creates a fasta file of nucleotides if not exists previously or is empty

Parameters:
  • accession_id – Accession id of organism

  • file_path – Intended file path

CodonU.file_handler.write_protein_fasta(accession_id: str, file_path: str)

Creates a fasta file of proteins if not exists previously or is empty

Parameters:
  • accession_id – Accession id of organism

  • file_path – Intended file path

CodonU.file_handler.write_exome_fasta(accession_id: str, file_path: str, exclude_stops: bool = True)

Creates a fasta file of all exones if not exists previously or is empty

Parameters:
  • accession_id – Accession id of organism

  • file_path – Intended file path

  • exclude_stops – If true, intermediate stops codons are excluded from exome