Sponsored Content
Operating Systems Linux How to remove lines without a particular string in either column? Post 302958074 by RudiC on Monday 19th of October 2015 06:45:26 AM
Old 10-19-2015
Try also
Code:
awk '2==gsub(/refseq:NP/,"&")' file
DIP-23436N|refseq:NP_536784       DIP-23130N|refseq:NP_652017
DIP-22958N|refseq:NP_651195       DIP-20072N|refseq:NP_724597
DIP-22928N|refseq:NP_569972       DIP-22042N|refseq:NP_536744|uniprotkb:P54622

---------- Post updated at 12:45 ---------- Previous update was at 12:43 ----------

If there's more than two columns, use NF== as RavinderSingh13 does.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to remove a string from a specific column in a file

Hello, A basic query. How can I remove a string from a specific column. For example, remove "abcd" just from column 2 in example file: abcd abcd1 abcd abcd2 abcd abcd3 to get output: abcd 1 abcd 2 abcd 3 Thank you!:) (4 Replies)
Discussion started by: auburn
4 Replies

2. Shell Programming and Scripting

Remove lines based on column value

Hi All, I just need a quick fix here. I need to delete all lines containing "." in the 6th column. Input: 1 1055498 . G T 5.46 . 1 1902377 . C T 7.80 . 1 1031540 . A G 34.01 PASS 1 ... (2 Replies)
Discussion started by: Hkins552
2 Replies

3. Shell Programming and Scripting

Remove lines that match string at end of column

I have this: 301205 0000030000041.49000000.00 2011111815505 908 301205 0000020000029.10000000.00 2011111815505 962 301205 0000010000027.56000000.00 2011111815505 3083 312291 ... (2 Replies)
Discussion started by: herot
2 Replies

4. UNIX for Dummies Questions & Answers

[SOLVED] remove lines that have duplicate values in column two

