Sponsored Content
Full Discussion: extract data from 2 files
Top Forums Shell Programming and Scripting extract data from 2 files Post 302597502 by Diya123 on Friday 10th of February 2012 01:19:52 PM
Old 02-10-2012
extract data from 2 files

file 1
Code:
WASH7P        17232,18267,18500,20564            17368,18362,18554,21139

file 2


Code:
chr1	14969	15038	Exon	WASH7P
chr1	17232	17368	Exon	WASH7P
chr1	17258	17368	Exon	WASH7P
chr1	17605	17742	Exon	WASH7P
chr1	18267	18362	Exon	WASH7P
chr1	18267	18366	Exon	WASH7P
chr1	18267	18369	Exon	WASH7P
chr1	18267	18379	Exon	WASH7P
chr1	18496	18554	Exon	WASH7P
chr1	18500	18554	Exon	WASH7P
chr1	18912	19139	Exon	WASH7P

What I need to check is for each gene if column 2 of file 2 is present in column 2 of file 1 and column 3 of file 2 is present in column 3 of file 1 . If so then these two are supposed to be placed in column 4 and 5 of file 1. I just explained one example here. I have 15000 entries with different genes(column5 of file 2). so a for loop should be there to iterate..

o/p

Code:
 WASH7P        17232,18267,18500,20564            17368,18362,18554,21139  17232,18267,18500   17232,18267,18500

Thanks,

Last edited by Franklin52; 02-11-2012 at 08:59 AM.. Reason: Adding code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl script for extract data from xml files

Hi All, Prepare a perl script for extracting data from xml file. The xml data look like as AC StartTime="1227858839" ID="88" ETime="1227858837" DSTFlag="false" Type="2" Duration="303" /> <AS StartTime="1227858849" SigPairs="119 40 98 15 100 32 128 18 131 23 70 39 123 20 120 27 100 17 136 12... (3 Replies)
Discussion started by: allways4u21
3 Replies

2. Shell Programming and Scripting

extract the relevant data files for a quarter

CTB_KT_OllyotLvos_20081204_164352_200811.txt CTB_KT_LN_utahfwd_20081204_164352_200811.txt CTB_KT_LN_utahfwd_Summ_20081204_164352_200811.txt CTB_KT_PML_astdt_prFr_20081204_210153_200811.txt CTB_KT_PML_astdt_prOt_20081204_210153_200811.txt CTB_KT_PML_astdt_Nopr_20081204_210153_200811.txt... (7 Replies)
Discussion started by: w020637
7 Replies

3. UNIX for Dummies Questions & Answers

AWK, extract data from multiple files

Hi, I'm using AWK to try to extract data from multiple files (*.txt). The script should look for a flag that occurs at a specific position in each file and it should return the data to the right of that flag. I should end up with one line for each file, each containing 3 columns:... (8 Replies)
Discussion started by: Liverpaul09
8 Replies

4. Shell Programming and Scripting

How to extract data from indexed files (ISAM files) maintained in an unix server.

Hi, Could someone please assist on a quick way of How to extract data from indexed files (ISAM files) maintained in an UNIX(AIX) server.The file data needs to be extracted in flat text file or CSV or excel format . Usually we have programs in microfocus COBOL to extract data, but would like... (2 Replies)
Discussion started by: devina
2 Replies

5. Shell Programming and Scripting

extract data with awk from html files

Hello everyone, I'm new to this forum and i am new as a shell scripter. my problem is to have html files in a directory and I would like to extract from these some data that lies between two different lines Here's my situation <td align="default"> oxidizability (mg / l): data_to_extract... (6 Replies)
Discussion started by: sbobotex
6 Replies

6. Shell Programming and Scripting

Extract data with awk and write to several files

Hi! I have one file with data that looks like this: 1 data data data data 2 data data data data 3 data data data data . . . 1 data data data data 2 data data data data 3 data data data data . . . I would like to have awk to write each block to a separate file, like this: 1... (3 Replies)
Discussion started by: LinWin
3 Replies

7. Shell Programming and Scripting

How to extract information from two files with data range

Hi, I want to make a query about extracting data from two files that both have data ranges. the data that i want to extract; when there is matching between file1 column 2 is equal to file2 column2 , and file1 column 3 and column 4 is within the range of file2 columns 3 and 4. I would like rows... (1 Reply)
Discussion started by: houkto
1 Replies

8. UNIX for Dummies Questions & Answers

Extract common data out of multiple files

I am trying to extract common list of Organisms from different files For example I took 3 files and showed expected result. In real I have more than 1000 files. I am aware about the useful use of awk and grep but unaware in depth so need guidance regarding it. I want to use awk/ grep/ cut/... (7 Replies)
Discussion started by: macmath
7 Replies

9. Shell Programming and Scripting

Extract data in tabular format from multiple files

Hi, I have directory with multiple files from which i need to extract portion of specif lines and insert it in a new file, the new file will contain a separate columns for each file data. Example: I need to extract Value_1 & Value_3 from all files and insert in output file as below: ... (2 Replies)
Discussion started by: belalr
2 Replies

10. Shell Programming and Scripting

Match and extract data using two files

Hello, Using the information in file 1, I would like to extract from file2 all rows which matchs in column 3. file 1 1233 1230 1231 1232 file2 65733.00 19775.00 1220 65733.00 19793.00 1220 65733.00 19801.00 1220 65733.00 19809.00 1231 65733.00 19817.00 ... (2 Replies)
Discussion started by: jiam912
2 Replies
Bio::Tools::Sim4::Exon(3pm)				User Contributed Perl Documentation			       Bio::Tools::Sim4::Exon(3pm)

NAME
Bio::Tools::Sim4::Exon - A single exon determined by an alignment SYNOPSIS
# See Bio::Tools::Sim4::Results for a description of the context. # an instance of this class is-a Bio::SeqFeature::SimilarityPair # coordinates of the exon (recommended way): print "exon from ", $exon->start(), " to ", $exon->end(), " "; # the same (feature1() inherited from Bio::SeqFeature::FeaturePair) print "exon from ", $exon->feature1()->start(), " to ", $exon->feature1()->end(), " "; # also the same (query() inherited from Bio::SeqFeature::SimilarityPair): print "exon from ", $exon->query()->start(), " to ", $exon->query()->end(), " "; # coordinates on the matching EST (recommended way): print "matches on EST from ", $exon->est_hit()->start(), " to ", $exon->est_hit()->end(), " "; # the same (feature2() inherited from Bio::SeqFeature::FeaturePair) print "matches on EST from ", $exon->feature2()->start(), " to ", $exon->feature2()->end(), " "; # also the same (subject() inherited from Bio::SeqFeature::SimilarityPair): print "exon from ", $exon->subject()->start(), " to ", $exon->subject()->end(), " "; DESCRIPTION
This class inherits from Bio::SeqFeature::SimilarityPair and represents an exon on a genomic sequence determined by similarity, that is, by aligning an EST sequence (using Sim4 in this case). Consequently, the notion of query and subject is always from the perspective of the genomic sequence: query refers to the genomic seq, subject to the aligned EST hit. Because of this, $exon->start(), $exon->end() etc will always return what you expect. To get the coordinates on the matching EST, refer to the properties of the feature returned by est_hit(). 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 - Ewan Birney, Hilmar Lapp Ewan Birney <birney-at-sanger.ac.uk> Hilmar Lapp <hlapp-at-gmx.net> or <hilmar.lapp-at-pharma.novartis.com>. APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ percentage_id Title : percentage_id Usage : $obj->percentage_id($newval) Function: This is a synonym for 100 * $obj->est_hit()->frac_identical(). Returns : value of percentage_id Args : newvalue (optional) est_hit Title : est_hit Usage : $est_feature = $obj->est_hit(); Function: Returns the EST hit pointing to (i.e., aligned to by Sim4) this exon (i.e., genomic region). At present, merely a synonym for $obj->feature2(). Returns : An Bio::SeqFeatureI implementing object. Args : perl v5.14.2 2012-03-02 Bio::Tools::Sim4::Exon(3pm)
All times are GMT -4. The time now is 06:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy