Hello,
I have two files which look like this
File 1
Code:
Name test1 status P
Gene1 0.00236753 1 1.00E-01
Gene2 0.134187 2 2.00E-01
Gene3 0.000608716 2 3.00E-01
Gene4 0.0016234 1 4.00E-01
Gene5 0.000665868 2 5.00E-01
and file 2
Code:
No Pos rsid a1 a2 geneid categ wgt P
1 100 SNP1 a1 a2 Gene1 HIGH -0.67249 6.91E-01
2 200 SNP2 a1 a2 Gene1 HIGH -0.719 8.49E-01
3 300 SNP3 a1 a2 Gene1 MEDIUM 2.09 1.70E-01
4 400 SNP4 a1 a2 Gene1 HIGH -0.122172 6.91E-01
5 500 SNP5 a1 a2 Gene1 HIGH -0.906466 8.49E-01
6 600 SNP6 a1 a2 Gene1 HIGH -0.02618 9.88E-01
7 700 SNP7 a1 a2 Gene2 HIGH -0.999206 6.34E-01
8 800 SNP8 a1 a2 Gene2 HIGH -0.998448 8.67E-01
9 900 SNP9 a1 a2 Gene3 HIGH -0.059699 2.94E-01
10 1000 SNP10 a1 a2 Gene4 MEDIUM 2.19 4.79E-01
11 2000 SNP11 a1 a2 Gene4 VERY HIGH 2.3 7.19E-02
12 3000 SNP12 a1 a2 Gene4 HIGH -0.992672 1.55E-01
13 4000 SNP13 a1 a2 Gene4 HIGH -0.791565 3.50E-01
14 5000 SNP14 a1 a2 Gene5 LOW 0.860334608 6.67E-02
15 6000 SNP15 a1 a2 Gene5 LOW 0.805402062 2.09E-02
16 7000 SNP16 a1 a2 Gene5 VERY HIGH 0.430167304 6.67E-02
17 8000 SNP17 a1 a2 Gene5 VERY HIGH 0.727742605 7.53E-01
18 9000 SNP18 a1 a2 Gene5 HIGH -0.999286 5.41E-01
I would like to count the "SNPs" under column "rsid" from file 2 for each corresponding "Name" in file 1 and would like to output the lowest value "P" with the corresponding categ and rs ID from file 2. So from the example above, I require an output that looks like this
Code:
Name test1 status P no of SNPs Top rs ID Top categ Top P
Gene1 0.00236753 1 1.00E-01 6 SNP3 MEDIUM 1.70E-01
Gene2 0.134187 2 2.00E-01 2 SNP7 HIGH 6.34E-01
Gene3 0.000608716 2 3.00E-01 1 SNP9 HIGH 2.94E-01
Gene4 0.0016234 1 4.00E-01 4 SNP11 VERY HIGH 7.19E-02
Gene5 0.000665868 2 5.00E-01 5 SNP15 LOW 2.09E-02
Is it possible to do this with shell script ? Any help would be appreciated.
hi guys i need to extract information from log files generated by an application.
log file has the following lines for each process..
----------------------------------------------
Fri Aug 03 12:06:43 WST 2007 INFO: Running project PROJECT1
Fri Aug 03 12:06:43 WST 2007 INFO: Source Files... (7 Replies)
Anyone have a better idea to automate extraction of info like ...
"uname"
"ifconfig"
"ps efl"
"netstat -ao"
etc.
from several hundred aix, solaris, red hat boxes? without logging into each box and manually performing these tasks and dumping them to individual files?
thanks for any input (1 Reply)
I am not an expert in awk, SED, etc... but I really hope there is a way to do this, because I don't want to have to right a program. I am using C shell.
FILE 1 FILE 2
H0000000 H0000000
MA1 MA1
CA1DDDDDD CA1AAAAAA
MA2 ... (2 Replies)
I have this code
awk 'NR==FNR{a=$1;next} a' file1 file2
which does what I need it to do, but for only two files. I want to make it so that I can have multiple files (for example 30) and the code will return only the items that are in every single one of those files and ignore the ones... (7 Replies)
I have two files : Alpha and Beta.
The files are as follows (without arrow marks.)
Alpha:
A 1
D 90
G 11
B 24
C 15
Beta:
B 24
C 0 <--
G 11
D 20 <--
A 4 <--
E 777 <--
Expected output of the script :
Alpha: (2 Replies)
Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns.
I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Assume we have two files - FileA and FileB. Content of files are as shown below :
FileA:1001,value1,value4,value8,value9
1002,value4,value32,value46,value33
1503,value5,value45,value68,value53
1605,value4,value67,value56,value57
1073,value5,value45,value68,value53... (3 Replies)
file-roller(1) User Commands file-roller(1)NAME
file-roller - create, view, modify, or unpack an archive
SYNOPSIS
file-roller [--add] [--add-to=archive] [--default-dir=folder] [--extract] [--extract-to=folder] [--force] [--help] [--usage]
DESCRIPTION
The File Roller application enables you to create, view, modify, or unpack an archive. An archive is a file that acts as a container for
other files. An archive can contain many files, folders, and subfolders, usually in compressed form.
OPTIONS
The following options are supported:
--add Ask for the name of the archive, then add the files, then quit the application. You can also use -a to specify this
option.
--add-to=archive Add files to the specified archive, then quit the application. You can also use -d to specify this option.
--default-dir=folder Specify the default folder for the--add and --extract options.
--extract Ask for the name of the destination folder, then extract the files, then quit the application. You can also use -f
to specify this option.
--extract-to=folder Extract archives to the specified folder, then quit the application. You can also use -e to specify this option.
--force Create the destination folder without asking for confirmation.
--help Display help text. You can also use -? to specify this option.
--usage Display brief usage text.
EXAMPLES
Example 1: Unpacking an Archive
example% file-roller --extract archive
EXIT STATUS
The following exit values are returned:
0 Application exited successfully
>0 Application exited with failure
FILES
The following files are used by this application:
/usr/bin/file-roller Executable for File Roller application.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNW |
+-----------------------------+-----------------------------+
|Interface stability |External |
+-----------------------------+-----------------------------+
SEE ALSO
File Roller Manual
NOTES
Written by Laszlo Kovacs, Sun Microsystems Inc., 2003.
SunOS 5.10 29 Sep 2003 file-roller(1)