Sponsored Content
Full Discussion: Snps annotation
Top Forums UNIX for Beginners Questions & Answers Snps annotation Post 302990583 by marwah on Saturday 28th of January 2017 09:35:05 PM
Old 01-28-2017
Snps annotation

I have the following Snps data
Code:
 CHROM	POS	ID
chr7	78599583	rs987435
chr15	33395779	rs987436
chr1	189807684	rs987437
chr20	33907909	rs987438
chr12	75664046	rs987439

and the following gene data
Code:
genename    name    chrom   strand  txstart txend
MAGI2	NM_001301128	chr7	-	77484309	78920826	77486567	78920572	21
MRPS18C	NM_001297769	chr4	+	84596108	84601900	84596254	84601206	5
MRPS18C	NM_001297767	chr4	+	84596108	84601900	84596254	84601374	5
GCOM1	NM_001018091	chr15	+	55671393	55797047	55671524	55794059	13
FAHD1	NM_001018104	chr16	+	1817225	1830204	1817231	1828128	3
FAM134B	NM_001034850	chr5	-	16526146	16670167	16527849	16670080	9

I'm trying to find the snp whose postion (POS) lie between the txstart and txend in the gene data
so for this data I have the first SNP will lie between MAGI2 txstart and txend

the out put should be
Code:
gene      ID        CHROM  POS       txstart      txend
MAGI2 rs987435 chr7 78599583 77484309 78920826

I have tried the following but it didn't work
Code:
awk '
FNR==1 {next}
FNR == NR {
        POS[++k]=$1
        ID[k]=$2
        next
}
{       for(i = 1; i <= k; i++)
                if(POS[i]>=$5 && POS[i]<=$6)
                        print $1, ID[i], $3, POS[i], $5, $6
}' pre_snpinfo_tumor.txt  refFlat.txt

snps data= pre_snoinfo_tumor.txt
gene dat=refFlat.txt

Last edited by marwah; 01-29-2017 at 05:10 AM..
 

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to average value if they have the same annotation names?

Hi I have a file like this input_fileCR387793 -0.8 CR387793 -5.5 CR387794 -5.3 CR387795 -0.9 AR388755 -3.0 AR388755 3.8 AR388755 4.5 Each line has annotation name and its correlated value. The annotation name and the value are seperated by a space. I want to average the value if the lines... (4 Replies)
Discussion started by: yuejian
4 Replies

2. UNIX for Advanced & Expert Users

Map snps into a ref gene file

I have the following data set about the snps ID txt file POS ID 78599583 rs987435 33395779 rs345783 189807684 rs955894 33907909 rs6088791 75664046 rs11180435 218890658 rs17571465 127630276 rs17011450 90919465 rs6919430 and a gene... (7 Replies)
Discussion started by: marwah
7 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 03:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy