We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I will work on refactoring the visualise function in core.py to break it up in smaller functions and improve the way temporary files are managed.
visualise
core.py
Here is some starter code generated by GitHub Copilot that streamlines tempfile management:
from dataclasses import dataclass @dataclass class TempFiles: filename_template: str def __post_init__(self): suffixes = [ "fasta", "sto", "depaired", "stk", "stk_original", "sto_unfiltered", "seed_list", "post_prob", "pfam_stk", "pfam_stk_original", "afa", "afa_original", "map" ] for suffix in suffixes: setattr(self, suffix, self.generate_filename(suffix)) def generate_filename(self, suffix: str) -> str: return self.filename_template.replace("type", suffix) # Example usage if not os.path.exists(output_folder): os.makedirs(output_folder) filename_template = os.path.join(output_folder, f"{seq_id.replace('/', '_')}_type.txt") temp_files = TempFiles(filename_template) # Access the temporary file paths using dot syntax temp_fasta = temp_files.fasta temp_sto = temp_files.sto temp_depaired = temp_files.depaired temp_stk = temp_files.stk temp_stk_original = temp_files.stk_original temp_sto_unfiltered = temp_files.sto_unfiltered temp_acc_list = temp_files.seed_list temp_post_prob = temp_files.post_prob temp_pfam_stk = temp_files.pfam_stk temp_pfam_stk_original = temp_files.pfam_stk_original temp_afa = temp_files.afa temp_afa_original = temp_files.afa_original temp_map = temp_files.map # Example usage: print all temporary file paths print(temp_files) # get sequence from fasta file seq_range = f"-c {start}..{end}" if start and end else "" if not os.path.exists(f"{fasta_input}.ssi"): runner.run(f"esl-sfetch --index {fasta_input}") cmd = f"esl-sfetch {seq_range} {fasta_input} {seq_id} > {temp_fasta}" result = runner.run(cmd)
The text was updated successfully, but these errors were encountered:
AntonPetrov
No branches or pull requests
I will work on refactoring the
visualise
function incore.py
to break it up in smaller functions and improve the way temporary files are managed.Here is some starter code generated by GitHub Copilot that streamlines tempfile management:
The text was updated successfully, but these errors were encountered: