Sponsored Content
Top Forums Shell Programming and Scripting Print every 5 4th column values as separate row with different first column Post 302771400 by jacobs.smith on Wednesday 20th of February 2013 02:15:12 PM
Old 02-20-2013
Print every 5 4th column values as separate row with different first column

Hi,

I have the following file,

Code:
chr1 100 200 20
chr1 201 300 22
chr1 220 345 23
chr1 230 456 33.5
chr1 243 567 90
chr1 345 600 20
chr1 430 619 21.78
chr1 870 910 112.3
chr1 914 920 12
chr1 930 999 13

My output would be

Code:
peak1 20 22 23 33.5 90
peak2 20 21.78 112.3 12 13

Here the name "peak" should be in the code.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to read the column and print the values under that column

hi all:b:, how to read the column and print the values under that column ...?? file1 have something like this cat file1 ======= column1, column2,date,column3,column4..... 1, 23 , 12/02/2008,...... 2, 45, 14/05/2008,..... 3, 56, 16/03/2008,..... cat file2 =======... (6 Replies)
Discussion started by: gemini106
6 Replies

2. Shell Programming and Scripting

print unique values of a column and sum up the corresponding values in next column

Hi All, I have a file which is having 3 columns as (string string integer) a b 1 x y 2 p k 5 y y 4 ..... ..... Question: I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
Discussion started by: amigarus
6 Replies

3. Shell Programming and Scripting

Remove duplicates within row and separate column

Hi all I have following kind of input file ESR1 PA156 leflunomide PA450192 leflunomide CHST3 PA26503 docetaxel Pa4586; thalidomide Pa34958; decetaxel docetaxel docetaxel I want to remove duplicates and I want to separate anything before and after PAxxxx entry into columns or... (1 Reply)
Discussion started by: manigrover
1 Replies

4. UNIX for Dummies Questions & Answers

awk to print first row with forth column and last row with fifth column in each file

file with this content awk 'NR==1 {print $4} && NR==2 {print $5}' file The error is shown with syntax error; what can be done (4 Replies)
Discussion started by: cdfd123
4 Replies

5. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

6. Shell Programming and Scripting

Print row on 4th column to all row

Dear All, I have input : SEG901 5173 9005 5740 SEG902 5227 5284 SEG903 5284 5346 SEG904 5346 9010 SEG905 5400 5456 SEG906 5456 5511 SEG907 5511 9011 SEG908 5572 9015 SEG909 5622 9020 SEG910 5678 5739 SEG911 5739 5796 SEG912 5796 9025 ... (3 Replies)
Discussion started by: attila
3 Replies

7. Shell Programming and Scripting

Read 4th column and print those many rows

Hi, My input file chr1 3217769 3217789 2952725-5 255 + chr1 3260455 3260475 2434087-6 255 - My desired output chr1 3217769 3217789 2952725-1 255 + chr1 3217769 3217789 2952725-2 255 + chr1 3217769 3217789 2952725-3 255 + chr1 3217769 3217789 2952725-4 255 +... (7 Replies)
Discussion started by: jacobs.smith
7 Replies

8. Shell Programming and Scripting

Changing values only in 3rd column and 4th column

#cat file testing test! nipw asdkjasjdk ok! what !ok host server1 check_ssh_disk!102.56.1.101!30!50!/ other host server 2 des check_ssh_disk!192.6.1.10!40!30!/ #grep check file| awk -F! '{print $3,$4}'|awk '{gsub($1,"",$1)}1' 50 30 # Output: (6 Replies)
Discussion started by: kenshinhimura
6 Replies

9. Shell Programming and Scripting

Print first row of column a, last row of column b if column a has the same value

I have a table with this structure: cola colb colc 1 19 lemon 20 31 lemon 32 100 lemon 159 205 cherries 210 500 cherries and need to parse it into this format: cola colb colc 1 100 lemon 159 500 cherries So I need the first row of cola and the last row of colb if colc has the... (3 Replies)
Discussion started by: coppuca
3 Replies

10. UNIX for Beginners Questions & Answers

If pattern in column 3 matches pattern in column 2 (any row), print value in column 1

Hi all, I have searched and searched, but I have not found a solution that quite fits what I am trying to do. I have a long list of data in three columns. Below is a sample: 1,10,8 2,12,10 3,13,12 4,14,14 5,15,16 6,16,18 Please use code tags What I need to do is as follows: If a... (4 Replies)
Discussion started by: bleedingturnip
4 Replies
Bio::Graphics::Glyph::wiggle_box(3pm)			User Contributed Perl Documentation		     Bio::Graphics::Glyph::wiggle_box(3pm)

NAME
Bio::Graphics::Glyph::wiggle_box - A generic box glyph compatible with dense "wig"data SYNOPSIS
See <Bio::Graphics::Panel> and <Bio::Graphics::Glyph>. DESCRIPTION
This glyph works like the regular 'box' glyph but takes value data in Bio::Graphics::Wiggle file format: reference = chr1 ChipCHIP Feature1 1..10000 wigfile=./test.wig;wigstart=0 ChipCHIP Feature2 10001..20000 wigfile=./test.wig;wigstart=656 ChipCHIP Feature3 25001..35000 wigfile=./test.wig;wigstart=1312 The "wigfile" attribute gives a relative or absolute pathname to a Bio::Graphics::Wiggle format file. The optional "wigstart" option gives the offset to the start of the data. If not specified, a linear search will be used to find the data. The data consist of a packed binary representation of the values in the feature, using a constant step such as present in tiling array data. This glyph is intended for dense, qualitative feature data. Any score data for each data point is only evaluated for true/false, when true, a box of the specified bgcolor is drawn, when false, nothing is drawn. No data smoothing is used. Two primary benefits of using this glyph (with wiggle data) are: 1) For large, genome-wide data sets, the speed of panel rendering is greatly improved. 2) Large sets of related features can be rendered as a UCSC-style subtrack without the need for aggregation or a GFF3 containment hierarchy. A disadvantage to this approach is that individual features will have no attributes associated with them and will appear as anonymous blocks within a sub-track. An example use for this glyph is annotated transcribed regions from microarray experiments. Such regions are identified based on raw microarray data but do not necessarily have a score associated with them. In this case, using the wiggle_box glyph provides a graphical summary of an expression array experiment. DATA The wiggle data used for this glyph should be loaded using the 'BED' format in order to allow features of variable width. The fourth column should be a true value, with numeric or ".". An example is shown below: track type=wiggle_0 name="transfrags" description="D. melanogaster transcribed fragments 0-2hrs" 2L 9309 9451 1 2L 10697 11021 1 2L 11101 11345 1 2L 11410 11521 1 2L 11771 12243 1 2L 12314 12954 1 2L 13516 15746 1 2L 17033 17191 1 2L 18232 18580 1 2L 19860 19999 1 OPTIONS This glyph accepts the standard generic option set. It differs in that the label and description and title/mouseover labels apply to the whole, panel-wide sub-track feature rather than to individual boxes. See Bio::Graphics::Glyph::wiggle_xyplot for a description of the wiggle-specific options and data formats. BUGS
Please report them. SEE ALSO
Bio::Graphics::Panel, Bio::Graphics::Glyph, Bio::Graphics::Glyph::arrow, Bio::Graphics::Glyph::cds, Bio::Graphics::Glyph::crossbox, Bio::Graphics::Glyph::diamond, Bio::Graphics::Glyph::dna, Bio::Graphics::Glyph::dot, Bio::Graphics::Glyph::ellipse, Bio::Graphics::Glyph::extending_arrow, Bio::Graphics::Glyph::generic, Bio::Graphics::Glyph::graded_segments, Bio::Graphics::Glyph::heterogeneous_segments, Bio::Graphics::Glyph::line, Bio::Graphics::Glyph::pinsertion, Bio::Graphics::Glyph::primers, Bio::Graphics::Glyph::rndrect, Bio::Graphics::Glyph::segments, Bio::Graphics::Glyph::ruler_arrow, Bio::Graphics::Glyph::toomany, Bio::Graphics::Glyph::transcript, Bio::Graphics::Glyph::transcript2, Bio::Graphics::Glyph::translation, Bio::Graphics::Glyph::allele_tower, Bio::DB::GFF, Bio::SeqI, Bio::SeqFeatureI, Bio::Das, GD AUTHOR
Sheldon McKay <mckays@cshl.edu>. Copyright (c) 2008 Cold Spring Harbor Laboratory This package and its accompanying libraries is free software; you can redistribute it and/or modify it under the terms of the GPL (either version 1, or at your option, any later version) or the Artistic License 2.0. Refer to LICENSE for the full license text. In addition, please see DISCLAIMER.txt for disclaimers of warranty. perl v5.14.2 2012-02-20 Bio::Graphics::Glyph::wiggle_box(3pm)
All times are GMT -4. The time now is 07:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy