Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Length of a segment based on coordinates Post 302722019 by fadista on Friday 26th of October 2012 08:00:51 AM
Old 10-26-2012
Length of a segment based on coordinates

Hi,

I would like to have the length of a segment based on coordinates of its parts.

Example input file:
Code:
chr11	genes_good3.gtf	aggregate_gene	1	100 gene1
chr11	genes_good3.gtf	exonic_part	1	60
chr11	genes_good3.gtf	exonic_part	70	100
chr11	genes_good3.gtf	aggregate_gene	200	1000 gene2
chr11	genes_good3.gtf	exonic_part	200	300
chr11	genes_good3.gtf	exonic_part	500	800
chr11	genes_good3.gtf	exonic_part	900	1000

Desired output file:
Code:
gene1 90
gene2 500

Thanks in advance!

Last edited by Scott; 10-26-2012 at 09:10 AM.. Reason: Code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need find a file based length

Can some please help me? Want to find files over 35 characters in length? I am running HPUX. Would it be possible with find? Thanks in advance (8 Replies)
Discussion started by: J_ang
8 Replies

2. Shell Programming and Scripting

Split strings based on length

Hi All I am very much in need of help splitting strings based on length in Perl. e.g., Input text is : International NOUN Corp. NOUN 's POS Tulsa NOUN Output I want is : International I In Int Inte l al nal onal NOUN Corp. C Co Cor Corp . p. rp. orp. NOUN... (2 Replies)
Discussion started by: my_Perl
2 Replies

3. Shell Programming and Scripting

Add character based on record length

All, I can't seem to find exactly what I'm looking for, and haven't had any luck patching things together. I need to look through a file, and if the record length is not 874, then add 'E' in position 778. Your help is greatly appreciated. (4 Replies)
Discussion started by: CutNPaste
4 Replies

4. Programming

Data segment or Text segment

Hi, Whether the following piece of code is placed in the read-only memory of code (text) segment or data segment? char *a = "Hello"; I am getting two different answers while searching in google :( that's why the confusion is (7 Replies)
Discussion started by: royalibrahim
7 Replies

5. UNIX for Dummies Questions & Answers

Sorting words based on length

i need to write a bash script that recive a list of varuables kaka pele ronaldo beckham zidane messi rivaldo gerrard platini i need the program to print the longest word of the list. word in the output appears on a separate line and word order in the output is in the order Llachsicografi costs.... (1 Reply)
Discussion started by: yairpg
1 Replies

6. Shell Programming and Scripting

Help required on Length based lookup

Hi, I have two files one (abc.txt) is having approx 28k records and another (bcd.txt) on is having 112k records, the length of each files are varried. I am trying to look up abc.txt file with bcd.txt based on length, where ever abc.txt records are matching with bcd.txt I am successful match... (8 Replies)
Discussion started by: rramkrishnas
8 Replies

7. Shell Programming and Scripting

Add string based on character length

Good day, I am a newbie here and thanks for accepting me I have a task to modify input data where my input data looks like 123|34567|CHINE 1|23|INDIA 34512|21|USA 104|901|INDIASee that my input has two columns with different character length but max length is 5 and minimum length is 0 which... (1 Reply)
Discussion started by: fastlearner
1 Replies

8. Shell Programming and Scripting

awk to adjust coordinates in field based on sequential numbers in another field

I am trying to output a tab-delimited result that uses the data from a tab-delimited file to combine and subtract specific lines. If $4 matches in each line then the first matching sequential $6 value is added to $2, unless the value is 1, then the original $2 is used (like in the case of line... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. Shell Programming and Scripting

Append 0's based on length

I'm having data like this, "8955719","186497034","0001","M","3" "8955719","186497034","0002","M","10" "8955719","186497034","0003","M","10" "8955719","186497034","0004","M","3" "8955723","186499034","0001","M","3" "8955723","186499034","0002","M","10" "8955723","186499034","0003","M","10"... (3 Replies)
Discussion started by: Artlk
3 Replies

10. Shell Programming and Scripting

Perl to adjust coordinates based on repeat string

In the file below I am trying to count the given repeats of A,T,C,G in each string of letters. Each sequence is below the > and it is possible for a string of repeats to wrap from the line above. For example, in the first line the last letter is a T and the next lines has 3 more. I think the below... (10 Replies)
Discussion started by: cmccabe
10 Replies
GTF(1)							      General Commands Manual							    GTF(1)

NAME
gtf - calculate VESA GTF mode lines SYNOPSIS
gtf h-resolution v-resolution refresh [-v|--verbose] [-f|--fbmode] [-x|--xorgmode] DESCRIPTION
Gtf is a utility for calculating VESA GTF modes. Given the desired horizontal and vertical resolutions and refresh rate (in Hz), the parameters for a matching VESA GTF mode are printed out. Two output formats are supported: mode lines suitable for the Xorg xorg.conf(5) file, and mode parameters suitable for the Linux fbset(8) utility. OPTIONS
-v|--verbose Enable verbose printouts This shows a trace for each step of the computation. -x|--xorgmode Print the mode parameters as Xorg-style mode lines. This is the default format. -f|--fbset Print the mode parameters in a format suitable for fbset(8). SEE ALSO
xorg.conf(5), cvt(1) AUTHOR
Andy Ritger. This program is based on the Generalized Timing Formula (GTF(TM)) Standard Version: 1.0, Revision: 1.0. The GTF Excel(TM) spreadsheet, a sample (and the definitive) implementation of the GTF Timing Standard is available at <ftp://ftp.vesa.org/pub/GTF/VTF_V1R1.xls>. X Version 11 xorg-server 1.12.4 GTF(1)
All times are GMT -4. The time now is 06:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy