SlideShare una empresa de Scribd logo
1 de 58
Descargar para leer sin conexión
FBW
19-03-2019
Biological Databases
Wim Van Criekinge
• SELECT Statement
• Advanced SQL
• First database schemes
Selecta Statement (General)
Select componentsb (MySQL version 4.0.X)
1. Select (required)
2. Expression (required)
3. From Table (Only optional if table data is
not used)
4. Where Condition (optional)
5. Group By (optional)
6. Having (optional)
7. Order By (optional)
8. Limit (optional)
aWords listed in blue above are key (reserved) words in MySQL, except
“Expression”
bThere are many more components in the select statement, but only the most
common are discussed
Select
• Is a MySQL keyword at the
beginning of a Structured Query
Language (SQL) statement or more
simply a query that retrieves data
from a database.
• It can be used in conjunction with the
MySQL command insert, replace,
and create table.
Expression
The “expression”
1. Selects which columns (by column name)
will be retrieved
2. Apply MySQL functions on the columns
of data
Examples—
* (Selects all columns in a table)
temperature * 1.8 + 32a
dt, temperature, relative_humidityb
aApply arithmetic operations on a column
bChoose multiple columns in single query
Note: columns are in green, tables are in red,
MySQL functions are in magenta.
Expression Cont
More Examples--
-1 * speed * sin( direction * pi() / 180 )c
-1 * speed * cos( direction * pi() / 180 )
as Vd
avg(temperature)e
tableX.temperature,
tableY.temperaturef
cCan use built in mathematical functions.
dThe ‘as’ keyword can be used to set the output column name.
eCan retrieve a statistical value from rows of data. Must be used with ‘group by’.
fThe select can retrieve or make relationships from multiple tables from a single
query. Note the ‘.’ that separates the table name and column name.
From
Tells MySQL which table(s) to select
froma
aIf multiple tables are used in the
expression, they all must be listed
here seperated by a ‘,’
Where
Sets the condition of which rows to select. Useful
for eliminating unwanted data from your results.
Conditional
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
= Equals
!= Not equals
Logical
and True if both are true
or True if only one is true
() Useful for grouping or
ordering multiple logical
statements
String pattern matching
like a MySQL keyword in-between column and pattern
% a wildcard that matches all instances in a string
_ a wildcard that matches only the character location
Group By
Aggregates rows by distinct values in the columns
listed in the ‘group by’ when using statistical
functions (e.g., avg, std, max, min, sum, count, etc.)
Example--
group by site_ida
group by site_id, month(dt)b
aSingle column
bMultiple columns and apply functions on a column
Having
Similar to where, except that it must follow
‘group by’ group, and only eliminates results
after the results have been aggregated. See
where for more details.
WHERE and HAVING
• WHERE refers to the
rows of tables, and so
cannot use aggregate
functions
• HAVING refers to the
groups of rows, and so
cannot use columns
which are not in the
GROUP BY
• Think of a query being
processed as follows:
• Tables are combined
• WHERE clauses
• GROUP BY and
Aggregates
• Column selection
• HAVING clauses
• ORDER BY
Order By
• Orders the result rows defined by the columns in the
‘order by’ group
• The keyword asc (ascending) and desc (descending)
to change the order of the result rows, and is always
at the end of the order by component. desc is the
default.
Examples—
order by dt
order by dt, site_ida
aThe first column is ordered first, second column is ordered second
on the ordering of the first column, and so on
Order By Example
mysql>select … order by site_id, month asc
site_id month ave_temp
1 1 32.3
1 2 40.2
1 3 49.5
2 1 35.6
2 2 41.3
2 3 53.5
Limit
Limits the number of rows from the result set
limit row_counta
limit offset, row_countb
aStarts at the first row
bStarts at the offset row
JOINS
Explicit joins in SQL:
Product(name, category)
Purchase(prodName, store)
Same as:
SELECT Product.name, Purchase.store
FROM Product JOIN Purchase ON
Product.name = Purchase.prodName
SELECT Product.name, Purchase.store
FROM Product, Purchase
WHERE Product.name = Purchase.prodName
https://www.w3schools.com/sql/sql_join.asp
Modifying the Database
Three kinds of modifications
• Insertions
• Deletions
• Updates
Sometimes they are all called “updates”
Insertions
General form:
Missing attribute  NULL.
May drop attribute names if give them in order.
INSERT INTO R(A1,…., An) VALUES (v1,…., vn)
INSERT INTO Purchase(buyer, seller, product, store)
VALUES (‘Joe’, ‘Fred’, ‘wakeup-clock-espresso-machine’,
‘The Sharper Image’)
Example: Insert a new purchase to the database:
Insertions
INSERT INTO PRODUCT(name)
SELECT DISTINCT Purchase.product
FROM Purchase
WHERE Purchase.date > “10/26/01”
The query replaces the VALUES keyword.
Here we insert many tuples into PRODUCT
Insertion: an Example
INSERT INTO Product(name)
SELECT DISTINCT prodName
FROM Purchase
WHERE prodName NOT IN (SELECT name FROM Product)
name listPrice category
gizmo 100 Gadgets
camera - -
Deletions
DELETE FROM PURCHASE
WHERE seller = ‘Joe’ AND
product = ‘Brooklyn Bridge’
Factoid about SQL: there is no way to delete only a single
occurrence of a tuple that appears twice
in a relation.
Example:
Updates
UPDATE PRODUCT
SET price = price/2
WHERE Product.name IN
(SELECT product
FROM Purchase
WHERE Date =‘Oct, 25, 1999’);
Example:
Indexes
REALLY important to speed up query processing time.
Suppose we have a relation
Person (name, age, city)
Sequential scan of the file Person may take long
SELECT *
FROM Person
WHERE name = “Smith”
• Create an index on name:
• B+ trees have fan-out of 100s: max 4 levels !
Indexes
Adam Betty Charles …. Smith ….
Creating Indexes
CREATE INDEX nameIndex ON Person(name)
Syntax:
Creating Indexes
Indexes can be created on more than one attribute:
CREATE INDEX doubleindex ON
Person (age, city)
SELECT *
FROM Person
WHERE age = 55 AND city = “Seattle”
SELECT *
FROM Person
WHERE city = “Seattle”
Helps in:
But not in:
Example:
Creating Indexes
Indexes can be useful in range queries too:
B+ trees help in:
Why not create indexes on everything?
CREATE INDEX ageIndex ON Person (age)
SELECT *
FROM Person
WHERE age > 25 AND age < 28
Views are relations, except that they are not physically stored.
For presenting different information to different users
Employee(ssn, name, department, project, salary)
Payroll has access to Employee, others only to Developers
CREATE VIEW Developers AS
SELECT name, project
FROM Employee
WHERE department = “Development”
A Different View
Person(name, city)
Purchase(buyer, seller, product, store)
Product(name, maker, category)
We have a new virtual table:
Seattle-view(buyer, seller, product, store)
CREATE VIEW Seattle-view AS
SELECT buyer, seller, product, store
FROM Person, Purchase
WHERE Person.city = “Seattle” AND
Person.name = Purchase.buyer
A Different View
SELECT name, store
FROM Seattle-view, Product
WHERE Seattle-view.product = Product.name AND
Product.category = “shoes”
We can later use the view:
33
Types of Views
• Virtual views:
– Used in databases
– Computed only on-demand – slower at
runtime
– Always up to date
• Materialized views
– Used in data warehouses
– Precomputed offline – faster at runtime
– May have stale data
Grace
# rsid chromosome position genotype
rs4477212 1 82154 AA
rs3094315 1 752566 AA
rs3131972 1 752721 GG
rs12124819 1 776546 AG
rs11240777 1 798959 GG
rs6681049 1 800007 CC
rs4970383 1 838555 AC
rs4475691 1 846808 CT
rs7537756 1 854250 AG
rs13302982 1 861808 GG
rs1110052 1 873558 GT
rs2272756 1 882033 AG
rs3748597 1 888659 CC
rs13303106 1 891945 AG
rs28415373 1 893981 CC
rs13303010 1 894573 AA
rs6696281 1 903104 CC
rs28391282 1 904165 GG
rs2340592 1 910935 AG
rs13303118 1 918384 GT
rs6665000 1 924898 AC
Chromsome 12
• Less than 1% of the population is
able to survive on six hours of
sleep and show minimal
impairment (relates to the
BHLHE41/DEC2 gene).
Chromosome I
March 19, 2019 46
Chromosome l contains more
genetic information than any other
chromosome: almost 10% of the
entire human genome (240 Mb –
3000 Genes).
149 genetic diseases related to this
chromosome have been identified;
prostate cancer is one of them, the
most frequent form of cancer
affecting males.
 Key observation by Levine and Stetson in 1939 that delivery of stillborn
fetus and adverse reaction in mom to blood transfusion from father were
related.
 Syndrome in fetus is now referred to as hemolytic disease of the fetus and
newborn (HDFN).
 Syndrome had complicated pregnancies for decades causing severe jaundice and
fetal death, “erythroblastosis fetalis”.
 Erythroblastosis fetalis (HDN) linked with Anti-Rh by Levine in 1941.
 Rh system IDENTIFIED by Landsteiner and Wiener in 1940.
 Immunized animals to Rhesus macaque monkey RBCs.
 Antibody agglutinated 100% of Rhesus and 85% of human RBCs.
 Reactivity paralleled reactivity of sera in women who delivered infant suffering
from hemolytic disease.
 Later antigen detected by rhesus antibody and human antibody established to
be dissimilar but system already named.
March 19, 2019 47
Rh+/Rh-, History
 D antigen, after A and B, is the most important RBC antigen in
transfusion practice.
 Individuals who lack D antigen DO NOT have anti-D.
 Antibody produced through exposure to D antigen through
transfusion or pregnancy.
 Immunogenicity of D greater than that of all other RBC
antigens studied.
 Has been reported that 80%> of D neg individuals who receive
single unit of D pos blood can be expected to develop immune
anti-D.
 Testing for D is routinely performed so D neg will be transfused
with D neg.
March 19, 2019 48
Rh+/Rh-
Clinical Significance
Rh+/Rh-
The genes that determines the blood’s Rh factor appears to be the human genome’s oldest and most
active gene. The Rh blood group system is one of the most complex of human beings, and it is the
second in terms of importance in the field of blood transfusions — coming in just behind the ABO blood
group system.
• The Rh factor is determined by the presence or absence of the D antigen on the cell membranes of
the red blood cells.
• The Rh factor is always analyzed in pregnant women, blood donors, and recipients of blood
• People who are Rh positive (Rh+) have the D antigen, while those who are Rh negative (Rh-) lack it.
If, by accident, Rh+ blood enters the bloodstream of a Rh- individual, the immune system of the Rh-
individual will produce specific antibodies that can cause a dangerous immune response.
• The RhD and RhCE genes, which encode the Rh blood group antigens, are located on chromosome
1. The first Rhesus gene, the RHCE gene, was discovered in 1990. The RHD gene was found two years later,
and the total deletion of this gene ascertained as the cause of the European D negative phenotype. More
than 170 alleles have been found on the RHD gene since.
The genetics of the Rhesus blood group system
March 19, 2019 49
March 19, 2019 50
Most mammals only have one RH gene,
whose position corresponds to the
human RHCE gene. The RHD gene arose from
the duplication of an ancestral RH gene
during mammalian evolution.
An RHD deletion occurred during the
evolution of hominids, so that many modern
humans completely lack the RHD gene. This
haplotype is the leading cause of the D
negative phenotype worldwide.
Rh+/Rh-
March 19, 2019 51
The Rhesus protein in the erythrocyte
membrane
Both Rhesus proteins show 417 amino
acids, shown here as circles. Mature
proteins in the membrane lack the first
amino acid. The amino acid substitutions
which distinguish the RhD from the RhCE
protein are shown in yellow, with the
four amino acids which code for the C
antigen in green and the one which
codes for the E antigen in black. The
single amino acid substitutions which
code for partial D are in blue, those
which code for weak D are in red. The
mutations, identified by the Ulm group,
are in light blue and orange.
The clinically essential difference between Rhesus
positive and Rhesus negative hinges on the presence or
absence of the RhD protein in the erythrocyte membrane
(D positive resp. D negative).
Rh+/Rh-
Genome Evolution
March 19, 2019 52
Deletion of the RHD gene
Deletion of the RHD gene resulted from
recombination between an upstream and a
downstream Rhesus box on two different
chromosomes. This is termed an unequal
crossover. When the two crossed strands
separate (from A over the recombination site
to B), the DNA at the RH gene site completely
lacks the RHD gene (C). This haplotype (C)
occurs in about 41% of the population. An
individual homozygous for this haplotype
(about 17% are) is D-negative.
ACTA1
Estimating Muscle Force
Although the information provided by the
sensory receptors located in the muscles may
be perceived subconsciously, it does
allow us to make important calculations
information about the length of the muscle,
how rigid it is and the
speed with which it changes its state enables
the nervous system to
control the general position of the body. This
data is provided by two
types of sensory receptors. The first type is
located in the muscle itself
and provides information about muscle length
and speed with which it can change position.
The other receptors are found in the tendons
and
detect tension and changes.
Genetic Factors
Affecting Performance
March 19, 2019 54
Human Gene Map
for Performance
March 19, 2019 55
214 autosomal gene entries and quantitative trait loci, 7 on the X chromosome
and 18 mitochondrial genes
March 19, 2019 56
Human Gene Map
for Performance
March 19, 2019 57
Next Week – Status update
• Show database
• Show how database will be used
• Which external database will be used
• At least 3 interesting locus on the chromosome and
related traits
• Main goal: learn from each other approach, share
some resources on github
March 19, 2019 58

