KarrLab/wc_model_gen

View on GitHub

Showing 120 of 341 total issues

Avoid deeply nested control flow statements.
Open

                        if proteasome_species == self._rxn_species_modifier[reaction.id][0]:
                            modifier_reactants.append(proteasome_species)
                    
Severity: Major
Found in wc_model_gen/eukaryote/protein_degradation.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if cplx_species.compartment in conc_per_comp:
                                conc_per_comp[cplx_species.compartment] += stoic * \
                                    cplx_species.distribution_init_concentration.mean
                            else:        
                                conc_per_comp[cplx_species.compartment] = stoic * \
    Severity: Major
    Found in wc_model_gen/eukaryote/translation_translocation.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if type(compl_subunit.species_type) == wc_kb.eukaryote.ProteinSpeciesType:                            
                                  
                                  model_rxn = model.reactions.create(
                                      submodel=self.submodel,
                                      id='{}_dissociation_in_{}_degrade_{}'.format(
      Severity: Major
      Found in wc_model_gen/eukaryote/complexation.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if part.species.id in met_requirement:
                                    met_requirement[part.species.id] += -part.coefficient * mean_concentration * \
                                        (1 + doubling_time / half_life)
                        # Transcription elongation
                        transcription_el_reaction = model.reactions.get_one(id='transcription_elongation_{}'.format(rna_kb.id))
        Severity: Major
        Found in wc_model_gen/eukaryote/metabolism.py - About 45 mins to fix

          Function gen_response_functions has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def gen_response_functions(model, beta, reaction_id, reaction_class, compartment, reaction_factors):
          Severity: Minor
          Found in wc_model_gen/utils.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if model_compartment.init_density.function_expressions:
                                        volume = model_compartment.init_density.function_expressions[0].function
                                        unit_adjusted_term = '{} * {} * {}'.format(param.id, Avogadro.id, volume.id)
                                    else:
                                        volume = model_compartment.init_volume.mean    
            Severity: Major
            Found in wc_model_gen/eukaryote/initialize_model.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if species.distribution_init_concentration:
                                          if species.distribution_init_concentration.mean:    
                                              param.value = beta * species.distribution_init_concentration.mean \
                                                  / Avogadro.value / species.compartment.init_volume.mean
                                              param.comments = 'The value was assumed to be {} times the concentration of {} in {}'.format(
              Severity: Major
              Found in wc_model_gen/eukaryote/complexation.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        for comp, kcat in comp_kcat.items():                            
                                            kcat.value = median_kcat
                                            kcat.comments = 'Value imputed as the median of measured k_cat values'
                            else:
                Severity: Major
                Found in wc_model_gen/eukaryote/metabolism.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if codon == 'ATG':
                                              aa = model.species_types.get_one(id='met').species.get_one(compartment=cytosol)
                                          elif codon == 'ACT' or codon == 'ACC' or codon == 'ACA' or codon == 'ACG':
                                              aa = model.species_types.get_one(id='thr').species.get_one(compartment=cytosol)
                                          elif codon == 'ATT' or codon == 'ATC' or codon == 'ATA':
                  Severity: Major
                  Found in wc_model_gen/prokaryote/translation.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for codon_info in matched_trnas:    
                                                expression_terms.append(codon_info['function'].id)
                                                objects[wc_lang.Function][codon_info['function'].id] = codon_info['function']                        
                                                for cl, dictionary in objects.items():
                                                    dictionary.update(codon_info['objects'][cl])                    
                    Severity: Major
                    Found in wc_model_gen/eukaryote/translation_translocation.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if not determined:
                                                  formula += subunit.species_type.get_empirical_formula(seq_input=protein_seq) * coef
                                                  charge += subunit.species_type.get_charge(seq_input=protein_seq) * coef
                                                  weight += subunit.species_type.get_mol_wt(seq_input=protein_seq) * coef
                                              else:
                      Severity: Major
                      Found in wc_model_gen/eukaryote/initialize_model.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if model_subunit_species.species_type.type != wc_ontology['WC:metabolite']:
                                                    self._maximum_possible_amount[model_compl_species.id].append(
                                                        model_subunit_species.distribution_init_concentration.mean / subunit_coefficient)
                        
                        
                        Severity: Major
                        Found in wc_model_gen/eukaryote/complexation.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if part.species.id in met_requirement:
                                                      met_requirement[part.species.id] += -part.coefficient * total_concentration * \
                                                          (1 + doubling_time / prot_half_life)
                                              # Translation elongation
                                              translation_el_reaction = model.reactions.get_one(id='translation_elongation_{}'.format(rna_kb.id))                
                          Severity: Major
                          Found in wc_model_gen/eukaryote/metabolism.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if subunit_id not in gvar.transcript_ntp_usage:
                                                        seq = subunit.species_type.get_seq()
                                                        gvar.transcript_ntp_usage[subunit.species_type.id] = {
                                                            'A': seq.upper().count('A'),
                                                            'C': seq.upper().count('C'),
                            Severity: Major
                            Found in wc_model_gen/eukaryote/initialize_model.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if numpy.isnan(kcat.value):                    
                                                          kcat.value = value/conc*kcat_adjustment_factor
                                                          kcat.comments = 'Value imputed based on FVA bound value ' +\
                                                              'and adjusted with a factor of {}'.format(kcat_adjustment_factor)
                                                      elif (value - kcat.value*conc)/value > 0.01:
                              Severity: Major
                              Found in wc_model_gen/eukaryote/metabolism.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if species.distribution_init_concentration.mean:
                                                            model_Km.value = beta * species.distribution_init_concentration.mean \
                                                                / Avogadro.value / species.compartment.init_volume.mean
                                                            model_Km.comments = 'The value was assumed to be {} times the concentration of {} in {}'.format(
                                                                beta, species.species_type.id, species.compartment.name)
                                Severity: Major
                                Found in wc_model_gen/eukaryote/translation_translocation.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if part.species.id in met_requirement:
                                                              met_requirement[part.species.id] += -part.coefficient * mean_concentration * \
                                                                  (1 + doubling_time / half_life)
                                              
                                  Severity: Major
                                  Found in wc_model_gen/eukaryote/metabolism.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if sp.distribution_init_concentration:
                                                                if sp.distribution_init_concentration.mean > 0.:
                                                                    compartment = sp.compartment
                                                                    model_met_id = met_id + f'[{compartment.id}]'
                                                                    if model_met_id in met_requirement:
                                    Severity: Major
                                    Found in wc_model_gen/eukaryote/metabolism.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if species.distribution_init_concentration.mean:                        
                                                                  model_Km.value = beta * species.distribution_init_concentration.mean \
                                                                      / Avogadro.value / species.compartment.init_volume.mean
                                                                  model_Km.comments = 'The value was assumed to be {} times the concentration of {} in {}'.format(
                                                                      beta, species.species_type.id, species.compartment.name)
                                      Severity: Major
                                      Found in wc_model_gen/eukaryote/translation_translocation.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if part.species.id in met_requirement:
                                                                    met_requirement[part.species.id] += -part.coefficient * total_concentration * \
                                                                        (1 + doubling_time / prot_half_life)
                                                        
                                        Severity: Major
                                        Found in wc_model_gen/eukaryote/metabolism.py - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language