ZWcarp has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; open(FILE,"$ARGV[0]"); my @input=<FILE>; close(FILE); foreach my $line(@input){ chomp $line; my @batch=(); (my $gene, my $VAA, my $ CCDS ,my $chrposMut, my $o_acc, my $o_pos +, my $o_aa1, my $o_aa2)= split(/\t/,$line); (my $chrpos,my $Mut)=split(/\./,$chrposMut); my ($chr,$position)=split(/\:/,$chrpos); my $vAA=$o_aa1 . $o_pos . $o_aa2; $vAA=~s/\s//g; @batch=`perl -ne 'print if /$position/' Gene_Asign.txt`; # put the + text file here that contains the gene name as well as something that + can be used to identify the correct row when comparing it with the p +olyphen outfile foreach my $Line(@batch) { chomp $Line; # (my $snp, my $str, my $gene, my $v4, my $v5, my $CCDS)=split( +/\t/,$Line); #print $Line ."\n"; my($Sample,$v2)= split(/\s/,$Line); #if($AA=~m/$vAA/){ print $Sample . "\t" . $line . "\n"; # print $gene . "\t" . $vAA . "\t" . $CCDS. "\t" . $line . "\n" +; # } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Adding a particular column from one file to a second file
by Marshall (Canon) on Jul 14, 2011 at 18:52 UTC | |
|
Re: Adding a particular column from one file to a second file
by Not_a_Number (Prior) on Jul 14, 2011 at 20:40 UTC | |
|
Re: Adding a particular column from one file to a second file
by Jim (Curate) on Jul 14, 2011 at 20:47 UTC | |
by ZWcarp (Beadle) on Jul 15, 2011 at 17:09 UTC | |
by ZWcarp (Beadle) on Jul 15, 2011 at 17:13 UTC | |
|
Re: Adding a particular column from one file to a second file
by Jim (Curate) on Jul 14, 2011 at 21:30 UTC | |
|
Re: Adding a particular column from one file to a second file
by Jim (Curate) on Jul 14, 2011 at 20:45 UTC |