Hi, I've got a file that I'd like to uniquely sort based on column 2 (values in column 2 begin with "comp"). I tried sort -t -nuk2,3 file.txtBut got: sort: multi-character tab `-nuk2,3' "man sort" did not help me out Any pointers? Input: Output: (5 Replies)
Discussion started by: pathunkathunk
5 Replies

5. UNIX for Dummies Questions & Answers

Remove lines contain certain string

i have file input aa,20120626 bb,45Cexpect to remove all lines when $2 doesn't end with 'C" output bb,45Ci tried this sed -i -nl -e '/\<C\>/ {p;} ' file1 but the result : sed illegal option -i (5 Replies)
Discussion started by: radius
5 Replies

6. UNIX for Dummies Questions & Answers

Remove lines in a positional file based on string value

Gurus, I am relatively new to Unix scripting and am struck with a problem in my script. I have positional input file which has a FLAG indicator in at position 11 in every record of the file. If the Flag has value =Y, then the record from the input needs to be written to a new file.However if... (3 Replies)
Discussion started by: gsam
3 Replies

7. Shell Programming and Scripting

Remove multiple lines from a particular string to particular string

Hi, I have a file containing the DDLs of tables in a schema. From that I need to remove all the lines from a starting string till a specific string. Here is an example. File1.txt ------------- CREATE TABLE "SCHEMA1"."LKP11_TBL_USERS" ( "ID" NUMBER(8,0) NOT NULL ENABLE, "USER_ID"... (3 Replies)
Discussion started by: satyaatcgi
3 Replies

8. Shell Programming and Scripting

Remove lines matching a substring in a specific column

Dear group, I have following input text file: Brit 2016 11 18 12 00 10 1.485,00 EUR Brit 2016 11 18 12 00 10 142,64 EUR Brit 2016 11 18 12 00 10 19,80 EUR Brit 2016 11 18 12 00 10 545,00 EUR Brit 2016 11 18 12 00 10 6.450,00 EUR... (3 Replies)
Discussion started by: gfhsd
3 Replies

9. Shell Programming and Scripting

Remove duplicate consecutive lines with specific string

Hello, I'm trying to remove the duplicate consecutive lines with specific string "WARNING". File.txt abc; WARNING 2345 WARNING 2345 WARNING 2345 WARNING 2345 WARNING 2345 bcd; abc; 123 123 123 WARNING 1234 WARNING 2345 WARNING 2345 efgh; (6 Replies)
Discussion started by: Mannu2525
6 Replies

10. UNIX for Beginners Questions & Answers

Remove newline character from column spread over multiple lines in a file

Hi, I came across one issue recently where output from one of the columns of the table from where i am creating input file has newline characters hence, record in the file is spread over multiple lines. Fields in the file are separated by pipe (|) delimiter. As header will never have newline... (4 Replies)
Discussion started by: Prathmesh
4 Replies
Bio::Tools::Run::Maq(3pm)				User Contributed Perl Documentation				 Bio::Tools::Run::Maq(3pm)

NAME
Bio::Tools::Run::Maq - Run wrapper for the Maq short-read assembler *BETA* SYNOPSIS
# create an assembly $maq_fac = Bio::Tools::Run::Maq->new(); $maq_assy = $maq_fac->run( 'reads.fastq', 'refseq.fas' ); # if IO::Uncompress::Gunzip is available... $maq_assy = $maq_fac->run( 'reads.fastq.gz', 'refseq.gz'); # paired-end $maq_assy = $maq_fac->run( 'reads.fastq', 'refseq.fas', 'paired-reads.fastq'); # be more strict $maq_fac->set_parameters( -c2q_min_map_quality => 60 ); $maq_assy = $maq_fac->run( 'reads.fastq', 'refseq.fas', 'paired-reads.fastq'); # run maq commands separately $maq_fac = Bio::Tools::Run::Maq->new( -command => 'pileup', -single_end_quality => 1 ); $maq_fac->run_maq( -bfa => 'refseq.bfa', -map => 'maq_assy.map', -txt => 'maq_assy.pup.txt' ); DESCRIPTION
This module provides a wrapper interface for Heng Li's reference-directed short read assembly suite "maq" (see http://maq.sourceforge.net/maq-man.shtml <http://maq.sourceforge.net/maq-man.shtml> for manuals and downloads). There are two modes of action. o EasyMaq The first is a simple pipeline through the "maq" commands, taking your read data in and squirting out an assembly object of type Bio::Assembly::IO::maq. The pipeline is based on the one performed by "maq.pl easyrun": Action maq commands ------ ------------ data conversion to fasta2bfa, fastq2bfq maq binary formats map sequence reads map to reference seq assemble, creating assemble consensus convert map & cns mapview, cns2fq files to plaintext (for B:A:IO:maq) Command-line options can be directed to the "map", "assemble", and "cns2fq" steps. See "OPTIONS" below. o BigMaq The second mode is direct access to "maq" commands. To run a "maq" command, construct a run factory, specifying the desired command using the "-command" argument in the factory constructor, along with options specific to that command (see "OPTIONS"): $maqfac->Bio::Tools::Run::Maq->new( -command => 'fasta2bfa' ); To execute, use the "run_maq" methods. Input and output files are specified in the arguments of "run_maq" (see "FILES"): $maqfac->run_maq( -fas => "myref.fas", -bfa => "myref.bfa" ); OPTIONS
"maq" is complex, with many subprograms (commands) and command-line options and file specs for each. This module attempts to provide commands and options comprehensively. You can browse the choices like so: $maqfac = Bio::Tools::Run::Maq->new( -command => 'assemble' ); # all maq commands @all_commands = $maqfac->available_parameters('commands'); @all_commands = $maqfac->available_commands; # alias # just for assemble @assemble_params = $maqfac->available_parameters('params'); @assemble_switches = $maqfac->available_parameters('switches'); @assemble_all_options = $maqfac->available_parameters(); Reasonably mnemonic names have been assigned to the single-letter command line options. These are the names returned by "available_parameters", and can be used in the factory constructor like typical BioPerl named parameters. See http://maq.sourceforge.net/maq-manpage.shtml <http://maq.sourceforge.net/maq-manpage.shtml> for the gory details. FILES
When a command requires filenames, these are provided to the "run_maq" method, not the constructor ("new()"). To see the set of files required by a command, use "available_parameters('filespec')" or the alias "filespec()": $maqfac = Bio::Tools::Run::Maq->new( -command => 'map' ); @filespec = $maqfac->filespec; This example returns the following array: map bfa bfq1 #bfq2 2>#log This indicates that map ("maq" binary mapfile), bfa ("maq" binary fasta), and bfq ("maq" binary fastq) files MUST be specified, another bfq file MAY be specified, and a log file receiving STDERR also MAY be specified. Use these in the "run_maq" call like so: $maqfac->run_maq( -map => 'my.map', -bfa => 'myrefseq.bfa', -bfq1 => 'reads1.bfq', -bfq2 => 'reads2.bfq' ); Here, the "log" parameter was unspecified. Therefore, the object will store the programs STDERR output for you in the "stderr()" attribute: handle_map_warning($maqfac) if ($maqfac->stderr =~ /warning/); STDOUT for a run is also saved, in "stdout()", unless a file is specified to slurp it according to the filespec. "maq" STDOUT usually contains useful information on the run. 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: http://redmine.open-bio.org/projects/bioperl/ AUTHOR - Mark A. Jensen Email maj -at- fortinbras -dot- us APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new() Title : new Usage : my $obj = new Bio::Tools::Run::Maq(); Function: Builds a new Bio::Tools::Run::Maq object Returns : an instance of Bio::Tools::Run::Maq Args : run Title : run Usage : $assembly = $maq_assembler->run($read1_fastq_file, $refseq_fasta_file, $read2_fastq_file); Function: Run the maq assembly pipeline. Returns : Assembly results (file, IO object or Assembly object) Args : - fastq file containing single-end reads - fasta file containing the reference sequence - [optional] fastq file containing paired-end reads Note : gzipped inputs are allowed if IO::Uncompress::Gunzip is available run_maq() Title : run_maq Usage : $obj->run_maq( @file_args ) Function: Run a maq command as specified during object contruction Returns : Args : a specification of the files to operate on: stdout() Title : stdout Usage : $fac->stdout() Function: store the output from STDOUT for the run, if no file specified in run_maq() Example : Returns : scalar string Args : on set, new value (a scalar or undef, optional) stderr() Title : stderr Usage : $fac->stderr() Function: store the output from STDERR for the run, if no file is specified in run_maq() Example : Returns : scalar string Args : on set, new value (a scalar or undef, optional) Bio::Tools::Run::AssemblerBase overrides _check_sequence_input() No-op. _check_optional_quality_input() No-op. _prepare_input_sequences Convert input fastq and fasta to maq format. _collate_subcmd_args() Title : _collate_subcmd_args Usage : $args_hash = $self->_collate_subcmd_args Function: collate parameters and switches into command-specific arg lists for passing to new() Returns : hash of named argument lists Args : [optional] composite cmd prefix (scalar string) [default is 'run'] _run() Title : _run Usage : $factory->_run() Function: Run a maq assembly pipeline Returns : depends on call (An assembly file) Args : - single end read file in maq bfq format - reference seq file in maq bfa format - [optional] paired end read file in maq bfq format available_parameters() Title : available_parameters Usage : @cmds = $fac->available_commands('commands'); Function: Use to browse available commands, params, or switches Returns : array of scalar strings Args : 'commands' : all maq commands 'params' : parameters for this object's command 'switches' : boolean switches for this object's command 'filespec' : the filename spec for this object's command 4Geeks : Overrides Bio::ParameterBaseI via Bio::Tools::Run::AssemblerBase perl v5.12.3 2011-06-18 Bio::Tools::Run::Maq(3pm)
All times are GMT -4. The time now is 07:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy