Sponsored Content
Top Forums Shell Programming and Scripting Unique entries based on a range of numbers. Post 302885369 by flyfisherman on Saturday 25th of January 2014 09:54:38 AM
Old 01-25-2014
Unique entries based on a range of numbers.

Hi,

I have a matrix like this:

Code:
Algorithm	predicted_gene	start_point	end_point
A 	x	65	85
B	x	70	80
C	x	75	85
D	x	10	20
B	y	125	130
C	y	120	140
D	y	200	210

Here there are four tab-separated columns. The first column is the used algorithm for prediction, and there are 4 of them A-D. The second column are the predicted targets (which actually are genes), x and y. The third and fourth column indicate the start and the end of the predicted site in the sequence of the genes.

I'd need to unique the entries in column 2, based on the common range in the columns 3 and 4, something like this:

Code:
Algorithm	predicted_gene	start_point	end_point	Number_of_algorithms_predicting_this_site
A, B, C	x	65	85	3
D	x	10	20	1
B, C	y	120	140	2
D	y	200	210	1

Here, for example, at the first line we have algorithms A, B and C which predict the gene x, and the predicted positions all fall into the same site, i.e. the position 70-80 for algorithm B and 75-85 for algorithm C are both located inside the same predicted position by algorithm A, which is 65-85; and the last column indicates how many algorithms predicted this position. On the contrary, the predicted site by algorithm D for the entry x does not coincide with the others, so is presented in a separate line. The results for the entry y are explained in the same way.

Hope this is clear.

Thank you in advanced

Last edited by flyfisherman; 01-25-2014 at 02:42 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

To get unique numbers from two files

here i have two files: file 1 1 2 3 4 5 5 6 7 8 9 file 2 4 5 6 6 8 8 (6 Replies)
Discussion started by: i.scientist
6 Replies

2. Shell Programming and Scripting

read numbers from file and output which numbers belongs to which range

Howdy experts, We have some ranges of number which belongs to particual group as below. GroupNo StartRange EndRange Group0125 935300 935399 Group2006 935400 935476 937430 937459 Group0324 935477 935549 ... (6 Replies)
Discussion started by: thepurple
6 Replies

3. UNIX for Dummies Questions & Answers

Getting unique list of numbers using grep

Hi, I am going to fetch a list of numbers that starts with "0032" from a file with a format like the given below: " 0032459999 0032458888 0032457777 0032451111 0032452222 0032453333 0032459999 0032458888 0032457777 0032451111 0032452222 0032453333 " I want to get a unique... (6 Replies)
Discussion started by: tinku
6 Replies

4. Shell Programming and Scripting

How to generate 10.000 unique numbers?

hello, does anybody can give me a hint on how to generate a lot of numbers which are not identically via scripting etc? (7 Replies)
Discussion started by: xrays
7 Replies

5. Shell Programming and Scripting

unique random numbers awk

Hi, I have a small piece of awk code (see below) that generates random numbers. gawk -F"," 'BEGIN { srand(); for (i = 1; i <= 30; i++) printf("%s AM329_%04d\n",$0,int(36 * rand())+1) }' OFS=, AM329_hole_names.csv The code works fine and generates alphanumeric numbers like AM329_0001,... (2 Replies)
Discussion started by: theflamingmoe
2 Replies

6. UNIX for Dummies Questions & Answers

Grep for a range of numbers?

I am trying to extract specific information from a large *.sam file (it's originally 28Gb). I want to extract all lines that are on chr3 somewhere in the range of 112,937,439-113,437,438. Here is a sample line from my file so you can get a feel for what each line looks like: seq.4 0 ... (8 Replies)
Discussion started by: genGirl23
8 Replies

7. Shell Programming and Scripting

How to create individual entries from a range of numbers?

I want to create entries based on the series as in examples below: Input: 2dat3 grht-5&&-15 3dat3 grht-16&&-30 4dat3 ftht-4&&-12 5sat3 ftht-16&&-20 Output: 2dat3 grht-5 2dat3 grht-6 2dat3 grht-7 2dat3 grht-8 (7 Replies)
Discussion started by: aydj
7 Replies

8. UNIX for Dummies Questions & Answers

Sorting and saving values based on unique entries

Hi all, I wanted to save the values of a file that contains unique entries based on a specific column (column 4). my sample file looks like the following: input file: 200006-07file.txt 145 35 10 3 147 35 12 4 146 36 11 3 145 34 12 5 143 31 15 4 146 30 14 5 desired output files:... (5 Replies)
Discussion started by: ida1215
5 Replies

9. Shell Programming and Scripting

Remove duplicate entries based on the range

I have file like this: chr start end chr15 99874874 99875874 chr15 99875173 99876173 aa1 chr15 99874923 99875923 chr15 99875173 99876173 aa1 chr15 99874962 99875962 chr15 99875173 99876173 aa1 chr1 ... (7 Replies)
Discussion started by: raj_k
7 Replies

10. Shell Programming and Scripting

Printing unique numbers from each file

I have some files named file1, file2, fille3......etc. These files are in a folder f1. The content of files are shown below. I would like to count the unique pairs of third column in each file. some files have no data. It should be printed as zero. Your help would be appreciated. file1 ARG... (1 Reply)
Discussion started by: samra
1 Replies
Bio::Tools::Prediction::Exon(3pm)			User Contributed Perl Documentation			 Bio::Tools::Prediction::Exon(3pm)

NAME
Bio::Tools::Prediction::Exon - A predicted exon feature SYNOPSIS
# See documentation of methods. DESCRIPTION
A feature representing a predicted exon. This class actually inherits off Bio::SeqFeature::Gene::Exon and therefore has all that functionality (also implements Bio::SeqFeatureI), plus a few methods supporting predicted features, like various scores and a significance. Even though these were inspired by GenScan results, at least a subset should be generally useable for exon prediction results. FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Hilmar Lapp Email hlapp-at-gmx.net APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ predicted_cds Title : predicted_cds Usage : $predicted_cds_dna = $exon->predicted_cds(); $exon->predicted_cds($predicted_cds_dna); Function: Get/Set the CDS (coding sequence) as predicted by a program. This method is independent of an attached_seq. There is no guarantee whatsoever that the returned CDS has anything to do (e.g., matches) with the sequence covered by the exons as annotated through this object. Example : Returns : A Bio::PrimarySeqI implementing object holding the DNA sequence defined as coding by a prediction of a program. Args : On set, a Bio::PrimarySeqI implementing object holding the DNA sequence defined as coding by a prediction of a program. predicted_protein Title : predicted_protein Usage : $predicted_protein_seq = $exon->predicted_protein(); $exon->predicted_protein($predicted_protein_seq); Function: Get/Set the protein translation as predicted by a program. This method is independent of an attached_seq. There is no guarantee whatsoever that the returned translation has anything to do with the sequence covered by the exons as annotated through this object, or the sequence returned by predicted_cds(), although it should usually be just the standard translation. Example : Returns : A Bio::PrimarySeqI implementing object holding the protein translation as predicted by a program. Args : On set, a Bio::PrimarySeqI implementing object holding the protein translation as predicted by a program. significance Title : significance Usage : $evalue = $obj->significance(); $obj->significance($evalue); Function: Returns : Args : start_signal_score Title : start_signal_score Usage : $sc = $obj->start_signal_score(); $obj->start_signal_score($evalue); Function: Get/Set a score for the exon start signal (acceptor splice site or initiation signal). Returns : Args : end_signal_score Title : end_signal_score Usage : $sc = $obj->end_signal_score(); $obj->end_signal_score($evalue); Function: Get/Set a score for the exon end signal (donor splice site or termination signal). Returns : Args : coding_signal_score Title : coding_signal_score Usage : $sc = $obj->coding_signal_score(); $obj->coding_signal_score($evalue); Function: Get/Set a score for the exon coding signal (e.g., coding potential). Returns : Args : perl v5.14.2 2012-03-02 Bio::Tools::Prediction::Exon(3pm)
All times are GMT -4. The time now is 06:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy