Sponsored Content
Top Forums Shell Programming and Scripting Pattern match with awk/sed - help Post 302936226 by RudiC on Tuesday 24th of February 2015 03:56:52 AM
Old 02-24-2015
Try (making use of your footnote hint):
Code:
sed 's/\[[^][]*\]([0-9]\{1,3\})//' file3
ref|XP_002371341.1| oxoacyl-ACP reductase, putative [Toxoplasma gondii ME49] gb|EPT24759.1| 3-ketoacyl-(acyl-carrier-protein) reductase [Toxoplasma gondii ME49] gb|ESS34081.1| 3-ketoacyl-(acyl-carrier-protein) reductase     -    243    134    61.4617940199336    1    230    2e-71    80.7308970099668
gb|EPR63881.1| 3-ketoacyl-(acyl-carrier-protein) reductase     -    243    134    61.4617940199336    1    230    2e-71    80.7308970099668
ref|XP_003885852.1| 3-ketoacyl-(Acyl-carrier-protein) reductase, related [Neospora caninum Liverpool] emb|CBZ55826.1| 3-ketoacyl-(Acyl-carrier-protein) reductase, related     -    242    137    61.7940199335548    1    229    8e-71    80.3986710963455
emb|CDJ42835.1| oxoacyl-ACP reductase, putative     -    240    141    61.7940199335548    1    211    3e-64    79.734219269103
emb|CDJ64722.1| oxoacyl-ACP reductase, putative

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Use to awk to match pattern, and print the pattern

Hi, I know how to use awk to search some expressions like five consecutive numbers, , this is easy. However, how do I make awk print the pattern that is been matched? For example: input: usa,canada99292,japan222,france59664,egypt223 output:99292,59664 (6 Replies)
Discussion started by: grossgermany
6 Replies

2. Shell Programming and Scripting

Match a pattern starting with sub-pattern using sed

Hi all, I've been experiencing a difficulty trying to match a number and write it to a new file. My input file is: input.txt It contains the lines: 103P 123587.256971 3.21472112 3.1517423 1.05897234566427 58.2146258 12.35478 25.3612489 What would be the sed command to... (17 Replies)
Discussion started by: Biederman
17 Replies

3. Shell Programming and Scripting

AWK match $1 $2 pattern in file 1 to $1 $2 pattern in file2

Hi, I have 2 files that I have modified to basically match each other, however I want to determine what (if any) line in file 1 does not exist in file 2. I need to match column $1 and $2 as a single string in file1 to $1 and $2 in file2 as these two columns create a match. I'm stuck in an AWK... (9 Replies)
Discussion started by: right_coaster
9 Replies

4. Shell Programming and Scripting

Sed Pattern Match

Hi, I would like to use SED to do the following string replacement: asd1abc to www1cda asd2abc to www2cda ... asd9abc to www9cda I can use 'asd.abc' to find the orignal string, however I don't know how to generate the target string. Any suggestion? Thanks, ... (2 Replies)
Discussion started by: mail4mz
2 Replies

5. UNIX for Dummies Questions & Answers

sed multiline pattern match

How can I write a script that takes a cisco config file and outputs every occurrence of two, or more, pattern matches through the whole config file? For example, out of a config file, i want to print out every line with interface, description and ip address through the whole file, and disregard... (3 Replies)
Discussion started by: knownasthatguy
3 Replies

6. Shell Programming and Scripting

Awk to match a pattern and perform a search after the first pattern

Hello Guyz I have been following this forum for a while and the solutions provided are super useful. I currently have a scenario where i need to search for a pattern and start searching by keeping the first pattern as a baseline ABC DEF LMN EFG HIJ LMN OPQ In the above text i need to... (8 Replies)
Discussion started by: RickCharles
8 Replies

7. Shell Programming and Scripting

Awk-sed help : to remove first and last line with pattern match:

awk , sed Experts, I want to remove first and last line after pattern match "vg" : I am trying : # sed '1d;$d' works fine , but where the last line is not having vg entry it is deleting one line of data. - So it should check for the pattern vg if present , then it should delete the line ,... (5 Replies)
Discussion started by: rveri
5 Replies

8. Shell Programming and Scripting

sed : match one pattern then the next consecutive second pattern not working

Ive used this snippet of code on a solaris box thousands of times. But it isnt working on the new linux box sed -n '/interface LoopBack0/{N;/ ip address /p;}' *.conf its driving me nuts !! Is there something Im missing ? (7 Replies)
Discussion started by: popeye
7 Replies

9. Shell Programming and Scripting

Sorting content between match pattern and move on with awk and sed

S 0.0 0.0 (reg, inst050) k e f d c S 0.0 0.0 (mux, m030) k g r s x v S 0.0 0.0 (reg, inst020) q s n m (12 Replies)
Discussion started by: ctphua
12 Replies

10. Shell Programming and Scripting

Get range out using sed or awk, only if given pattern match

Input: START OS:: UNIX Release: xxx Version: xxx END START OS:: LINUX Release: xxx Version: xxx END START OS:: Windows Release: xxx Version: xxx ENDHere i am trying to get all the information between START and END, only if i could match OS Type. I can get all the data between the... (3 Replies)
Discussion started by: Dharmaraja
3 Replies
Bio::FeatureIO::ptt(3pm)				User Contributed Perl Documentation				  Bio::FeatureIO::ptt(3pm)

NAME
Bio::FeatureIO::ptt - read/write features in PTT format SYNOPSIS
# read features my $fin = Bio::FeatureIO->new(-file=>'genes.ptt', -format=>'ptt'); my @cds; while (my $f = $fin->next_feature) { push @cds, $f if $f->strand > 0; } # write features (NOT IMPLEMENTED) my $fout = Bio::FeatureIO->new(-fh=>*STDOUT, -format=>'ptt'); for my $f (@cds) { $fout->write_feature($f); } DESCRIPTION
The PTT file format is a table of protein features. It is used mainly by NCBI who produce PTT files for all their published genomes found in <ftp://ftp.ncbi.nih.gov/genomes/>. It has the following format: Line 1 Description of sequence to which the features belong eg. "Leptospira interrogans chromosome II, complete sequence - 0..358943" It is usually equivalent to the DEFINITION line of a Genbank file, with the length of the sequence appended. It is unclear why "0" is used as a starting range, it should be "1". Line 2 Number of feature lines in the table eg. "367 proteins" Line 3 Column headers, tab separated eg. "Location Strand Length PID Gene Synonym Code COG Product" Location : "begin..end" span of feature Strand : "+" or "-" Length : number of amino acids excluding the stop codon PID : analogous to Genbank /db_xref="GI:xxxxxxxxx" Gene : analogous to Genbank /gene="xxxx" Synonym : analogous to Genbank /locus_tag="xxxx" Synonym : analogous to Genbank /locus_tag="xxxx" COG : CDD COG code with COG letter categories appended Product : analogous to Genbank /product="xxxx" Line 4 onwards Feature lines, nine columns, tab separated, "-" used for empty fields eg. "2491..3423 + 310 24217063 metF LB002 - COG0685E 5,10-methylenetetrahydrofolate reductase" 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 - Torsten Seemann Email torsten.seemann AT infotech.monash.edu.au CONTRIBUTORS
Based on bed.pm and gff.pm by Allen Day. APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ _initialize Title : _initialize Function: Reading? parses the header of the input Writing? next_feature Title : next_feature Usage : $io->next_feature() Function: read the next feature from the PTT file Example : Args : Returns : Bio::SeqFeatureI object write_feature (NOT IMPLEMENTED) Title : write_feature Usage : $io->write_feature($feature) Function: write a Bio::SeqFeatureI object in PTT format Example : Args : Bio::SeqFeatureI object Returns : description Title : description Usage : $obj->description($newval) Function: set/get the PTT file description for/from line one Example : Returns : value of description (a scalar) Args : on set, new value (a scalar or undef, optional) protein_count Title : protein_count Usage : $obj->protein_count($newval) Function: set/get the PTT protein count for/from line two Example : Args : on set, new value (a scalar or undef, optional) Returns : value of protein_count (a scalar) perl v5.14.2 2012-03-02 Bio::FeatureIO::ptt(3pm)
All times are GMT -4. The time now is 04:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy