Sponsored Content
Full Discussion: Find flanking positions
Top Forums Shell Programming and Scripting Find flanking positions Post 302969434 by RudiC on Tuesday 22nd of March 2016 04:30:33 PM
Old 03-22-2016
How come your ch1 400 line is "flanked" by the ch2 567 line? If the chromosome doesn't need to match, why then wouldn't ch3 456 flank the 400 line?

---------- Post updated at 21:30 ---------- Previous update was at 21:26 ----------

SHOULD the chromosome matter, this might work:
Code:
awk '
BEGIN           {print "QueryMarker     Chromosome      Position        Left    pos     Right   Pos"}
NR == FNR       {T1[NR] = $1
                 T2[NR] = $2
                 T3[NR] = $3
                 MX     = NR
                 next
                }

                {for (m=1; m<=MX; m++)  {if (T2[m] != $2) continue
                                         if (T3[m] <= $3) continue 
                                         print $0, T1[m-1], T3[m-1], T1[m], T3[m]
                                        }
                }
' file1 OFS="\t" file2
QueryMarker     Chromosome      Position        Left    pos     Right   Pos
Q1      ch1     43      m2      5       m3      50
Q3      ch3     2000    m9      456     m10     2315

This User Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to find non overlapping positions

Hi, I am a newbie in unix programming so maybe this is a simple question. I would like to know how can I make a script that outputs only the values that are not between any given start and end positions Example file1: 2 30 40 80 82 100 file2: ID1 1 ID2 35 ID3 80 ID4 81 ID6 160... (1 Reply)
Discussion started by: fadista
1 Replies

2. Shell Programming and Scripting

awk script replace positions if certain positions equal prescribed value

I am attempting to replace positions 44-46 with YYY if positions 48-50 = XXX. awk -F "" '{if (substr($0,48,3)=="XXX") $44="YYY"}1' OFS="" $filename > $tempfile But this is not working, 44-46 is still spaces in my tempfile instead of YYY. Any suggestions would be greatly appreciated. (9 Replies)
Discussion started by: halplessProblem
9 Replies

3. UNIX for Dummies Questions & Answers

find positions of a letter in a text file

Hi, I would like to know how can I get all the positions of a letter, let say letter C in a text file. sample input file: hcck pgog hlhhc desired output file: 2 3 13 Many thanks! (2 Replies)
Discussion started by: fadista
2 Replies

4. Shell Programming and Scripting

sed using data in two different positions

Hi, I cannot figure out how to input a greater than command for a item of data that may be in two different positions. my input file looks like this. isup,isupmap,2011,05,10 isup,isupmap,2011,05,11 isup,isupmap,2011,05,12 pcap,2011,05,10 pcap,2011,05,11 pcap,2011,05,12 You will see... (2 Replies)
Discussion started by: imarcs
2 Replies

5. Shell Programming and Scripting

awk regardless positions

brw------- 1 oracle dba 49, 21 Apr 05 11:45 dprod_0000018 brw------- 1 oracle dba 49, 26 Apr 05 11:45 dprod_0000019 brw------- 1 oracle dba 43, 93 Feb 02 2011 dprod_000002 brw------- 1 oracle dba 49, 27 Apr 05 11:45 dprod_0000020... (4 Replies)
Discussion started by: Daniel Gate
4 Replies

6. Shell Programming and Scripting

Modifying a sequence using positions!

Hi.. i have two files one with positions information and another is sequence information. Now i need to read the positions and take the snps at the positions and replace that position base with the snp information in the sequence and write it in the snp information file.. for example Snp file... (6 Replies)
Discussion started by: empyrean
6 Replies

7. Shell Programming and Scripting

Obtain the names of the flanking regions

Hi I have 2 files; usually the end position in the file1 is the start position in the file2 and the end position in file2 will be the start position in file1 (flanks) file1 Id start end aaa1 0 3000070 aaa1 3095270 3095341 aaa1 3100822 3100894 aaa1 ... (1 Reply)
Discussion started by: anurupa777
1 Replies

8. UNIX for Dummies Questions & Answers

Replace alphabets from certain positions

Hi all, I have column 2 full of values like HIVE4A-56 and HIVE4-56. I want to convert all values like HIVE4A-56 to HIVE4-56. So basically I want to delete all single alphabets before the '-' which is always preceded by a number. Values already in the desired format should remain unchanged... (4 Replies)
Discussion started by: ames1983
4 Replies

9. Shell Programming and Scripting

Join based on positions

I have two text files as shown below cat file1.txt Id leng sal mon 25671 34343 56565 5565 44888 56565 45554 6868 23343 23423 26226 6224 77765 88688 87464 6848 66776 23343 63463 4534 cat file2.txt Id number 25671 34343 76767 34234 23343 23423 66776 23343 (4 Replies)
Discussion started by: halfafringe
4 Replies
CURL_MULTI_STRERROR(3)							 1						    CURL_MULTI_STRERROR(3)

curl_multi_strerror - Return string describing error code

SYNOPSIS
string curl_multi_strerror (int $errornum) DESCRIPTION
Returns a text error message describing the given CURLM error code. PARAMETERS
o $errornum - One of the CURLM error codes constants. RETURN VALUES
Returns error string for valid error code, NULL otherwise. EXAMPLES
Example #1 curl_multi_strerror(3) example <?php // Create cURL handles $ch1 = curl_init("http://example.com"/); $ch2 = curl_init("http://php.net/"); // Create a cURL multi handle $mh = curl_multi_init(); // Add the handles to the multi handle curl_multi_add_handle($mh, $ch1); curl_multi_add_handle($mh, $ch2); // Execute the multi handle do { $status = curl_multi_exec($mh, $active); // Check for errors if($status > 0) { // Display error message echo "ERROR! " . curl_multi_strerror($status); } } while ($status === CURLM_CALL_MULTI_PERFORM || $active); ?> SEE ALSO
curl_strerror(3), cURL error codes. PHP Documentation Group CURL_MULTI_STRERROR(3)
All times are GMT -4. The time now is 07:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy