Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Removing rows that contain non-unique column entry Post 302924204 by Scrutinizer on Friday 7th of November 2014 01:08:49 AM
Old 11-07-2014
Try something like:
Code:
awk -F, 'NR==FNR{A[$3]++; B[$13]++; next} A[$3]==1 && B[$13]==1' infile infile

Note: the input file is specified twice. I have used a comma separator here as field separator, so for that to work you need to use a comma as field separator when you export the spreadsheet.

It is untested since there is no text sample... Please post one.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Removing the rest of line from the second entry of an expression

Dear people, can you please enlighten: I need to do a (most probably) very simple thing but couldn't figure how. I have files with lots of lines starting with a fixed expression: Query=. (the dot is a space) followed by different combinations of characters including special ones such... (5 Replies)
Discussion started by: roussine
5 Replies

2. Shell Programming and Scripting

for each different entry in column 1 extract maximum values from column 2 in unix/awk

Hello, I have 2 columns (1st column has multiple entries but the corresponding values in the column 2 may be the same or different.) however I want to extract unique values for each entry in column 1 by assigning the max value from column 2 SDF4 -0.211654 SDF4 0.978068 ... (1 Reply)
Discussion started by: Diya123
1 Replies

3. Shell Programming and Scripting

Rename a header column by adding another column entry to the header column name URGENT!!

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (4 Replies)
Discussion started by: Vavad
4 Replies

4. Shell Programming and Scripting

unique entry add values

Hi, I have a file with 3 columns ABC 3 1 ABC 5 1 XYZ 4 2 DEF 3 2 DEF 4 1 DEF 6 1 MNO 5 5 JKL 3 2 JKL 4 2 PQR 12 1 For each unique entry in column 1 I want to add values in column 2 and column3 o/p ABC 8 2 XYZ 4 2 (1 Reply)
Discussion started by: Diya123
1 Replies

5. UNIX for Dummies Questions & Answers

Delete rows with unique value for specific column

Hi all I have a file which looks like this 1234|1|Jon|some text|some text 1234|2|Jon|some text|some text 3453|5|Jon|some text|some text 6533|2|Kate|some text|some text 4567|3|Chris|some text|some text 4567|4|Maggie|some text|some text 8764|6|Maggie|some text|some text My third column is my... (9 Replies)
Discussion started by: A-V
9 Replies

6. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

7. Shell Programming and Scripting

Delete unique rows - optimize script

Hi all, I have the following input - the unique row key is 1st column cat file.txt A response C request C response D request C request C response E request The desired output should be C request (7 Replies)
Discussion started by: varu0612
7 Replies

8. Shell Programming and Scripting

Unique extraction of rows

I do have a tab delimited file of the following format: 431 kat1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 432 kat2 2 NA NA NA NA NA NA NA NA NA NA NA NA NA 433 KATe NA 3 NA NA 6 NA NA NA 10 11 NA NA NA NA 542 Kaed 2 NA NA NA NA NA NA NA NA NA NA NA NA NA 543 hkwuy NA NA NA NA 6 NA NA NA NA 11 NA NA... (11 Replies)
Discussion started by: Kanja
11 Replies

9. Shell Programming and Scripting

Count occurrence of column one unique value having unique second column value

Hello Team, I need your help on the following: My input file a.txt is as below: 3330690|373846|108471 3330690|373846|108471 0640829|459725|100001 0640829|459725|100001 3330690|373847|108471 Here row 1 and row 2 of column 1 are identical but corresponding column 2 value are... (4 Replies)
Discussion started by: angshuman
4 Replies

10. UNIX for Beginners Questions & Answers

Awk/sed summation of one column based on some entry in first column

Hi All , I am having an input file as stated below Input file 6 ddk/djhdj/djhdj/Q 10 0.5 dhd/jdjd.djd.nd/QB 01 0.5 hdhd/jd/jd/jdj/Q 10 0.5 512 hd/hdh/gdh/Q 01 0.5 jdjd/jd/ud/j/QB 10 0.5 HD/jsj/djd/Q 01 0.5 71 hdh/jjd/dj/jd/Q 10 0.5 ... (5 Replies)
Discussion started by: kshitij
5 Replies
Bio::SeqFeature::Primer(3pm)				User Contributed Perl Documentation			      Bio::SeqFeature::Primer(3pm)

NAME
Bio::SeqFeature::Primer - Primer Generic SeqFeature SYNOPSIS
# set up a single primer that can be used in a PCR reaction use Bio::SeqFeature::Primer; # initiate a primer with raw sequence my $primer=Bio::SeqFeature::Primer->new(-seq=>'CTTTTCATTCTGACTGCAACG'); # get the primery tag for the primer # should return Primer my $tag=$primer->primary_tag; # get or set the location that the primer binds to the target at $primer->location(500); my $location=$primer->location(500); # get or set the 5' end of the primer homology, as the primer doesn't # have to be the same as the target sequence $primer->start(2); my $start=$primer->start; # get or set the 3' end of the primer homology $primer->end(19); my $end = $primer->end; # get or set the strand of the primer. Strand should be 1, 0, or -1 $primer->strand(-1); my $strand=$primer->strand; # get or set the id of the primer $primer->display_id('test_id'); my $id=$primer->display_id; # get the tm of the primer. This is calculated for you by the software. # however, see the docs. my $tm = $primer->Tm; print "These are the details of the primer: Tag: $tag Location $location Start: $start "; print " End: $end Strand: $strand ID: $id Tm: $tm "; DESCRIPTION
Handle primer sequences. This will allow you to generate a primer object required for a Bio::Seq::PrimedSeq object. This module is designed to integrate with Bio::Tools::Primer3 and Bio::Seq::PrimedSeq. In addition, you can calculate the melting temperature of the primer. This module is supposed to implement location and range, presumably through generic.pm, but does not do so yet. However, it does allow you to set primers, and use those objects as the basis for Bio::Seq::PrimedSeq objects. See also the POD for Bio::Seq::PrimedSeq and Bio::Tools::Nucleotide::Analysis::Primer3 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
Rob Edwards, redwards@utmem.edu The original concept and much of the code was written by Chad Matsalla, bioinformatics1@dieselwurks.com APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new() Title : new() Usage : $primer = Bio::SeqFeature::Primer(-seq=>sequence_object); Function: Instantiate a new object Returns : A SeqPrimer object Args : You must pass either a sequence object (preferable) or a sequence. seq() Title : seq() Usage : $seq = $primer->seq(); Function: Return the sequence associated with this Primer. Returns : A Bio::Seq object Args : None. source_tag() Title : source_tag() Usage : $tag = $feature->source_tag(); Function: Returns the source of this tag. Returns : A string. Args : If an argument is provided, the source of this SeqFeature is set to that argument. location() Title : location() Usage : $tag = $primer->location(); Function: Gets or sets the location of the primer on the sequence Returns : If the location is set, returns that, if not returns 0. Note: At the moment I am using the primer3 notation of location (although you can set whatever you want). In this form, both primers are given from their 5' ends and a length. In this case, the left primer is given from the leftmost end, but the right primer is given from the rightmost end. You can use start() and end() to get the leftmost and rightmost base of each sequence. Args : If supplied will set a location start() Title : start() Usage : $start_position = $primer->start($new_position); Function: Return the start position of this Primer. This is the leftmost base, regardless of whether it is a left or right primer. Returns : The start position of this primer or 0 if not set. Args : If supplied will set a start position. end() Title : end() Usage : $end_position = $primer->end($new_position); Function: Return the end position of this primer. This is the rightmost base, regardless of whether it is a left or right primer. Returns : The end position of this primer. Args : If supplied will set an end position. strand() Title : strand() Usage : $strand=$primer->strand() Function: Get or set the strand. Returns : The strand that the primer binds to. Args : If an argument is supplied will set the strand, otherwise will return it. Should be 1, 0 (not set), or -1 display_id() Title : display_id() Usage : $id = $primer->display_id($new_id) Function: Returns the display ID for this Primer feature Returns : A scalar. Args : If an argument is provided, the display_id of this primer is set to that value. Tm() Title : Tm() Usage : $tm = $primer->Tm(-salt=>'0.05', -oligo=>'0.0000001') Function: Calculates and returns the Tm (melting temperature) of the primer Returns : A scalar containing the Tm. Args : -salt : set the Na+ concentration on which to base the calculation (default=0.05 molar). : -oligo : set the oligo concentration on which to base the calculation (default=0.00000025 molar). Notes : Calculation of Tm as per Allawi et. al Biochemistry 1997 36:10581-10594. Also see documentation at http://www.idtdna.com/Scitools/Scitools.aspx as they use this formula and have a couple nice help pages. These Tm values will be about are about 0.5-3 degrees off from those of the idtdna web tool. I don't know why. This was suggested by Barry Moore (thanks!). See the discussion on the bioperl-l with the subject "Bio::SeqFeature::Primer Calculating the PrimerTM" Tm_estimate Title : Tm_estimate Usage : $tm = $primer->Tm_estimate(-salt=>'0.05') Function: Calculates and returns the Tm (melting temperature) of the primer Returns : A scalar containing the Tm. Args : -salt set the Na+ concentration on which to base the calculation. Notes : This is an estimate of the Tm that is kept in for comparative reasons. You should probably use Tm instead! This Tm calculations are taken from the Primer3 docs: They are based on Bolton and McCarthy, PNAS 84:1390(1962) as presented in Sambrook, Fritsch and Maniatis, Molecular Cloning, p 11.46 (1989, CSHL Press). Tm = 81.5 + 16.6(log10([Na+])) + .41*(%GC) - 600/length where [Na+] is the molar sodium concentration, %GC is the %G+C of the sequence, and length is the length of the sequence. However.... I can never get this calculation to give me the same result as primer3 does. Don't ask why, I never figured it out. But I did want to include a Tm calculation here because I use these modules for other things besides reading primer3 output. The primer3 calculation is saved as 'PRIMER_LEFT_TM' or 'PRIMER_RIGHT_TM' and this calculation is saved as $primer->Tm so you can get both and average them! perl v5.14.2 2012-03-02 Bio::SeqFeature::Primer(3pm)
All times are GMT -4. The time now is 04:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy