Sponsored Content
Top Forums Shell Programming and Scripting merge multiple tables with perl Post 302563882 by birkhe on Wednesday 12th of October 2011 10:34:16 AM
Old 10-12-2011
Merging sideways

Hi birei,
currently your script merges the files in a vertical fashion:

chromo pos ref alleles.SampleA refAllele.SampleA refCount.SampleA refFreq.SampleA altAllele.SampleA altCount.SampleA altFreq.SampleA alleles.SampleB refAllele.SampleB refCount.SampleB refFreq.SampleB altAllele.SampleB altCount.SampleB altFreq.SampleB alleles.SampleC refAllele.SampleC refCount.SampleC refFreq.SampleC altAllele.SampleC altCount.SampleC altFreq.SampleC alleles.SampleD refAllele.SampleD refCount.SampleD refFreq.SampleD altAllele.SampleD altCount.SampleD altFreq.SampleD file 1
file 1
.
.
.
file 2
file 2 file 2 and so on....

I was wondering is there an easy way where the fields from file 2 are listed next to that of file 1?
If there is an easy fix to this that would be super wonderful. Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading data from multiple tables from Oracle DB

Hi , I want to read the data from 9 tables in oracle DB into 9 different files in the same connection instance (session). I am able to get data from one table to one file with below code : X=`sqlplus -s user/pwd@DB <<eof select col1 from table1; EXIT; eof` echo $X>myfile Can anyone... (2 Replies)
Discussion started by: net
2 Replies

2. Programming

SQL Add to Multiple Tables

I'm pretty new to the database world and I've run into a mental block of sorts. I've been unable to find the answer anywhere. Here's my problem: I have several tables and everything is as normalized as possible (as I've been lead to understand normalization.) Normalization has lead to some... (1 Reply)
Discussion started by: flakblas
1 Replies

3. Shell Programming and Scripting

Using Perl to Merge Multiple Lines in a File

I've hunted and hunted but nothing seems to apply to what I need. Any help will be much appreciated! My input file looks like (Unix): marker,allele1,allele2 RS1002244,1,1 RS1002244,1,3 RS1002244,3,3 RS1003719,2,2 RS1003719,2,4 RS1003719,4,4 Most markers are listed 3 times but a few... (2 Replies)
Discussion started by: Peggy White
2 Replies

4. Shell Programming and Scripting

Merge Two Tables with duplicates in first table

Hi.. File 1: 1 aa rep 1 dd rep 1 kk rep 2 bb sad 2 ss sad 3 ee dam File 2 1 apple fruit 2 mango tree 3 lilly flower output: 1 aaple fruit aa,dd,kk rep (7 Replies)
Discussion started by: empyrean
7 Replies

5. Web Development

mysql query for multiple columns from multiple tables in a DB

Say I have two tables like below.. status HId sName dName StartTime EndTime 1 E E 9:10 10:10 2 E F 9:15 10:15 3 G H 9:17 10:00 logic Id devName capacity free Line 1 E 123 34 1 2 E 345 ... (3 Replies)
Discussion started by: ilan
3 Replies

6. Shell Programming and Scripting

Merge multiple tables into big matrix

Hi all, I have a complex (beyond my biological expertise) problem at hand. I need to merge multiple files into 1 big matrix. Please help me with some code. Inp1 Ang_0 chr1 98 T A Ang_0 chr1 352 G A Ang_0 chr1 425 C T Ang_0 chr2 ... (1 Reply)
Discussion started by: newbie83
1 Replies

7. Shell Programming and Scripting

Multiple files to load into different tables,

multiple files to load into different tables, I have a script show below, but this script loads data from txt file into a table, but i have multiple input files(xyzload.txt,xyz1load.txt,xyz2load.txt......) in the unix folder , can we load these files in diff tables (table 1, table2... (0 Replies)
Discussion started by: nani1984
0 Replies

8. Shell Programming and Scripting

Multiple files to load into different tables

multiple files to load into different tables, I have a script show below, but this script loads data from txt file into a table, but i have multiple input files(xyzload.txt,xyz1load.txt,xyz2load.txt......) in the unix folder , can we load these files in diff tables (table 1, table2... (1 Reply)
Discussion started by: nani1984
1 Replies

9. UNIX for Dummies Questions & Answers

How to merge two tables based on a matched column?

Hi, Please excuse me , i have searched unix forum, i am unable to find what i expect , my query is , i have 2 files of same structure and having 1 similar field/column , i need to merge 2 tables/files based on the one matched field/column (that is field 1), file 1:... (5 Replies)
Discussion started by: karthikram
5 Replies

10. UNIX for Beginners Questions & Answers

Export Oracle multiple tables to multiple csv files using UNIX shell scripting

Hello All, just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table. Can you please suggest why? or any better idea? export FILE="/abc/autom/file/geo_JOB.csv" Export= `sqlplus -s dev01/password@dEV3... (16 Replies)
Discussion started by: Hope
16 Replies
Bio::PopGen::Utilities(3pm)				User Contributed Perl Documentation			       Bio::PopGen::Utilities(3pm)

NAME
Bio::PopGen::Utilities - Utilities for working with PopGen data and objects SYNOPSIS
use Bio::PopGen::Utilities; use Bio::AlignIO; my $in = Bio::AlignIO->new(-file => 't/data/t7.aln', -format => 'clustalw'); my $aln = $in->next_aln; # get a population, each sequence is an individual and # for the default case, every site which is not monomorphic # is a 'marker'. Each individual will have a 'genotype' for the # site which will be the specific base in the alignment at that # site my $pop = Bio::PopGen::Utilities->aln_to_population(-alignment => $aln); # get the synonymous sites from the alignemt only as the 'genotypes' # for the population my $synpop = Bio::PopGen::Utilities->aln_to_population(-site_model => 'cod', -alignment => $aln); DESCRIPTION
This object provides some convience function to turn sequence alignments into usable objects for the Population genetics modules (Bio::PopGen). 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 the Bioperl mailing list. 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 of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Jason Stajich Email jason-at-bioperl-dot-org APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ aln_to_population Title : aln_to_population Usage : my $pop = Bio::PopGen::Utilities->aln_to_population($aln); Function: Turn and alignment into a set of L<Bio::PopGen::Individual> objects grouped in a L<Bio::PopGen::Population> object Sites are treated as 'Markers' in the Bioperl PopGen object model in the sense that a site is a unique location for which an individual will have a genotype (a set of alleles). In this implementation we are assuming that each individual has a single entry in the alignment file. Specify a site model as one of those listed 'all' -- every base in the alignment is considered a site 'cod' -- codons The option -site_model for All sites : 'all' Codon sites : 'cod' or 'codon' To see all sites, including those which are fixed in the population add -include_monomorphic => 1 to the arguments Returns : Args : -include_monomorphic => 1 to specify all sites, even those which are monomorphic in the population (useful for HKA test mostly) [default is false] -phase => specify a phase for the data, this is only used if the site_mode is codon [default is 0] -site_model => one-of 'all', 'codon' to specify a site model for the data extraction from the alignment [default is all] -alignment => provide a L<Bio::SimpleAlign> object [required] perl v5.14.2 2012-03-02 Bio::PopGen::Utilities(3pm)
All times are GMT -4. The time now is 11:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy