Lecture 4 by Ciro Santilli 35 Updated +Created
16S ribosomal RNA by Ciro Santilli 35 Updated +Created
PostgreSQL getting started by Ciro Santilli 35 Updated +Created
On Ubuntu 20.10 PostgreSQL 12.6, login with psql on my default username without sudo fails with: stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-exist
This is the one that worked on Ubuntu 21.04: stackoverflow.com/questions/11919391/postgresql-error-fatal-role-username-does-not-exist/38444152#38444152
sudo -u postgres createuser -s $(whoami)
createdb $(whoami)
Explanation:
  • sudo -u postgres uses the postgres user via peer authentication
  • -s in createuser -s: make it a superuser
  • createdb: TODO why do we have to create a table with the same name as the user? Otherwise login fails.
You can now run psql without any password. This works without password due to peer authentication,
sudo cat /etc/postgresql/12/main/pg_hba.conf
shows that peer authentication is available to all users apparently:
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
List users:
psql -c '\du'
output:
                                    List of roles
  Role name  |                         Attributes                         | Member of 
-------------+------------------------------------------------------------+-----------
 ciro        | Superuser, Create role, Create DB                          | {}
 owning_user |                                                            | {}
 postgres    | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
Delete user later on:
psql -c 'DROP USER username;'
Create a database:
createdb testdb0
Help toplevel:
help
Get help for Postgres commands such as \h and so on:
\?
List supported SQL commands:
\h
Show syntax for one type of command:
\h SELECT
List all databases:
psql -c '\l'
which shows:
    Name     |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-------------+----------+----------+-------------+-------------+-----------------------
 ciro        | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 |
 postgres    | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 |
 template0   | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres          +
             |          |          |             |             | postgres=CTc/postgres
 template1   | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres          +
             |          |          |             |             | postgres=CTc/postgres
 testdb0     | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 |
(6 rows)
Delete a database:
psql -c 'DROP DATABASE "testdb0";'
If you didn't give a database from the command line e.g.:
psql
you can do that afterwards with:
\c testdb0
Let's create a table and test that it is working:
psql testdb0 -c 'CREATE TABLE table0 (int0 INT, char0 CHAR(16));'
List tables, no special tables:
psql testdb0 -c '\dt'
gives:
        List of relations
 Schema |  Name  | Type  | Owner
--------+--------+-------+-------
 public | table0 | table | ciro
(1 row)
View table schema: stackoverflow.com/questions/109325/postgresql-describe-table
psql testdb0 -c '\d+ table0'
output:
                                      Table "public.table0"
 Column |     Type      | Collation | Nullable | Default | Storage  | Stats target | Description 
--------+---------------+-----------+----------+---------+----------+--------------+-------------
 int0   | integer       |           |          |         | plain    |              | 
 char0  | character(16) |           |          |         | extended |              | 
Insert some data into it and get the data out:
psql testdb0 -c "INSERT INTO table0 (int0, char0) VALUES (2, 'two'), (3, 'three'), (5, 'five'), (7, 'seven');"
psql testdb0 -c 'SELECT * FROM table0;'
output:
 int0 |      char0
------+------------------
    2 | two
    3 | three
    5 | five
    7 | seven
(4 rows)
Delete the table:
psql testdb0 -c 'DROP TABLE table0;'
Acousto-optic modulator by Ciro Santilli 35 Updated +Created
An optical multiplexer!
Video 1.
Control Light with Sound! by Les' Lab (2021)
Source.
Polarization of light by Ciro Santilli 35 Updated +Created
This section discusses the pre-photon understanding of the polarization of light. For the photon one see: photon polarization.
People were a bit confused when experiments started to show that light might be polarized. How could a wave that propages through a 3D homgenous material like luminiferous aether have polarization?? Light would presumably be understood to be analogous to a sound wave in 3D medium, which cannot have polarization. This was before Maxwell's equations, in the early 19th century, so there was no way to know.
MariaDB by Ciro Santilli 35 Updated +Created
Dude's a legend. Sells company for a few million. Then forks the open source project next year. Love it.
Mars exploration by Ciro Santilli 35 Updated +Created
Incandescent light bulb by Ciro Santilli 35 Updated +Created
INNER JOIN by Ciro Santilli 35 Updated +Created
IBM quantum computer by Ciro Santilli 35 Updated +Created
Realworld app written in Express by Ciro Santilli 35 Updated +Created
SHT_SYMTAB on the executable by Ciro Santilli 35 Updated +Created
By default, NASM places a .symtab on the executable as well.
This is only used for debugging. Without the symbols, we are completely blind, and must reverse engineer everything.
You can strip it with objcopy, and the executable will still run. Such executables are called "stripped executables".
Condition by Ciro Santilli 35 Updated +Created
  • reconstruction/ecoli/flat/condition/nutrient/minimal.tsv contains the nutrients in a minimal environment in which the cell survives:
    "molecule id" "lower bound (units.mmol / units.g / units.h)" "upper bound (units.mmol / units.g / units.h)"
    "ADP[c]" 3.15 3.15
    "PI[c]" 3.15 3.15
    "PROTON[c]" 3.15 3.15
    "GLC[p]" NaN 20
    "OXYGEN-MOLECULE[p]" NaN NaN
    "AMMONIUM[c]" NaN NaN
    "PI[p]" NaN NaN
    "K+[p]" NaN NaN
    "SULFATE[p]" NaN NaN
    "FE+2[p]" NaN NaN
    "CA+2[p]" NaN NaN
    "CL-[p]" NaN NaN
    "CO+2[p]" NaN NaN
    "MG+2[p]" NaN NaN
    "MN+2[p]" NaN NaN
    "NI+2[p]" NaN NaN
    "ZN+2[p]" NaN NaN
    "WATER[p]" NaN NaN
    "CARBON-DIOXIDE[p]" NaN NaN
    "CPD0-1958[p]" NaN NaN
    "L-SELENOCYSTEINE[c]" NaN NaN
    "GLC-D-LACTONE[c]" NaN NaN
    "CYTOSINE[c]" NaN NaN
    If we compare that to reconstruction/ecoli/flat/condition/nutrient/minimal_plus_amino_acids.tsv, we see that it adds the 20 amino acids on top of the minimal condition:
    "L-ALPHA-ALANINE[p]" NaN NaN
    "ARG[p]" NaN NaN
    "ASN[p]" NaN NaN
    "L-ASPARTATE[p]" NaN NaN
    "CYS[p]" NaN NaN
    "GLT[p]" NaN NaN
    "GLN[p]" NaN NaN
    "GLY[p]" NaN NaN
    "HIS[p]" NaN NaN
    "ILE[p]" NaN NaN
    "LEU[p]" NaN NaN
    "LYS[p]" NaN NaN
    "MET[p]" NaN NaN
    "PHE[p]" NaN NaN
    "PRO[p]" NaN NaN
    "SER[p]" NaN NaN
    "THR[p]" NaN NaN
    "TRP[p]" NaN NaN
    "TYR[p]" NaN NaN
    "L-SELENOCYSTEINE[c]" NaN NaN
    "VAL[p]" NaN NaN
    so we guess that NaN in the upper mound likely means infinite.
    We can try to understand the less obvious ones:
    • ADP: TODO
    • PI: TODO
    • PROTON[c]: presumably a measure of pH
    • GLC[p]: glucose, this can be seen by comparing minimal.tsv with minimal_no_glucose.tsv
    • AMMONIUM: ammonium. This appears to be the primary source of nitrogen atoms for producing amino acids.
    • CYTOSINE[c]: hmmm, why is external cytosine needed? Weird.
  • reconstruction/ecoli/flat/reconstruction/ecoli/flat/condition/timeseries/` contains sequences of conditions for each time. For example:
    * 
    reconstruction/ecoli/flat/reconstruction/ecoli/flat/condition/timeseries/000000_basal.tsv contains: "time (units.s)" "nutrients" 0 "minimal" which means just using reconstruction/ecoli/flat/condition/nutrient/minimal.tsv until infinity. That is the default one used by runSim.py, as can be seen from ./out/manual/wildtype_000000/000000/generation_000000/000000/simOut/Environment/attributes/nutrientTimeSeriesLabel which contains just 000000_basal. * reconstruction/ecoli/flat/reconstruction/ecoli/flat/condition/timeseries/000001_cut_glucose.tsv is more interesting and contains:
      "time (units.s)" "nutrients"
      0 "minimal"
      1200 "minimal_no_glucose"
      
    so we see that this will shift the conditions half-way to a condition that will eventually kill the bacteria because it will run out of glucose and thus energy!
    Timeseries can be selected with --variant nutrientTimeSeries X Y, see also: run variants.
    We can use that variant with:
      VARIANT="condition" FIRST_VARIANT_INDEX=1 LAST_VARIANT_INDEX=1 python runscripts/manual/runSim.py
      
  • reconstruction/ecoli/flat/condition/condition_defs.tsv contains lines of form:
    "condition" "nutrients"                "genotype perturbations" "doubling time (units.min)" "active TFs"
    "basal"     "minimal"                  {}                       44.0                        []
    "no_oxygen" "minimal_minus_oxygen"     {}                       100.0                       []
    "with_aa"   "minimal_plus_amino_acids" {}                       25.0                        ["CPLX-125", "MONOMER0-162", "CPLX0-7671", "CPLX0-228", "MONOMER0-155"]
    • condition refers to entries in reconstruction/ecoli/flat/condition/condition_defs.tsv
    • nutrients refers to entries under reconstruction/ecoli/flat/condition/nutrient/, e.g. reconstruction/ecoli/flat/condition/nutrient/minimal.tsv or reconstruction/ecoli/flat/condition/nutrient/minimal_plus_amino_acids.tsv
    • genotype perturbations: there aren't any in the file, but this suggests that genotype modifications can also be incorporated here
    • doubling time: TODO experimental data? Because this should be a simulation output, right? Or do they cheat and fix doubling by time?
    • active TFs: this suggests that they are cheating transcription factors here, as those would ideally be functions of other more basic inputs

Unlisted articles are being shown, click here to show only listed articles.