Sponsored Content
Top Forums Shell Programming and Scripting UNIX compare, sort lines and append difference Post 302843484 by nike27 on Tuesday 13th of August 2013 04:08:50 PM
Old 08-13-2013
yes, it should be fine. Basically, i am looking for three columns that can be feed back to process the file.

so from following:

Code:
ES FP,SL22 (70000)|XX22 (80000)
VIL SJ,SL22 (20000)|XX22 (20000)
VIL SJ,SL22 (25040222)|XX22 (25040222)
MING NO,SL22 (240000)|XX22 (240000)
BCHN SE,SL22 (20000)|XX22 (20000)
BCHN SE,SL22 (100000)|XX22 (100000)
DLAR LN,SL22 (50000)|XX22 (50000)

it needs to be converted to:

Code:
ES FP,SL22 (70000)|XX22 (80000)
VIL SJ,SL22 (20000)|XX22 (20000),SL22 (25040222)|XX22 (25040222)
MING NO,SL22 (240000)|XX22 (240000)
BCHN SE,SL22 (20000)|XX22 (20000),SL22 (100000)|XX22 (100000)
DLAR LN,SL22 (50000)|XX22 (50000)

---------- Post updated at 02:32 PM ---------- Previous update was at 12:50 PM ----------

lines can be anywhere in the file and it can be more than more two lines.

---------- Post updated at 02:36 PM ---------- Previous update was at 02:32 PM ----------

also i sorted so it is always consecutive.

---------- Post updated at 04:08 PM ---------- Previous update was at 02:36 PM ----------

Any thoughts , thanks in advance.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Replace,Sort,and Append Character one script

Hi all i am very new to shell scripting,hope u guys can help i need to replace,sort and append character for the file that look like this: 1007032811010001000100000001X700026930409 1007032811010001000200000002X700026930409 1007032711020001000300000003X700026930409... (2 Replies)
Discussion started by: ashikin_8119
2 Replies

2. Shell Programming and Scripting

Compare & append

I need to write a Shell Script to compare two files & display the result. If the two files are different append them and store them in a new file. How do i proceed...can someone give me a coding ? (3 Replies)
Discussion started by: rohits1991
3 Replies

3. Shell Programming and Scripting

Compare two files and print the two lines with difference

I have two files like this: #FILE 1 ABCD 4322 26485 JMTJ 5311 97248 XMPJ 4321 58978 #FILE 2 ABCD 4321 26485 JMTJ 5311 97248 XMPJ 4321 68978 What to do: Compare the two files and find those lines that doesn't match. And have a new file like this: #FILE 3 "from file 1" ABCD 4322 26485... (11 Replies)
Discussion started by: kingpeejay
11 Replies

4. Shell Programming and Scripting

difference in unix vs. linux sort

Hi, I am using some codes that have been ported from unix to linux, and now the sorting no longer results in the desired ordering. I'm hoping to find a way to mimic the unix sort command in linux. The input file is structured the following: $> cat file.txt... (6 Replies)
Discussion started by: aj.schaeffer
6 Replies

5. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

6. UNIX for Dummies Questions & Answers

append following lines to 1st line, every 3 lines

I have output like this: USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 ... where USER_ID is a unique user login followed by their login timestamp and... (6 Replies)
Discussion started by: MaindotC
6 Replies

7. Shell Programming and Scripting

UNIX compare, sort lines and append difference

Hi, I have a file that needs to be converted: content is: a, b, 4 a ,b, 5 x, y, 1 a, b, 1 x, y, 3 how can i get: a, b, 1|4|5 x,y 1|3 (1 Reply)
Discussion started by: nike27
1 Replies

8. Shell Programming and Scripting

UNIX compare, sort lines and append difference

To make it easier, i gave following example. It is not homework or classwork. Instead, i have a huge csv file dump from tsql with 15 columns and around 300 rows. I was able to extract content that needs to be really converted. Here is the extract: ES FP,B1ES FP,70000,I,SL22,SL22 (70000) ES... (0 Replies)
Discussion started by: nike27
0 Replies

9. Shell Programming and Scripting

Compare file1 for matching line in file2 and print the difference in matching lines

Hello, I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Discussion started by: RasB15
2 Replies

10. UNIX for Beginners Questions & Answers

Difference of Sort -n -k2 -k3 & Sort -n -k2,3

Hi, Could anyone kindly show me a link or explain the difference between sort -n -k2 -k3 & sort -n -k2,3 Also, if I like to remove the row with repetition at both $2 and $3, Can I safely use sort -u -k2 -k3 Example; 100 20 30 100 20 30 So, both $2 and $3 are same and I... (2 Replies)
Discussion started by: Indra2011
2 Replies
Bio::Graphics::Glyph::merged_alignment(3pm)		User Contributed Perl Documentation	       Bio::Graphics::Glyph::merged_alignment(3pm)

NAME
Bio::Graphics::Glyph::merged_alignment - The "merged_alignment" glyph SYNOPSIS
See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>. DESCRIPTION
This glyph acts like graded_segments but the bgcolor of segments (sub-feature) is controlled by binned scores. It also supports semantic zooming to optimize glyph drawing for larger sequence displays. OPTIONS The following options are standard among all Glyphs. See Bio::Graphics::Glyph for a full explanation. Option Description Default ------ ----------- ------- -fgcolor Foreground color black -outlinecolor Synonym for -fgcolor -bgcolor Background color turquoise -fillcolor Synonym for -bgcolor -linewidth Line width 1 -height Height of glyph 10 -font Glyph font gdSmallFont -connector Connector type 0 (false) -connector_color Connector color black -label Whether to draw a label 0 (false) -description Whether to draw a description 0 (false) -hilite Highlight color undef (no color) In addition, the merged-alignment glyph recognizes the following glyph-specific options: Option Description Default ------ ----------- ------- -max_score Maximum value of the Calculated feature's "score" attribute -min_score Minimum value of the Calculated feature's "score" attribute -bincolors Colors assigned to bins lightgrey powderblue cornflowerblue blue (in order) -bins Bins to which scores are Calculated assigned -merge_parts 0 (false) Whether to simplify the alignment at low magnification -max_gap Do not merge across gaps Calculated that exceed this threshold If max_score and min_score are not specified, then the glyph will calculate the local maximum and minimum scores at run time. If the bins are not specified, they will be calculated based on the number of colors assigned and the local (or user-specified) minimum and maximum scores. Calculated bins are equal in size. User-specified bins are expressed as ranges, bins = 0-50 50-70 70-90 90-100 where each range means greater than the lower number and less than or equal to the higher number. Simplifying the display of alignment features for large segments The "merge_parts" option is used for semantic zooming. Specifically, if features are small and dense, they will not be displayed very well for large segments and the color-coding will be lost. If merge-parts is set to a true value, adjacent alignment parts will be merged until a gap exceeding a calculated or user-specified value is encountered. Unless specified, the maximum gap allowed for merging adjacent features is calculated as (L/10000)*(L/500), where L = the length of the sequence displayed in the browser. The exponentially increasing gap threshold allows more aggressive merging of alignment features as the size of the displayed sequence grows larger. The score of the merged feature is calculated as a weighted average. For example, consider two adjacent HSPs that are each 400 bp in length and have scores of 60% and 70%. If the merge_parts option is set to a true value, the two HSPs would be merged in the display to a single 800 bp alignment block with an average score of 65%. The merge_parts option is turned off by default. SAMPLE CONFIGURATION Sample gbrowse configuration stanzas for an alignment feature using this glyph. The scores are assumed to be expressed as percent identity (0-100). # base configuration [BLASTZ] feature = blastz_alignment glyph = merged_alignment bincolors = #A0A0A0 powderblue cornflowerblue blue bins = 60-70 70-80 80-90 90-100 category = Sequence Similarity Tracks height = 6 bump = 1 label = 1 fgcolor = black key = BLASTZ Semantic zooming with defined maximum gap between merged features for different zoom levels # if the displayed segment is >= 20000 in length, # use the merge_parts option to simplify the alignment # display [BLASTZ:20000] feature = blastz_alignment merge_parts = 1 max_gap = 50 # do not merge across gaps > 50 bp # if the displayed segment is >= 50000 in length [BLASTZ:50000] feature = blastz_alignment merge_parts = 1 max_gap = 500 # do not merge across gaps > 500 bp --OR-- Semantic zooming with dynamically calculated maximum gap # if the displayed segment is >= 20000 in length, [BLASTZ:20000] feature = blastz_alignment merge_parts = 1 BUGS
Please report them. SEE ALSO
Bio::Graphics::Panel, Bio::Graphics::Glyph Bio::DB::GFF, Bio::SeqI, Bio::SeqFeatureI, Bio::Das, GD AUTHOR
Sheldon McKay <mckays@cshl.edu> Copyright (c) 2005 Cold Spring Harbor Laboratory This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty. perl v5.14.2 2012-02-20 Bio::Graphics::Glyph::merged_alignment(3pm)
All times are GMT -4. The time now is 05:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy