CodonU.file_handler
Submodules
Package Contents
Functions
|
Sets entrez parameters |
|
Makes a directory if not present already |
|
Returns a dataframe from given csv file |
|
Creates a fasta file of nucleotides if not exists previously or is empty |
|
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:
EmailWarning – If no email is provided
ApiWarning – If no API key is provided
- 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