Normal format and scientific combined data


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Normal format and scientific combined data
# 1  
Old 07-08-2011
Normal format and scientific combined data

hi guys,

i have a data with a column of p value (normal format and scientific combined). i want to creat a subset of data which only contains p-value:
Code:
data 1: p<10^7
data 2: p<0.01

how should i do it? many thanks!

data looks like:
Code:
rs7841347  128887490 1.695e-007
rs1241347  127887790 1.985e-005
rs5641347  879887790 0.0001
rs56417     887790      0.98
...

lin

Last edited by radoulov; 07-08-2011 at 05:18 PM.. Reason: Code tags.
# 2  
Old 07-08-2011
What would the output look like for this input?
# 3  
Old 07-08-2011
output

the first output data (p<10^-7) looks like:
Code:
rs9765 23568  1.45e-008
rs1342 1235677 1.89e-009
.....

the 2nd output data (p<0.001) looks like:
Code:
rs9765 23568  1.45e-008
rs1342 1235677 1.89e-009
rs432 4386098 0.0004
.....

thanks!

Last edited by Scott; 07-09-2011 at 06:21 AM.. Reason: Code tags
# 4  
Old 07-10-2011
I have no idea how you're getting that output data from that input data.

---------- Post updated at 12:00 PM ---------- Previous update was at 11:55 AM ----------

Given your original input data:
Code:
$ awk -v P=10E7 '($3<P)' < data
rs7841347  128887490 1.695e-007
rs1241347  127887790 1.985e-005
rs5641347  879887790 0.0001
rs56417     887790      0.98
$ awk -v P=0.01 '($3<P)' < data
rs7841347  128887490 1.695e-007
rs1241347  127887790 1.985e-005
rs5641347  879887790 0.0001
$

Is this what you want?
# 5  
Old 07-10-2011
Hi, forevertl.

I'm with Corona688:
Quote:
I have no idea how you're getting that output data from that input data.
As we have often posted here:
Quote:
To obtain the best answers quickly when you want help in
processing datasets -- extracting, transforming, filtering,
then:

1. Post representative samples of your data (i.e. data that
should "succeed" and data that should "fail")

2. Post what you expect the results to be, instead of trying
only to describe them. Be clear about how the results are to be
obtained, e.g. "add field 2 in file1 to field 3 from file2"

3. Post what you have attempted to do so far.

4. Place the data and expected output within CODE tags, so that
they are more easily readable.

Special cases, exceptions, etc., are very important to include
in the samples.
Best wishes ... cheers, drl
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to control the decimal points for p-values in scientific format?

Dear all, I have a txt file with only one column which contains p values. My data looks like this: 5.04726976606584e-190 2.94065711152402e-189 2.94065711152402e-189 9.19932135717279e-176 1.09472516659859e-170 1.24974648916809e-170 0.1223974648916 0.9874974648916 ... what I want... (2 Replies)
Discussion started by: forevertl
2 Replies

2. Shell Programming and Scripting

Converting from scientific notation to normal

Hi everyone, I need to convert some numbers that are written in scientific notation to normal notation. Here is a sample line from my data file; "1",1,-1,0,0,502,0,0.00000000000E+00,0.00000000000E+00,0.35591163544E+03,0.35591163548E+03,0.50400001928E-02,0.,-1. first of all, my data file... (4 Replies)
Discussion started by: hayreter
4 Replies

3. Shell Programming and Scripting

Normal text to table format

Hi, I am trying to show my list, from a simple list format to a table (row and column formatted table) Currently i have this format in my output (the formart it will always be like this ) >> first 3 lines must be on the same line aligned, and the next 3 shud be on 2nd line....: INT1:... (10 Replies)
Discussion started by: eboye
10 Replies

4. Shell Programming and Scripting

EBCDIC Format to Normal String

Hi, I have EBCDIC format file and i wold like to convert normal string(user readable) in unix . The source having the binary IBM file format Sample Source Format: ... (3 Replies)
Discussion started by: koti_rama
3 Replies

5. Shell Programming and Scripting

IF statement on floating point variable in scientific format

Hi all, I'm struggling :wall: to make a an if statement on two variables in scientific format. e.g. a=1.23e+01 b=3.21e+02 I know that it can be done with bc if the variable are not in scientific format. But what to do in this case??? Thank you, (3 Replies)
Discussion started by: f_o_555
3 Replies

6. UNIX for Dummies Questions & Answers

awk for scientific notion and decimal combined data

Dea all, I have a question. I have a column of numbers with scientific notion and decimal combined data. I want to print it only if the number <0.05 using awk. however the very small numbers with scientific notion is not selected. Do any one know how to solve it? Thanks! example as below: ... (4 Replies)
Discussion started by: forevertl
4 Replies

7. Shell Programming and Scripting

mailx requirement - email body header in bold and data content in normal text

Dear all- I have a requirement to send an email via email with body content which looks something below- Email body contents -------------------- RequestType: Update DateAcctOpened: 1/5/2010 Note that header information and data content should be normal text.. Please advice on... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

8. Shell Programming and Scripting

Convert Epoch time format to normal date time format in the same file

I have a file named "suspected" with series of line like these : {'protocol': 17, 'service': 'BitTorrent KRPC', 'server': '219.78.120.166', 'client_port': 52044, 'client': '10.64.68.44', 'server_port': 8291, 'time': 1226506312L, 'serverhostname': ''} {'protocol': 17, 'service': 'BitTorrent... (3 Replies)
Discussion started by: rk4k
3 Replies

9. Shell Programming and Scripting

Exracting data from DB using normal login

Hi All, I ve a to extract data from oracle database . I already wrote code for the same ---------------------------------------------------------------------------------------- /u01/oracle/10.2/db_tst/bin/sqlplus -s $LOGIN/$PASS@$DBCONN <<-END > ${DSTDIR}/${FLNAME} set serveroutput on;... (7 Replies)
Discussion started by: malle
7 Replies

10. Shell Programming and Scripting

How to Convert scientific notation to normal ?

Hell friends, I wrote a script gets the summation of particular column using awk. The awk output is given in scientific notation. How do I convert the scientific notation to normal. My awk syntax : awk '{sum += $2} END { printf sum }' temprep.txt Out put is like 1.5365e+07 I want it as... (2 Replies)
Discussion started by: maheshsri
2 Replies
Login or Register to Ask a Question