Develop Biology
The language of life
RNAPolymerase.cpp
Go to the documentation of this file.
1/*
2 * This file is a part of the Biology project by eons LLC.
3 * Biology (aka Develop Biology) is a framework for approaching software
4 * development from a natural sciences perspective.
5 *
6 * Copyright (C) 2021 Séon O'Shannon & eons LLC
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
24#include "bio/genetic/Plasmid.h"
25#include "bio/genetic/RNA.h"
26#include "bio/common/TypeName.h"
27
28namespace bio {
29namespace genetic {
30
32 :
33 molecular::Protein(chemical::PeriodicTable::Instance().GetNameFromType(*this))
34{
35 SetSource(toTranscribe);
36 mc_rna = Define("RNA Binding Site");
37}
38
40{
41
42}
43
45{
46 Expressor* expressor = ChemicalCast< Expressor* >(GetEnvironment());
47 BIO_SANITIZE(expressor, ,
48 return code::BadArgument1());
49 RNA* boundRNA = RotateTo< RNA* >(mc_rna);
51 return code::BadArgument2());
52
53 Gene* geneBuffer;
54 bool shouldTranscribe = false;
55 for (
56 SmartIterator gen = m_source->GetAll< Gene* >()->Begin();
57 !gen.IsAtEnd();
58 ++gen
59 )
60 {
61 geneBuffer = gen;
62 shouldTranscribe = expressor->HasAll< TranscriptionFactor >(
63 geneBuffer->GetAll< TranscriptionFactor >());
64 if (!shouldTranscribe)
65 {
66 continue;
67 }
68 boundRNA->Add< Gene* >(geneBuffer);
69 }
70 return code::Success();
71}
72} //genetic namespace
73} //bio namespace
#define BIO_SANITIZE(test, success, failure)
bool HasAll(const Container *contents) const
StandardDimension mc_rna
Definition: RNAPolymerase.h:60
RNAPolymerase(Plasmid *toTranscribe)
StandardDimension Define(Name varName)
Definition: Molecule.h:135
virtual Code SetSource(const DNA *source)
Definition: Protein.cpp:72
const DNA * m_source
Definition: Protein.h:140
Code BadArgument2()
Code BadArgument1()
Code Success()
Definition: Cell.h:31