Más contenido relacionado

La actualidad más candente

How to make your published data findable, accessible, interoperable and reusable
How to make your published data findable, accessible, interoperable and reusableHow to make your published data findable, accessible, interoperable and reusable
How to make your published data findable, accessible, interoperable and reusablePhoenix Bioinformatics
 
UA Fam med fellows 2011 oct
UA Fam med fellows 2011 octUA Fam med fellows 2011 oct
UA Fam med fellows 2011 octjdondoyle
 
Research data management for medical data with pyradigm
Research data management for medical data with pyradigmResearch data management for medical data with pyradigm
Research data management for medical data with pyradigmPradeep Redddy Raamana
 
Quick And Dirty Databases
Quick And Dirty DatabasesQuick And Dirty Databases
Quick And Dirty Databasescwarren
 
Changing Data: Implementing Primo for the Tri University Group of Libraries (...
Changing Data: Implementing Primo for the Tri University Group of Libraries (...Changing Data: Implementing Primo for the Tri University Group of Libraries (...
Changing Data: Implementing Primo for the Tri University Group of Libraries (...Alison Hitchens
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_uploadProf. Wim Van Criekinge
 
Build Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaBuild Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaRavi Mynampaty
 
Creating a database
Creating a databaseCreating a database
Creating a databaseRahul Gupta
 
Public PhD Defense - Ben De Meester
Public PhD Defense - Ben De MeesterPublic PhD Defense - Ben De Meester
Public PhD Defense - Ben De MeesterBen De Meester
 
You can do WHAT with GenomeQuest? (Almost) 101 Things You May Not Know
You can do WHAT with GenomeQuest? (Almost) 101 Things You May Not KnowYou can do WHAT with GenomeQuest? (Almost) 101 Things You May Not Know
You can do WHAT with GenomeQuest? (Almost) 101 Things You May Not KnowKayleigh Duggan
 

La actualidad más candente (13)

How to make your published data findable, accessible, interoperable and reusable
How to make your published data findable, accessible, interoperable and reusableHow to make your published data findable, accessible, interoperable and reusable
How to make your published data findable, accessible, interoperable and reusable
 
2017 biological databases_part1_vupload
2017 biological databases_part1_vupload2017 biological databases_part1_vupload
2017 biological databases_part1_vupload
 
UA Fam med fellows 2011 oct
UA Fam med fellows 2011 octUA Fam med fellows 2011 oct
UA Fam med fellows 2011 oct
 
Research data management for medical data with pyradigm
Research data management for medical data with pyradigmResearch data management for medical data with pyradigm
Research data management for medical data with pyradigm
 
Quick And Dirty Databases
Quick And Dirty DatabasesQuick And Dirty Databases
Quick And Dirty Databases
 
Changing Data: Implementing Primo for the Tri University Group of Libraries (...
Changing Data: Implementing Primo for the Tri University Group of Libraries (...Changing Data: Implementing Primo for the Tri University Group of Libraries (...
Changing Data: Implementing Primo for the Tri University Group of Libraries (...
 
2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload2018 02 20_biological_databases_part2_v_upload
2018 02 20_biological_databases_part2_v_upload
 
Build Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaBuild Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to Omega
 
Creating a database
Creating a databaseCreating a database
Creating a database
 
Introduction to EpiData
Introduction to EpiDataIntroduction to EpiData
Introduction to EpiData
 
Orbit global services
Orbit global servicesOrbit global services
Orbit global services
 
Public PhD Defense - Ben De Meester
Public PhD Defense - Ben De MeesterPublic PhD Defense - Ben De Meester
Public PhD Defense - Ben De Meester
 
You can do WHAT with GenomeQuest? (Almost) 101 Things You May Not Know
You can do WHAT with GenomeQuest? (Almost) 101 Things You May Not KnowYou can do WHAT with GenomeQuest? (Almost) 101 Things You May Not Know
You can do WHAT with GenomeQuest? (Almost) 101 Things You May Not Know
 

Similar a 2019 03 05_biological_databases_part5_v_upload

2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_upload2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_uploadProf. Wim Van Criekinge
 
MIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresMIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresSteven Johnson
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standardsAlessandro Baratella
 
Performance By Design
Performance By DesignPerformance By Design
Performance By DesignGuy Harrison
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfChapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfTamiratDejene1
 
My SQL Skills Killed the Server
My SQL Skills Killed the ServerMy SQL Skills Killed the Server
My SQL Skills Killed the ServerdevObjective
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocolWoodruff Solutions LLC
 
Presentation_BigData_NenaMarin
Presentation_BigData_NenaMarinPresentation_BigData_NenaMarin
Presentation_BigData_NenaMarinn5712036
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic ConceptsTony Wong
 
Intro To TSQL - Unit 1
Intro To TSQL - Unit 1Intro To TSQL - Unit 1
Intro To TSQL - Unit 1iccma
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowPavithSingh
 

Similar a 2019 03 05_biological_databases_part5_v_upload (20)

2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_upload2018 03 27_biological_databases_part4_v_upload
2018 03 27_biological_databases_part4_v_upload
 
MIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome MeasuresMIS5101 WK10 Outcome Measures
MIS5101 WK10 Outcome Measures
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standards
 
Performance By Design
Performance By DesignPerformance By Design
Performance By Design
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
Module 3
Module 3Module 3
Module 3
 
Chapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdfChapter – 6 SQL Lab Tutorial.pdf
Chapter – 6 SQL Lab Tutorial.pdf
 
My SQL Skills Killed the Server
My SQL Skills Killed the ServerMy SQL Skills Killed the Server
My SQL Skills Killed the Server
 
Sql killedserver
Sql killedserverSql killedserver
Sql killedserver
 
Introduction to my_sql
Introduction to my_sqlIntroduction to my_sql
Introduction to my_sql
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocol
 
DBMS LAB M.docx
DBMS LAB M.docxDBMS LAB M.docx
DBMS LAB M.docx
 
MySQL Indexes
MySQL IndexesMySQL Indexes
MySQL Indexes
 
Presentation_BigData_NenaMarin
Presentation_BigData_NenaMarinPresentation_BigData_NenaMarin
Presentation_BigData_NenaMarin
 
Database Architecture and Basic Concepts
Database Architecture and Basic ConceptsDatabase Architecture and Basic Concepts
Database Architecture and Basic Concepts
 
AnzoGraph DB - SPARQL 101
AnzoGraph DB - SPARQL 101AnzoGraph DB - SPARQL 101
AnzoGraph DB - SPARQL 101
 
Intro To TSQL - Unit 1
Intro To TSQL - Unit 1Intro To TSQL - Unit 1
Intro To TSQL - Unit 1
 
Sql
SqlSql
Sql
 
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
 
Mysql Optimization
Mysql OptimizationMysql Optimization
Mysql Optimization
 

Más de Prof. Wim Van Criekinge (20)

P7 2018 biopython3
P7 2018 biopython3P7 2018 biopython3
P7 2018 biopython3
 
P6 2018 biopython2b
P6 2018 biopython2bP6 2018 biopython2b
P6 2018 biopython2b
 
P4 2018 io_functions
P4 2018 io_functionsP4 2018 io_functions
P4 2018 io_functions
 
P3 2018 python_regexes
P3 2018 python_regexesP3 2018 python_regexes
P3 2018 python_regexes
 
T1 2018 bioinformatics
T1 2018 bioinformaticsT1 2018 bioinformatics
T1 2018 bioinformatics
 
P1 2018 python
P1 2018 pythonP1 2018 python
P1 2018 python
 
2018 05 08_biological_databases_no_sql
2018 05 08_biological_databases_no_sql2018 05 08_biological_databases_no_sql
2018 05 08_biological_databases_no_sql
 
2018 03 20_biological_databases_part3
2018 03 20_biological_databases_part32018 03 20_biological_databases_part3
2018 03 20_biological_databases_part3
 
P7 2017 biopython3
P7 2017 biopython3P7 2017 biopython3
P7 2017 biopython3
 
P6 2017 biopython2
P6 2017 biopython2P6 2017 biopython2
P6 2017 biopython2
 
Van criekinge 2017_11_13_rodebiotech
Van criekinge 2017_11_13_rodebiotechVan criekinge 2017_11_13_rodebiotech
Van criekinge 2017_11_13_rodebiotech
 
P4 2017 io
P4 2017 ioP4 2017 io
P4 2017 io
 
T5 2017 database_searching_v_upload
T5 2017 database_searching_v_uploadT5 2017 database_searching_v_upload
T5 2017 database_searching_v_upload
 
P1 3 2017_python_exercises
P1 3 2017_python_exercisesP1 3 2017_python_exercises
P1 3 2017_python_exercises
 
P3 2017 python_regexes
P3 2017 python_regexesP3 2017 python_regexes
P3 2017 python_regexes
 
P2 2017 python_strings
P2 2017 python_stringsP2 2017 python_strings
P2 2017 python_strings
 
P1 2017 python
P1 2017 pythonP1 2017 python
P1 2017 python
 
2017 molecular profiling_wim_vancriekinge
2017 molecular profiling_wim_vancriekinge2017 molecular profiling_wim_vancriekinge
2017 molecular profiling_wim_vancriekinge
 
Mysql all
Mysql allMysql all
Mysql all
 
20170509 rand db_lesugent
20170509 rand db_lesugent20170509 rand db_lesugent
20170509 rand db_lesugent
 

Último

Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesVijayaLaxmi84
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxAneriPatwari
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 

Último (20)

Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their uses
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 

2019 03 05_biological_databases_part5_v_upload

  • 1.
  • 3.
  • 4. • SELECT Statement • Advanced SQL • First database schemes
  • 5. Selecta Statement (General) Select componentsb (MySQL version 4.0.X) 1. Select (required) 2. Expression (required) 3. From Table (Only optional if table data is not used) 4. Where Condition (optional) 5. Group By (optional) 6. Having (optional) 7. Order By (optional) 8. Limit (optional) aWords listed in blue above are key (reserved) words in MySQL, except “Expression” bThere are many more components in the select statement, but only the most common are discussed
  • 6. Select • Is a MySQL keyword at the beginning of a Structured Query Language (SQL) statement or more simply a query that retrieves data from a database. • It can be used in conjunction with the MySQL command insert, replace, and create table.
  • 7. Expression The “expression” 1. Selects which columns (by column name) will be retrieved 2. Apply MySQL functions on the columns of data Examples— * (Selects all columns in a table) temperature * 1.8 + 32a dt, temperature, relative_humidityb aApply arithmetic operations on a column bChoose multiple columns in single query Note: columns are in green, tables are in red, MySQL functions are in magenta.
  • 8. Expression Cont More Examples-- -1 * speed * sin( direction * pi() / 180 )c -1 * speed * cos( direction * pi() / 180 ) as Vd avg(temperature)e tableX.temperature, tableY.temperaturef cCan use built in mathematical functions. dThe ‘as’ keyword can be used to set the output column name. eCan retrieve a statistical value from rows of data. Must be used with ‘group by’. fThe select can retrieve or make relationships from multiple tables from a single query. Note the ‘.’ that separates the table name and column name.
  • 9. From Tells MySQL which table(s) to select froma aIf multiple tables are used in the expression, they all must be listed here seperated by a ‘,’
  • 10. Where Sets the condition of which rows to select. Useful for eliminating unwanted data from your results. Conditional > Greater than < Less than >= Greater than or equal to <= Less than or equal to = Equals != Not equals Logical and True if both are true or True if only one is true () Useful for grouping or ordering multiple logical statements String pattern matching like a MySQL keyword in-between column and pattern % a wildcard that matches all instances in a string _ a wildcard that matches only the character location
  • 11. Group By Aggregates rows by distinct values in the columns listed in the ‘group by’ when using statistical functions (e.g., avg, std, max, min, sum, count, etc.) Example-- group by site_ida group by site_id, month(dt)b aSingle column bMultiple columns and apply functions on a column
  • 12. Having Similar to where, except that it must follow ‘group by’ group, and only eliminates results after the results have been aggregated. See where for more details.
  • 13. WHERE and HAVING • WHERE refers to the rows of tables, and so cannot use aggregate functions • HAVING refers to the groups of rows, and so cannot use columns which are not in the GROUP BY • Think of a query being processed as follows: • Tables are combined • WHERE clauses • GROUP BY and Aggregates • Column selection • HAVING clauses • ORDER BY
  • 14. Order By • Orders the result rows defined by the columns in the ‘order by’ group • The keyword asc (ascending) and desc (descending) to change the order of the result rows, and is always at the end of the order by component. desc is the default. Examples— order by dt order by dt, site_ida aThe first column is ordered first, second column is ordered second on the ordering of the first column, and so on
  • 15. Order By Example mysql>select … order by site_id, month asc site_id month ave_temp 1 1 32.3 1 2 40.2 1 3 49.5 2 1 35.6 2 2 41.3 2 3 53.5
  • 16. Limit Limits the number of rows from the result set limit row_counta limit offset, row_countb aStarts at the first row bStarts at the offset row
  • 17. JOINS Explicit joins in SQL: Product(name, category) Purchase(prodName, store) Same as: SELECT Product.name, Purchase.store FROM Product JOIN Purchase ON Product.name = Purchase.prodName SELECT Product.name, Purchase.store FROM Product, Purchase WHERE Product.name = Purchase.prodName
  • 19. Modifying the Database Three kinds of modifications • Insertions • Deletions • Updates Sometimes they are all called “updates”
  • 20. Insertions General form: Missing attribute  NULL. May drop attribute names if give them in order. INSERT INTO R(A1,…., An) VALUES (v1,…., vn) INSERT INTO Purchase(buyer, seller, product, store) VALUES (‘Joe’, ‘Fred’, ‘wakeup-clock-espresso-machine’, ‘The Sharper Image’) Example: Insert a new purchase to the database:
  • 21. Insertions INSERT INTO PRODUCT(name) SELECT DISTINCT Purchase.product FROM Purchase WHERE Purchase.date > “10/26/01” The query replaces the VALUES keyword. Here we insert many tuples into PRODUCT
  • 22. Insertion: an Example INSERT INTO Product(name) SELECT DISTINCT prodName FROM Purchase WHERE prodName NOT IN (SELECT name FROM Product) name listPrice category gizmo 100 Gadgets camera - -
  • 23. Deletions DELETE FROM PURCHASE WHERE seller = ‘Joe’ AND product = ‘Brooklyn Bridge’ Factoid about SQL: there is no way to delete only a single occurrence of a tuple that appears twice in a relation. Example:
  • 24. Updates UPDATE PRODUCT SET price = price/2 WHERE Product.name IN (SELECT product FROM Purchase WHERE Date =‘Oct, 25, 1999’); Example:
  • 25. Indexes REALLY important to speed up query processing time. Suppose we have a relation Person (name, age, city) Sequential scan of the file Person may take long SELECT * FROM Person WHERE name = “Smith”
  • 26. • Create an index on name: • B+ trees have fan-out of 100s: max 4 levels ! Indexes Adam Betty Charles …. Smith ….
  • 27. Creating Indexes CREATE INDEX nameIndex ON Person(name) Syntax:
  • 28. Creating Indexes Indexes can be created on more than one attribute: CREATE INDEX doubleindex ON Person (age, city) SELECT * FROM Person WHERE age = 55 AND city = “Seattle” SELECT * FROM Person WHERE city = “Seattle” Helps in: But not in: Example:
  • 29. Creating Indexes Indexes can be useful in range queries too: B+ trees help in: Why not create indexes on everything? CREATE INDEX ageIndex ON Person (age) SELECT * FROM Person WHERE age > 25 AND age < 28
  • 30. Views are relations, except that they are not physically stored. For presenting different information to different users Employee(ssn, name, department, project, salary) Payroll has access to Employee, others only to Developers CREATE VIEW Developers AS SELECT name, project FROM Employee WHERE department = “Development”
  • 31. A Different View Person(name, city) Purchase(buyer, seller, product, store) Product(name, maker, category) We have a new virtual table: Seattle-view(buyer, seller, product, store) CREATE VIEW Seattle-view AS SELECT buyer, seller, product, store FROM Person, Purchase WHERE Person.city = “Seattle” AND Person.name = Purchase.buyer
  • 32. A Different View SELECT name, store FROM Seattle-view, Product WHERE Seattle-view.product = Product.name AND Product.category = “shoes” We can later use the view:
  • 33. 33 Types of Views • Virtual views: – Used in databases – Computed only on-demand – slower at runtime – Always up to date • Materialized views – Used in data warehouses – Precomputed offline – faster at runtime – May have stale data
  • 34. Grace
  • 35.
  • 36.
  • 37. # rsid chromosome position genotype rs4477212 1 82154 AA rs3094315 1 752566 AA rs3131972 1 752721 GG rs12124819 1 776546 AG rs11240777 1 798959 GG rs6681049 1 800007 CC rs4970383 1 838555 AC rs4475691 1 846808 CT rs7537756 1 854250 AG rs13302982 1 861808 GG rs1110052 1 873558 GT rs2272756 1 882033 AG rs3748597 1 888659 CC rs13303106 1 891945 AG rs28415373 1 893981 CC rs13303010 1 894573 AA rs6696281 1 903104 CC rs28391282 1 904165 GG rs2340592 1 910935 AG rs13303118 1 918384 GT rs6665000 1 924898 AC
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45. Chromsome 12 • Less than 1% of the population is able to survive on six hours of sleep and show minimal impairment (relates to the BHLHE41/DEC2 gene).
  • 46. Chromosome I March 19, 2019 46 Chromosome l contains more genetic information than any other chromosome: almost 10% of the entire human genome (240 Mb – 3000 Genes). 149 genetic diseases related to this chromosome have been identified; prostate cancer is one of them, the most frequent form of cancer affecting males.
  • 47.  Key observation by Levine and Stetson in 1939 that delivery of stillborn fetus and adverse reaction in mom to blood transfusion from father were related.  Syndrome in fetus is now referred to as hemolytic disease of the fetus and newborn (HDFN).  Syndrome had complicated pregnancies for decades causing severe jaundice and fetal death, “erythroblastosis fetalis”.  Erythroblastosis fetalis (HDN) linked with Anti-Rh by Levine in 1941.  Rh system IDENTIFIED by Landsteiner and Wiener in 1940.  Immunized animals to Rhesus macaque monkey RBCs.  Antibody agglutinated 100% of Rhesus and 85% of human RBCs.  Reactivity paralleled reactivity of sera in women who delivered infant suffering from hemolytic disease.  Later antigen detected by rhesus antibody and human antibody established to be dissimilar but system already named. March 19, 2019 47 Rh+/Rh-, History
  • 48.  D antigen, after A and B, is the most important RBC antigen in transfusion practice.  Individuals who lack D antigen DO NOT have anti-D.  Antibody produced through exposure to D antigen through transfusion or pregnancy.  Immunogenicity of D greater than that of all other RBC antigens studied.  Has been reported that 80%> of D neg individuals who receive single unit of D pos blood can be expected to develop immune anti-D.  Testing for D is routinely performed so D neg will be transfused with D neg. March 19, 2019 48 Rh+/Rh- Clinical Significance
  • 49. Rh+/Rh- The genes that determines the blood’s Rh factor appears to be the human genome’s oldest and most active gene. The Rh blood group system is one of the most complex of human beings, and it is the second in terms of importance in the field of blood transfusions — coming in just behind the ABO blood group system. • The Rh factor is determined by the presence or absence of the D antigen on the cell membranes of the red blood cells. • The Rh factor is always analyzed in pregnant women, blood donors, and recipients of blood • People who are Rh positive (Rh+) have the D antigen, while those who are Rh negative (Rh-) lack it. If, by accident, Rh+ blood enters the bloodstream of a Rh- individual, the immune system of the Rh- individual will produce specific antibodies that can cause a dangerous immune response. • The RhD and RhCE genes, which encode the Rh blood group antigens, are located on chromosome 1. The first Rhesus gene, the RHCE gene, was discovered in 1990. The RHD gene was found two years later, and the total deletion of this gene ascertained as the cause of the European D negative phenotype. More than 170 alleles have been found on the RHD gene since. The genetics of the Rhesus blood group system March 19, 2019 49
  • 50. March 19, 2019 50 Most mammals only have one RH gene, whose position corresponds to the human RHCE gene. The RHD gene arose from the duplication of an ancestral RH gene during mammalian evolution. An RHD deletion occurred during the evolution of hominids, so that many modern humans completely lack the RHD gene. This haplotype is the leading cause of the D negative phenotype worldwide. Rh+/Rh-
  • 51. March 19, 2019 51 The Rhesus protein in the erythrocyte membrane Both Rhesus proteins show 417 amino acids, shown here as circles. Mature proteins in the membrane lack the first amino acid. The amino acid substitutions which distinguish the RhD from the RhCE protein are shown in yellow, with the four amino acids which code for the C antigen in green and the one which codes for the E antigen in black. The single amino acid substitutions which code for partial D are in blue, those which code for weak D are in red. The mutations, identified by the Ulm group, are in light blue and orange. The clinically essential difference between Rhesus positive and Rhesus negative hinges on the presence or absence of the RhD protein in the erythrocyte membrane (D positive resp. D negative). Rh+/Rh-
  • 52. Genome Evolution March 19, 2019 52 Deletion of the RHD gene Deletion of the RHD gene resulted from recombination between an upstream and a downstream Rhesus box on two different chromosomes. This is termed an unequal crossover. When the two crossed strands separate (from A over the recombination site to B), the DNA at the RH gene site completely lacks the RHD gene (C). This haplotype (C) occurs in about 41% of the population. An individual homozygous for this haplotype (about 17% are) is D-negative.
  • 53. ACTA1 Estimating Muscle Force Although the information provided by the sensory receptors located in the muscles may be perceived subconsciously, it does allow us to make important calculations information about the length of the muscle, how rigid it is and the speed with which it changes its state enables the nervous system to control the general position of the body. This data is provided by two types of sensory receptors. The first type is located in the muscle itself and provides information about muscle length and speed with which it can change position. The other receptors are found in the tendons and detect tension and changes.
  • 55. Human Gene Map for Performance March 19, 2019 55 214 autosomal gene entries and quantitative trait loci, 7 on the X chromosome and 18 mitochondrial genes
  • 56. March 19, 2019 56 Human Gene Map for Performance
  • 58. Next Week – Status update • Show database • Show how database will be used • Which external database will be used • At least 3 interesting locus on the chromosome and related traits • Main goal: learn from each other approach, share some resources on github March 19, 2019 58