Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Help with processing coordinates in a file. Post 303030112 by RudiC on Wednesday 6th of February 2019 05:58:44 AM
Old 02-06-2019
Please explain how this line
Code:
Solyc00g005060.1.1    SL3.0ch02    702679    C    A    -    -    -    -    -    -    -    -

made it into the desired ouput - there is no connection between Solyc00g005060.1.1 and SL3.0ch02 in your annotation file, but it exists for the Solyc00g005000.3.1 and SL3.0ch02 pair. And, why isn't Solyc00g005050.3.1 / SL3.0ch00 mentioned? Shouldn't that match the third variation line?


Howsoever, pls try and report back
Code:
awk '
NR==FNR         {a[$2 FS $3 FS $4] = $1
                 next
                }
                {for (i in a) if (split (i,t) && $2>=t[2] && $2<=t[3])  print a[i], $0
                }
' annotation.txt variation.txt
Solyc00g005000.3.1 SL3.0ch02     702679    C     A     -     -     -     -     -     -     -     -    
Solyc00g005040.3.1 SL3.0ch00     715124    G     A     -     -     -     -     -     -     -     -
Solyc00g005060.1.1 SL3.0ch00     723860    A     C     Solyc00g005060.1     CDS     NONSYNONYMOUS     W/G     52    0    novel     DELETERIOUS (*WARNING! Low confidence)
Solyc00g005080.2.1 SL3.0ch00     723860    A     C     Solyc00g005060.1     CDS     NONSYNONYMOUS     W/G     52    0    novel     DELETERIOUS (*WARNING! Low confidence)
Solyc00g005060.1.1 SL3.0ch00     723867    A     C     Solyc00g005060.1     CDS     SYNONYMOUS     G/G     49    1    novel     TOLERATED
Solyc00g005080.2.1 SL3.0ch00     723867    A     C     Solyc00g005060.1     CDS     SYNONYMOUS     G/G     49    1    novel     TOLERATED
Solyc00g005060.1.1 SL3.0ch00     723903    T     C     Solyc00g005060.1     CDS     SYNONYMOUS     G/G     37    1    novel     TOLERATED

Its results match the desired output except for the two mentioned lines plus, mayhap, the field separators (which weren't specified, btw).
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Defining X and Y Coordinates Inside A Window

Hello, I am starting up an Xnest window and trying to place a program inside of it. I have the window inside of it now but it always spawns with the top left corner at (0, 0). I need to find a way to set the x and y coordinates to something other than (0, 0). I tried using the -geometry option... (1 Reply)
Discussion started by: lesnaubr
1 Replies

2. Shell Programming and Scripting

Search for particular tag and arrange as coordinates

Hi I have a file whose sample contents are shown here, 1.2.3.4->2.4.2.4 a(10) b(20) c(30) 1.2.3.4->2.9.2.4 a(10) c(20) 2.3.4.3->3.6.3.2 b(40) d(50) c(20) 2.3.4.3->3.9.0.2 a(40) e(50) c(20) 1.2.3.4->3.4.2.4 a(10) c(30) 6.2.3.4->2.4.2.5 c(10) . . . . Here I need to search... (5 Replies)
Discussion started by: AKD
5 Replies

3. Shell Programming and Scripting

place cursor in specific coordinates

Hi, I have this problem on how to place the cursor in a text editor (for example: pico). I made this script that would attach comments to a script file then open the script file, I would like to know how to place the cursor in a specific place, for example at the end of the comments, ... (1 Reply)
Discussion started by: lechelle
1 Replies

4. Shell Programming and Scripting

Pulling data by GPS coordinates from text file

Hi there, I'm having a problem trying to extract data from within a text file. I'm trying to extract this manually for a lack of better words. I need any items that fall within latitude 36.5 to 39.5 and long -75.3 to -83.9 I have been doing this using cat neta.txt | grep '!38' and working... (6 Replies)
Discussion started by: Mikey
6 Replies

5. Shell Programming and Scripting

Determination n points between two coordinates

Hi guys. Can anyone tell me how to determine points between two coardinates. For example: Which type of command line gives me 50 points between (8, -5, 7) and (2, 6, 9) points Thanks (5 Replies)
Discussion started by: rpf
5 Replies

6. Shell Programming and Scripting

Differential substring removal using coordinates

Hello all, this might be better suited for a bioinformatics forum, but I thought I'd try my luck here as well. I have several tabular text files of DNA sequence reads that appear as such: File_1.txt >H01BA45XW GATTACAGATTCGACATCCAACTGAGGCATT >H02BG78WR CCTTACAGACTGGGCATGAATATTGCATACC... (3 Replies)
Discussion started by: vectorborne5
3 Replies

7. UNIX for Dummies Questions & Answers

overlapped genomic coordinates

Hi, I would like to know how can I get the ID of a feature if its genomic coordinates overlap the coordinates of another file. Example: Get the 4th column (ID) of this file1: chr1 10 100 gene1 chr2 3000 5000 gene2 chr3 200 1500 gene3 if it overlaps with a feature in this file2: chr2... (1 Reply)
Discussion started by: fadista
1 Replies

8. Programming

awk processing / Shell Script Processing to remove columns text file

Hello, I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this : This is the output of ls command : I stored the output in a file filelist 1.1M... (5 Replies)
Discussion started by: ajayram
5 Replies

9. Shell Programming and Scripting

Reducing the decimal points of numbers (3d coordinates) in a file; how to input data to e.g. Python

I have a file full of coordinates of the form: 37.68899917602539 58.07500076293945 57.79100036621094 The numbers don't always have the same number of decimal points. I need to reduce the decimal points of all the numbers (there are 128 rows of 3 numbers) to 2. I have tried to do this... (2 Replies)
Discussion started by: crunchgargoyle
2 Replies

10. Shell Programming and Scripting

Add coordinates to line of output extracted from input file

I am trying to compare/confirm the output of an script using the perl below, which does execute. However I can not seem to print $1 and $2 in each line of the input separated by a tab in each line of the output. The input file is quite large so I have only included a portion, but the format is the... (0 Replies)
Discussion started by: cmccabe
0 Replies
GLUPROJECT(3G)															    GLUPROJECT(3G)

NAME
gluProject - map object coordinates to window coordinates C SPECIFICATION
GLint gluProject( GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ ) PARAMETERS
objX, objY, objZ Specify the object coordinates. model Specifies the current modelview matrix (as from a glGetDoublev call). proj Specifies the current projection matrix (as from a glGetDoublev call). view Specifies the current viewport (as from a glGetIntegerv call). winX, winY, winZ Return the computed window coordinates. DESCRIPTION
gluProject transforms the specified object coordinates into window coordinates using model, proj, and view. The result is stored in winX, winY, and winZ. A return value of GL_TRUE indicates success, a return value of GL_FALSE indicates failure. To compute the coordinates, let v = (objX, objY, objZ, 1.0) represented as a matrix with 4 rows and 1 column. Then gluProject computes v' as follows: v' = P X M X v where P is the current projection matrix proj, M is the current modelview matrix model (both represented as 4x4 matrices in column-major order) 'X' represents matrix multiplication. The window coordinates are then computed as follows: winX = view(0) + view(2) * (v'(0)+1)/2 winY = view(1) + view(3) * (v'(1)+1)/2 winZ = (v'(2) + 1) / 2 SEE ALSO
glGet, gluUnProject GLUPROJECT(3G)
All times are GMT -4. The time now is 08:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy