Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Grep or awk a unique and specific word across many fields Post 302999182 by daashti on Thursday 15th of June 2017 05:23:37 AM
Old 06-15-2017
Grep or awk a unique and specific word across many fields

Hi there,

I have data with similar structure as this:
Code:
CHR	START-SNP	END-SNP	REF	ALT	PATIENT1	PATIENT2	PATIENT3	PATIENT4
chr1	69511	69511	A	G	homo	hetero	homo	hetero
chr2	69513	69513	T	C	.	hetero	homo	hetero
chr3	69814	69814	G	C	.	.	homo	homo
chr4	69815	69815	C	A	hetero	.	.	hetero

is there a way to report a string the whole string if words such homo or hetero is found across columns not minding fields with dots (.) which mean unknown. So the data looks like this:
Code:
CHR	START-SNP	END-SNP	REF	ALT	PATIENT1	PATIENT2	PATIENT3	PATIENT4
chr3	69814	69814	G	C	.	.	homo	homo
chr4	69815	69815	C	A	hetero	.	.	hetero


Thanks Smilie
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep a word from a specific line

for example: searches only for single word for single word this is line three match=$(grep -n -e "single" data.txt) this command will stored "..... single ...... single" into search. how can i grep the single word just from line 2 only?? (3 Replies)
Discussion started by: blurboy
3 Replies

2. Shell Programming and Scripting

Grep out specific word and only that word

ok, so this is proving to be kind of difficult even though it should not be. say for instance I want to grep out ONLY the word fkafal from the below output, how do I do it? echo ajfjf fjfjf iafjga fkafal foeref afoafahfia | grep -w "fkafal" If i run the above command, i get back all the... (4 Replies)
Discussion started by: SkySmart
4 Replies

3. Shell Programming and Scripting

Compare Tab Separated Field with AWK to all and print lines of unique fields.

Hi. I have a tab separated file that has a couple nearly identical lines. When doing: sort file | uniq > file.new It passes through the nearly identical lines because, well, they still are unique. a) I want to look only at field x for uniqueness and if the content in field x is the... (1 Reply)
Discussion started by: rocket_dog
1 Replies

4. UNIX for Dummies Questions & Answers

How to print line starts with specific word and contains specific word using sed?

Hi, I have gone through may posts and dint find exact solution for my requirement. I have file which consists below data and same file have lot of other data. <MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'> <MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Discussion started by: tmalik79
11 Replies

5. Shell Programming and Scripting

Print unique names in each row of a specific column using awk

Is it possible to remove redundant names in the 4th column? input cqWE 100 200 singapore;singapore AZO 300 400 brazil;america;germany;ireland;germany .... .... output cqWE 100 200 singapore AZO 300 400 brazil;america;germany;ireland (4 Replies)
Discussion started by: quincyjones
4 Replies

6. Shell Programming and Scripting

Print unique names in a specific column using awk

Is it possible to modify file like this. 1. Remove all the duplicate names in a define column i.e 4th col 2. Count the no.of unique names separated by ";" and print as a 5th col thanx in advance!! Q input c1 30 3 Eh2 c10 96 3 Frp c41 396 3 Ua5;Lop;Kol;Kol c62 2 30 Fmp;Fmp;Fmp ... (5 Replies)
Discussion started by: quincyjones
5 Replies

7. Shell Programming and Scripting

Need a word which just comes next to after grep of a specific word

Hi, Below is an example : ST1 PREF: int1 AVAIL: int2 ST2 PREF :int1 AVAIL: int2 I need int1 to come in preferred variable while programming and int2 in available variable Please help me doing so Best regards, Vishal (10 Replies)
Discussion started by: Vishal_dba
10 Replies

8. Shell Programming and Scripting

awk to match keyword and return matches and unique fields

Trying to use awk to find a keyword and return the matches in the row, but also $1 and $2, which are the unique id's, but they only appear once. Thank you :). file name 31 Index Chromosomal Position Gene Inheritance 122 2106725 TSC2 AD 124 2115481 TSC2 AD 121 2105400 TSC2 AD... (6 Replies)
Discussion started by: cmccabe
6 Replies

9. Shell Programming and Scripting

Getting max value of specific fields with awk

Hello All, Here is am trying to get maximum value of third field depending on first,second and fourth fields with awk command . delimeter is pipe(|) . input 0221|09|14.25|aaa 0221|09|44.27|aaa 0221|09|44.33|aaa 0221|09|44.53|bbb 0221|09|34.32|bbb 0221|09|37.13|bbb... (5 Replies)
Discussion started by: sayami00
5 Replies
Bio::Cluster::UniGeneI(3pm)				User Contributed Perl Documentation			       Bio::Cluster::UniGeneI(3pm)

NAME
Bio::Cluster::UniGeneI - abstract interface of UniGene object SYNOPSIS
# DESCRIPTION
This is the general interface for a UniGene cluster representation in Bioperl. You cannot use this module directly, use an implementation instead. You can create UniGene cluster objects yourself by instantiating Bio::Cluster::UniGene. If you read UniGene clusters from a ClusterIO parser, you will get objects implementing this interface, most likely instances of said UniGene class. Bio::Cluster::UniGeneI inherits from Bio::ClusterI, so you can use it wherever a cluster object is expected. 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 - Andrew Macgregor Email andrew at cbbc.murdoch.edu.au APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a "_". unigene_id Title : unigene_id Usage : unigene_id(); Function: Returns the unigene_id associated with the object. Example : $id = $unigene->unigene_id or $unigene->unigene_id($id) Returns : A string Args : None or an id title Title : title Usage : title(); Function: Returns the title associated with the object. Example : $title = $unigene->title or $unigene->title($title) Returns : A string Args : None or a title gene Title : gene Usage : gene(); Function: Returns the gene associated with the object. Example : $gene = $unigene->gene or $unigene->gene($gene) Returns : A string Args : None or a gene cytoband Title : cytoband Usage : cytoband(); Function: Returns the cytoband associated with the object. Example : $cytoband = $unigene->cytoband or $unigene->cytoband($cytoband) Returns : A string Args : None or a cytoband mgi Title : mgi Usage : mgi(); Function: Returns the mgi associated with the object. Example : $mgi = $unigene->mgi or $unigene->mgi($mgi) Returns : A string Args : None or a mgi locuslink Title : locuslink Usage : locuslink(); Function: Returns or stores a reference to an array containing locuslink data. This should really only be used by ClusterIO, not directly Returns : An array reference Args : None or an array reference homol Title : homol Usage : homol(); Function: Returns the homol entry associated with the object. Example : $homol = $unigene->homol or $unigene->homol($homol) Returns : A string Args : None or a homol entry restr_expr Title : restr_expr Usage : restr_expr(); Function: Returns the restr_expr entry associated with the object. Example : $restr_expr = $unigene->restr_expr or $unigene->restr_expr($restr_expr) Returns : A string Args : None or a restr_expr entry gnm_terminus Title : gnm_terminus Usage : gnm_terminus(); Function: Returns the gnm_terminus associated with the object. Example : $gnm_terminus = $unigene->gnm_terminus or $unigene->gnm_terminus($gnm_terminus) Returns : A string Args : None or a gnm_terminus scount Title : scount Usage : scount(); Function: Returns the scount associated with the object. Example : $scount = $unigene->scount or $unigene->scount($scount) Returns : A string Args : None or a scount express Title : express Usage : express(); Function: Returns or stores a reference to an array containing tissue expression data. This should really only be used by ClusterIO, not directly Returns : An array reference Args : None or an array reference chromosome Title : chromosome Usage : chromosome(); Function: Returns or stores a reference to an array containing chromosome lines This should really only be used by ClusterIO, not directly Returns : An array reference Args : None or an array reference sts Title : sts Usage : sts(); Function: Returns or stores a reference to an array containing sts lines This should really only be used by ClusterIO, not directly Returns : An array reference Args : None or an array reference txmap Title : txmap Usage : txmap(); Function: Returns or stores a reference to an array containing txmap lines Returns : An array reference Args : None or an array reference protsim Title : protsim Usage : protsim(); Function: Returns or stores a reference to an array containing protsim lines This should really only be used by ClusterIO, not directly Returns : An array reference Args : None or an array reference sequence Title : sequence Usage : sequence(); Function: Returns or stores a reference to an array containing sequence data This should really only be used by ClusterIO, not directly Returns : An array reference Args : None or an array reference species Title : species Usage : $obj->species($newval) Function: Get the species object for this Unigene cluster. Example : Returns : value of species (a L<Bio::Species> object) Args : Methods inherited from Bio::ClusterI display_id Title : display_id Usage : Function: Get/set the display name or identifier for the cluster Returns : a string Args : optional, on set the display ID ( a string) description Title : description Usage : Bio::ClusterI->description("POLYUBIQUITIN") Function: get/set for the consensus description of the cluster Returns : the description string Args : Optional the description string size Title : size Usage : Bio::ClusterI->size(); Function: get/set for the size of the family, calculated from the number of members Returns : the size of the family Args : cluster_score Title : cluster_score Usage : $cluster ->cluster_score(100); Function: get/set for cluster_score which represent the score in which the clustering algorithm assigns to this cluster. Returns : a number get_members Title : get_members Usage : Bio::ClusterI->get_members(($seq1, $seq2)); Function: retrieve the members of the family by some criteria, for example : $cluster->get_members(-species => 'homo sapiens'); Will return all members if no criteria are provided. Returns : the array of members Args : perl v5.14.2 2012-03-02 Bio::Cluster::UniGeneI(3pm)
All times are GMT -4. The time now is 12:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy