celloapi2 package¶
Submodules¶
celloapi2.celloapi module¶
But this is Better than Ezira, which is Good.
No one who reads this will get the joke, and the world’s poorer for it.
Written by W.R. Jackson <wrjackso@bu.edu>, DAMP Lab 2021¶
-
class
celloapi2.celloapi.
CelloQuery
(input_directory: Optional[str] = None, output_directory: Optional[str] = None, verilog_file: Optional[str] = None, compiler_options: Optional[str] = None, input_ucf: Optional[str] = None, input_sensors: Optional[str] = None, output_device: Optional[str] = None, logging: bool = False, archival: bool = True, dependency_check: bool = True)¶ Bases:
object
-
__init__
(input_directory: Optional[str] = None, output_directory: Optional[str] = None, verilog_file: Optional[str] = None, compiler_options: Optional[str] = None, input_ucf: Optional[str] = None, input_sensors: Optional[str] = None, output_device: Optional[str] = None, logging: bool = False, archival: bool = True, dependency_check: bool = True)¶ Class encapsulating all of the weirdness of interacting with Cello.
- Parameters
input_directory – The input directory containing all of our input files for Cello analysis. All of the input files should exist at this level and not be nested any further.
output_directory – The output directory where all results will be saved.
verilog_file – A valid verilog file.
compiler_options – A CSV describing various inputs to the compiler. Fairly static in practice, but this could change in the future.
input_ucf – The input UCF (User Constraint File) that defines the chassis or input vector that the circuit will be implanted into.
input_sensors – The input sensors that define the behavior of the input into the genetic circuit.
output_device – The output (Generally something like a fluorescent protein)
logging – Optional. If true, when results are submitted the terminal output from the docker container will be displayed in the terminal.
archival – Optional. If true, when results are submitted to the docker container the prior results are moved to a new folder to prevent clobbering. If false, we remove the previous results.
dependency_check – Optional. Toggles a check to ensure the presence of Docker for the purposes of simplifying the student workflow.
-
archive_prior_results
() → str¶ Moves prior results to a safe location to prevent clobbering.
- Returns
The location that the prior results were move to.
-
static
check_dependencies
()¶
-
check_for_prior_results
() → bool¶ Checks to see if there are any prior results in the output directory
- Returns
If there are prior results in the output directory.
-
check_paths
()¶
-
get_input_signals
() → List[str]¶ Parses the input UCF and pulls out all of the human readable names for input signals.
- Returns
A list of human readable input signals.
-
get_results
() → int¶ Primary Entrypoint for the library. Wraps calling the Cello Docker Container and takes care of all of the busywork necessary to make everything come together.
- Returns
An integer value representing success or failure.
-
remove_prior_results
()¶ Removes prior results to prevent aggregation of files.
-
reset_input_signals
()¶ Sets the input signals back to what they were originally.
-
set_input_signals
(input_signals: List[str], output_filename: str = 'custom_input.input.json', mutate: bool = True) → str¶ “Sets” the input signals for the circuit.
In this context, it’s accomplished by removing all entries from the input.json that don’t correspond to the selected inputs.
This also mutates the class to point to the new input.json as a default.
- Returns
A string corresponding to the filename. Typically for scripting or generating programmatic inputs for the homework assignment.
-
-
class
celloapi2.celloapi.
CelloResult
(results_dir: str)¶ Bases:
object
-
__init__
(results_dir: str)¶ High Level Class that encapsulates some of the oddities of recapitulating the necessary information from the Cello output documentation.
- Parameters
results_dir – The directory that contains all of the output from running the Cello DNAComplier Process.
-
logic_dict
¶ Dictionary mapping the node label to it’s boolean state. Used for scoring individual gates/repressors.
-
activitiy_dict
¶ Dictionary mapping the node label to it’s activity score.
-
part_names
¶ Dictionary mapping the node labels to their human readable labels.
-
repressor_scores
¶ Dictionary mapping the node label for each repressor and it’s correlating score as dictated in the literature.
-
circuit_score
¶ Float representing the numerical score of the entirety of the circuit. Derived from a simulated annealing algorithm.
-
get_part_map
() → Dict[str, str]¶ Inverts the relationship between the verilog variable keys and human-readable part names.
- Returns
Dictionary mapping part names to their verilog labels.
-
score_repressors
() → Dict[str, float]¶ Scores all of the repressors in the genetic circuit according to the highest off and lowest on.
- Returns
Dictionary mapping the verilog variable label of each repressor to it’s score.
-