pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliveiros d'Azevedo Cristina <oliveiros.cristina@marktest.pt>
To: Adrian Johnson <oriolebaltimore@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Help with queries.
Date: Tue, 21 Sep 2010 17:11:51 +0100
Message-ID: <13622609C3E64F38B9187B90F12F3049@marktestcr.marktest.pt> (raw)
References: <AANLkTi=zPe07+3VhiacYHUfcam_-QWRGbjVUfXeYLsY=@mail.gmail.com>

Howdy, Adrian,
Please see my questions below

> snps table
>
> id   |   sample_id | chromosome | from  | to |
> ----------------------------------------------------------------
> 1         1                chr1             10       11
> 2          1              chr1               14       15
> 3          2              chr1               14       15
> 4         2               chr1                9         10
> 5         3              chr1                14        15
> 6          3             chr14              35        36
> 7          3             chr14              39        40
> 8          2             chr14              39        40
> 9          2             chr14              43        44
> 10        1             chr14              43        44
>
>
> gene table:
>
> id |   chromosome | from | to  | genename
> 1         chr1            4       20    SRC
> 2         chr1           25      45    SRC
> 3         chr1           80      100   CSK
> 4         chr1          120     140   CSK
>
> My aim is to for a gene in gene table (SRC that has two ranges 4-20 and 
> 25-45),
> I want to map all coordinates in snps table.

Please advice me,
What do you call coordinates to, exactly? Sorry, my genetics knowledge is 
very poor.
You call the from and to fields coordinates?
Do they have the same meaning as the from and to fields from table snps ?
What does it mean to map all coordinates in table snps?
Do you wanna know which  entries from snps map in the SRC gene?
Coordinates are the segment where the gene/sample fit in the chromosome? Is 
my understanding correct ?

> Then I want to get those entries where sample 1 and sample 2 have in
> common and sample 1 and sampl3 in common.
>

Could you give an example of your desired output, for the data you have ?

>
> I do not know how to get these entries. Could any one help me please.
>
> thank you.
>
> adrian
>

Best,
Oliver

> -- 
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql 




view thread (3+ messages)  latest in thread

Message-ID: <13622609C3E64F38B9187B90F12F3049@marktestcr.marktest.pt>
Permalink:  ../13622609C3E64F38B9187B90F12F3049@marktestcr.marktest.pt/
Also on:    postgresql.org/message-id/13622609C3E64F38B9187B90F12F3049@marktestcr.marktest.pt

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: oliveiros.cristina@marktest.pt, oriolebaltimore@gmail.com
  Subject: Re: Help with queries.
  In-Reply-To: <13622609C3E64F38B9187B90F12F3049@marktestcr.marktest.pt>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox