Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bioinformatics Query - Filtering Multiple Columns with "or"?

Status
Not open for further replies.

bioinformatic

Technical User
Oct 22, 2001
10
0
0
US
Hi all,

I am working on a bioinformatics database and need help in creating a filter. There are 23000 genes with 4 columns with numerical values. I would like to keep the genes that have a value >50 in at least one of the columns. If the gene has two columns with value >50 then the gene is kept, if the gene has no columns with value >50 then the gene is not kept.

ex.

Alpha-amylase 10 20 10 20 <--Filtered Out
ABA 50 05 02 10 <--Keep
GA 100 50 20 10 <--Keep
Calmodulin 100 100 100 100 <--Keep

I've tried working with &quot;or&quot; but it only works within the same column.

All help is greatly appreciated.

-Randy W.
 
In the query include all 5 fields, then Criteria for the first is >=50, for the second put the >=50 in the or collumn below criteria and so on. I just did it, it works.

g &quot;Man is the cheapest computer we can put into a spacecraft and the only one we can mass-produce with unskilled labor.&quot; Werner von Braun

 
The method you choose would only filter and display the list of genes that have values of > or equal to 50 in all 4 columns. It would leave out genes of interest which may only have >=50 in only one column.

Still thanks for your help. If you or anyone have any other ideas, it would be greatly appreciated.

-Randy W.
 
bioinformatic,

mycotropic has given you good information and It should work for you as you requested.
mycotropic said place &quot; >=50 in the or collumn below&quot;

the query needs to use the or clause

if col1 >=50 or col2 >=50 or col3 >=50 or col4 >=50 and as
he said place it in the or column

so in the QBE grid it will look like this
col1 col2 col3 col4
>=50
>=50
>=50
>=50

you are correct if you were to put the criteria straigt across it would return it wrong but try it as mycotropic said and I think it will work
good luck


 
I typed in the data you used, ran the query and got exactly the answer you were looking for. Are you sure that you're putting >=50 on different OR lines in the query? if you put >=50 in Criteria for each variable it will do as you said. If you put the into different OR lines for each variable it works fine.

g &quot;Man is the cheapest computer we can put into a spacecraft and the only one we can mass-produce with unskilled labor.&quot; Werner von Braun

 
Thanks mycotropic and braindead2,

I used the &quot;OR&quot; lines of the query and was able to get it working. Sorry for the confusion there.

I appreciate your help. Thanks!

-Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top