Sponsored Content
Top Forums Shell Programming and Scripting Find biggest values on replicates Post 302907893 by giuliangiuseppe on Wednesday 2nd of July 2014 09:06:23 AM
Old 07-02-2014
Hi
I am so sorry!!! I was in a hurry before and I did not check my message.

So my input file is like that:

Code:
ENSMUSG01 chr1 77837902 77853530 ENSMUSG02 chr2 18780447 18811972 ENSMUSG02 chr2 18780453 18811626 ENSMUSG02 chr2 18807356 18811987 ENSMUSG03 chr3 142575634 142576538 ENSMUSG03 chr3 142576507 142578095 ENSMUSG03 chr3 142576296 142576910 ENSMUSG03 chr3 142575558 142578120 ENSMUSG03 chr3 142575529 142578143

And my desired output should be like that:

Code:
ENSMUSG01 chr1 77837902 77853530 ENSMUSG02 chr2 18780447 18811972
ENSMUSG03 chr3 142575529 142578143

What I am looking for is for each ID (first column) calculate the difference between the column 3 and 4 and keep only the lane in which the difference is bigger.
Thank you again and if you have further question do not hesitate to post a reply!

Giuliano

---------- Post updated at 03:06 PM ---------- Previous update was at 03:03 PM ----------

SmilieSmilie
Hi
I am so sorry!!! I was in a hurry before and I did not check my message.

So my input file is like that:



Code:
ENSMUSG01 chr1 77837902 77853530 
ENSMUSG02 chr2 18780447 18811972 
ENSMUSG02 chr2 18780453 18811626 
ENSMUSG02 chr2 18807356 18811987 
ENSMUSG03 chr3 142575634 142576538 
ENSMUSG03 chr3 142576507 142578095 
ENSMUSG03 chr3 142576296 142576910 
ENSMUSG03 chr3 142575558 142578120 
ENSMUSG03 chr3 142575529 142578143

And my desired output should be like that:


Code:
ENSMUSG01 chr1 77837902 77853530 
ENSMUSG02 chr2 18780447 18811972 
ENSMUSG03 chr3 142575529 142578143

What I am looking for is for each ID (first column) calculate the difference between the column 3 and 4 and keep only the lane in which the difference is bigger.
Thank you again and if you have further question do not hesitate to post a reply!

Giuliano Image

Last edited by Scrutinizer; 07-02-2014 at 01:23 PM.. Reason: CODE tags
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Disk Usage in GB and Unix command to find the biggest file/folder

Hi All, Please help me out 1) Command to find the disk usage in GB. I know that du -k will give in kilobites. 2) How to find the Biggest file/folder in a given set of files/folders. Thanks in advance Regards, Manas (8 Replies)
Discussion started by: manas6
8 Replies

2. Shell Programming and Scripting

find values between values in two different fields

Hi, I need help to find values between two different fields based on $6 (NUM) AND $1 (CD), within the same ID. The result should show the values between the NUMs which will be extracted from within $3 and $2 in data.txt file below. data.txt ex 139 142 Sc_1000004 ID 4 CD ... (2 Replies)
Discussion started by: redse171
2 Replies

3. Shell Programming and Scripting

find biggest number inside file

Hi, I wanna find the biggest number inside of a file this is kind of example of file: 9 11 55 then i just wanna print out the biggest number i had try sed filenale | sort -k1,1n | paste -s -d',' - but i had no success ... (7 Replies)
Discussion started by: prpkrk
7 Replies

4. Shell Programming and Scripting

How to find biggest word in a file....?

With any cmd like sed grep ask etc... (1 Reply)
Discussion started by: sidpatil
1 Replies

5. Shell Programming and Scripting

Output minimum and maximum values for replicates ID

Hi All I hope that someone could help me! I have an input file like this, with 4 colum(ID, feature1, start, end): a x 1 5 b x 3 10 b x 4 9 b x 5 16 c x 5 9 c x 4 8 And my output file should be like this: a x 1 5 b x 3 16 c x 4 9 What I would like to do is to output for each ID... (2 Replies)
Discussion started by: giuliangiuseppe
2 Replies

6. Shell Programming and Scripting

Find smallest between replicates ID

Hi All I need to find the smallest values between replicates id (column1) Input file: a name1 1200 a name2 800 b name1 100 b name2 150 b name3 4output: a name2 800 b name3 4 Do you have any suggestion? Thank you! (9 Replies)
Discussion started by: giuliangiuseppe
9 Replies

7. Shell Programming and Scripting

Find larger on replicates and output

Hi All I have a question. I have a file like this: 10 name1 ID1 value1 value2 valueN.. 31 name2 ID1 value1 value2 valueN.. 20 name3 ID2 value1 value2 valueN.. 23 name4 ID2 value1 value2 valueN.. 33 name5 ID2 value1 value2 valueN.. 45 name6 ID2 value1 value2 valueN.. well, my output... (2 Replies)
Discussion started by: giuliangiuseppe
2 Replies

8. Shell Programming and Scripting

Merge row based on replicates ID

Dear All, I was wondering if you may help me with an issue. I would like to merge row based on column 1. input file: b1 ggg b2 fff NA NA hhh NA NA NA NA NA a1 xxx a2 yyy NA NA zzz NA NA NA NA NA a1 xxx NA NA a3 ttt NA ggg NA NA NA NA output file: b1 ggg b2 fff NA NA hhh NA NA NA NA NA... (5 Replies)
Discussion started by: giuliangiuseppe
5 Replies
All times are GMT -4. The time now is 05:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy