Sponsored Content
Top Forums Shell Programming and Scripting awk to supress error message with custom text Post 302993408 by cmccabe on Thursday 9th of March 2017 12:09:59 PM
Old 03-09-2017
awk to supress error message with custom text

After a bash function is run the below file is produced:

out_name.txt tab-delimeted
Code:
Input    Errors and warnings    AccNo    Genesymbol    Variant    Reference Sequence Start Descr.    Coding DNA Descr.    Protein Descr.    GeneSymbol Coding DNA Descr.    GeneSymbol Protein Descr.    Genomic Reference    Coding Reference    Protein Reference    Affected Transcripts    Affected Proteins    Restriction Sites Created    Restriction Sites Deleted
NM_003924.3:c.242-1G>A    (variantchecker): Intronic position given for a non-genomic reference sequence.    
NM_003924.3:c.*18_*19delGCinsAA        NM_003924.3    PHOX2B_v001    c.*18_*19delGCinsAA    n.1323_1324delinsAA    c.*18_*19delinsAA    p.(=)    PHOX2B_v001:c.*18_*19delinsAA    PHOX2B_v001:p.(=)        NM_003924.3    NP_003915.2    NM_003924.3(PHOX2B_v001):c.*18_*19delinsAA    NM_003924.3(PHOX2B_i001):p.(=)    HpyAV        
NM_003924.3:c.013G>T        NM_003924.3    PHOX2B_v001    c.013G>T    n.373G>T    c.13G>T    p.(Glu5*)    PHOX2B_v001:c.13G>T    PHOX2B_v001:p.(Glu5*)        NM_003924.3    NP_003915.2    NM_003924.3(PHOX2B_v001):c.13G>T    NM_003924.3(PHOX2B_i001):p.(Glu5*)

I am trying to add a condition that will suppress the warning message produced if $2 is
(variantchecker): Intronic position given for a non-genomic reference sequence.,
In addition, that the $1 string "is an intronic variant" is displayed instead of the waring. My 2nd attempt to incorporate these changes is below,
which executes but nothing results. Thank you Smilie.

desired result
Code:
NM_003924.3:c.242-1G>A is an intronic variant

awk
Code:
while read LINE; do
    awk -F'\t' '$2 == "variantchecker): Intronic position given for a non-genomic reference sequence." {print $1 && "is an intronic variant"}' 2>/dev/null
done < out_name.txt


Last edited by cmccabe; 03-09-2017 at 01:11 PM.. Reason: fixed format
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to supress a "Killed" message when a process is terminated?

Does anyone know how I can supress the "Killed" message that's produced when I kill a process? I've got a script that performs a "tail -f" on a database error log and pipes the output into an awk script which looks for certain error messages and forwards any that qualify to my pager. The problem... (2 Replies)
Discussion started by: kenwolff
2 Replies

2. UNIX for Advanced & Expert Users

Supress error message

Hi All this is a simple script #! /bin/bash FileCnt=`ls -lrt $DIR/* | wc -l` echo $FileCnt how could i escape the error msg if there are no files in $DIR ls: /home/sayantan/test/files/cnt/*: No such file or directory 0 Looking forward for a quick reply Regards, Newbie (2 Replies)
Discussion started by: newbie07
2 Replies

3. Shell Programming and Scripting

Division by zero error message in AWK

How can I modify my awk code to get rid of the divion by zero error message? If I run the script without an input file, it should return error message "Input file missing" but not divison by zero. Code: #!/bin/nawk -f BEGIN { if (NR == 0) {print "Input file... (4 Replies)
Discussion started by: Pauline mugisha
4 Replies

4. Shell Programming and Scripting

awk error message: division by zero attempted

Hi, I'm executing unixbench tool v4.1 on an embedded system and I'm getting these error messages: Execl Throughput 1 2 3awk: /unixbench/unixbench-4.1.0/pgms/loops.awk:38: (FILENAME=- FNR=4) fatal: division by zero attempted Pipe Throughput 1 2 3 4 5 6 7 8 9 10awk:... (3 Replies)
Discussion started by: rogelio
3 Replies

5. Shell Programming and Scripting

supress error messages

Hi I have a script which connects to oracle using sqlplus if ! check_sqlplus "$ORACLE_SID" ; then echo "Unable to use sqlplus for sid $ORACLE_SID" return 1 else echo "attempting to connect to database" echo $ORACLE_HOME echo $ORACLE_SID echo "Status before entering... (2 Replies)
Discussion started by: xiamin
2 Replies

6. Shell Programming and Scripting

Error message while using awk

Hi Friends, I am using the below code in my script: elif then NEW_LINE=`echo $Line | awk '{sub ($4, "2010\\\/04\\\/07"); printf "# %s %9s %18s\n", $2,$3,$4}'` sed $n" s/.*/$NEW_LINE/" kfile > tmp mv tmp kfile fi Around 30 lines are replaced by this code... (2 Replies)
Discussion started by: sugan
2 Replies

7. Shell Programming and Scripting

AWk - supress warning

Hi, I am trying to run a script using awk and sed a few times. The script itself seems to work fine but in a final awk statement it throws up a warning: awk: warning: escape sequence `\.' treated as plain `.' script: ... (3 Replies)
Discussion started by: HugoDarley
3 Replies

8. Shell Programming and Scripting

Supress text

Hi, I was looking for a simple code to suppress the text between 2 characters. the characters can be of same kind like "*" or "(" and ")". The number of characters are not consistent and could vary. How can I suppress the text between 2 characters? Example: Input : Hello (Within Bracket)... (8 Replies)
Discussion started by: ahmedwaseem2000
8 Replies

9. Shell Programming and Scripting

Supress java error output to shell

Hello, I know this isn't exactly a shell script question but I'm not sure where else to post it. I am running a java program out of a shell script. There are times when I get an error like, "java.lang.ArrayIndexOutOfBoundsException: 22 at blah, blah at blah, blah ... (3 Replies)
Discussion started by: LMHmedchem
3 Replies

10. IP Networking

Insmod custom module fails with message : disagrees about version of symbol ...

Hello : I want to make a netfilter conntrack module for myself. So I copy all the source code about netfilter conntrack from kernel source tree to my external directory. It can be insmod after compiled. Then I add some members to the struct nf_conn, and it 's compiled successfully. However, it... (1 Reply)
Discussion started by: 915086731
1 Replies
Bio::Seq::EncodedSeq(3pm)				User Contributed Perl Documentation				 Bio::Seq::EncodedSeq(3pm)

NAME
Bio::Seq::EncodedSeq - subtype of Bio::LocatableSeq to store DNA that encodes a protein SYNOPSIS
$obj = Bio::Seq::EncodedSeq->new(-seq => $dna, -encoding => "CCCCCCCIIIIICCCCC", -start => 1, -strand => 1, -length => 17); # splice out (and possibly revcomp) the coding sequence $cds = obj->cds; # obtain the protein translation of the sequence $prot = $obj->translate; # other access/inspection routines as with Bio::LocatableSeq and # Bio::SeqI; note that coordinates are relative only to the DNA # sequence, not it's implicit encoded protein sequence. DESCRIPTION
Bio::Seq::EncodedSeq is a Bio::LocatableSeq object that holds a DNA sequence as well as information about the coding potential of that DNA sequence. It is meant to be useful in an alignment context, where the DNA may contain frameshifts, gaps and/or introns, or in describing the transcript of a gene. An EncodedSeq provides the ability to access the "spliced" coding sequence, meaning that all introns and gaps are removed, and any frameshifts are adjusted to provide a "clean" CDS. In order to make simultaneous use of either the DNA or the implicit encoded protein sequence coordinates, please see Bio::Coordinate::EncodingPair. ENCODING
We use the term "encoding" here to refer to the series of symbols that we use to identify which residues of a DNA sequence are protein- coding (i.e. part of a codon), intronic, part of a 5' or 3', frameshift "mutations", etc. From this information, a Bio::Seq::EncodedSeq is able to "figure out" its translational CDS. There are two sets of coding characters, one termed "implicit" and one termed "explicit". The "implicit" encoding is a bit simpler than the "explicit" encoding: 'C' is used for any nucleotide that's part of a codon, 'U' for any UTR, etc. The full list is shown below: Code Meaning ---- ------- C coding I intronic U untranslated G gapped (for use in alignments) F a "forward", +1 frameshift B a "backward", -1 frameshift The "explicit" encoding is just an expansion of the "implicit" encoding, to denote phase: Code Meaning ---- ------- C coding, 1st codon position D coding, 2nd codon position E coding, 3rd codon position I intronic, phase 0 (relative to intron begin) J intronic, phase 1 K intronic, phase 2 U untranslated 3'UTR V untranslated 5'UTR G gapped (for use in alignments) F a "forward", +1 frameshift B a "backward", -1 frameshift Note that the explicit coding is meant to provide easy access to position/phase specific nucleotides: $obj = Bio::Seq::EncodedSeq->new(-seq => "ACAATCAGACTACG...", -encoding => "CCCCCCIII..." ); # fetch arrays of nucleotides at each codon position: my @pos1 = $obj->dnaseq(encoding => 'C', explicit => 1); my @pos2 = $obj->dnaseq(encoding => 'D'); my @pos3 = $obj->dnaseq(encoding => 'E'); # fetch arrays of "3-1" codon dinucleotides, useful for genomic # signature analyses without compounding influences of codon bias: my @pairs = $obj->dnaseq(encoding => 'EC'); 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 - Aaron Mackey Email amackey@virginia.edu APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new Usage : $obj = Bio::Seq::EncodedSeq->new(-seq => "AGTACGTGTCATG", -encoding => "CCCCCCFCCCCCC", -id => "myseq", -start => 1, -end => 13, -strand => 1 ); Function: creates a new Bio::Seq::EncodedSeq object from a supplied DNA sequence Returns : a new Bio::Seq::EncodedSeq object Args : seq - primary nucleotide sequence used to encode the protein; note that any positions involved in a gap ('G') or backward frameshift ('B') should have one or more gap characters; if the encoding specifies G or B, but no (or not enough) gap characters exist, *they'll be added*; similary, if there are gap characters without a corresponding G or B encoding, G's will be inserted into the encoding. This allows some flexibility in specifying your sequence and coding without having to calculate a lot of the encoding for yourself. encoding - a string of characters (see Encoding Table) describing backwards frameshifts implied by the encoding but not present in the sequence will be added (as '-'s) to the sequence. If not supplied, it will be assumed that all positions are coding (C). Encoding may include either implicit phase encoding characters (i.e. "CCC") and/or explicit encoding characters (i.e. "CDE"). Additionally, prefixed numbers may be used to denote repetition (i.e. "27C3I28C"). Alternatively, encoding may be a hashref datastructure, with encoding characters as keys and Bio::LocationI objects (or arrayrefs of Bio::LocationI objects) as values, e.g.: { C => [ Bio::Location::Simple->new(1,9), Bio::Location::Simple->new(11,13) ], F => Bio::Location::Simple->new(10,10), } # same as "CCCCCCCCCFCCC" Note that if the location ranges overlap, the behavior of the encoding will be undefined (well, it will be defined, but only according to the order in which the hash keys are read, which is basically undefined ... just don't do that). id, start, end, strand - as with Bio::LocatableSeq; note that the coordinates are relative to the encoding DNA sequence, not the implicit protein sequence. If strand is reversed, then the encoding is assumed to be relative to the reverse strand as well. encoding Title : encoding Usage : $obj->encoding("CCCCCC"); $obj->encoding( -encoding => { I => $location } ); $enc = $obj->encoding(-explicit => 1); $enc = $obj->encoding("CCCCCC", -explicit => 1); $enc = $obj->encoding(-location => $location, -explicit => 1, -absolute => 1 ); Function: get/set the objects encoding, either globally or by location(s). Returns : the (possibly new) encoding string. Args : encoding - see the encoding argument to the new() function. explicit - whether or not to return explicit phase information in the coding (i.e. "CCC" becomes "CDE", "III" becomes "IJK", etc); defaults to 0. location - optional; location to get/set the encoding. Defaults to the entire sequence. absolute - whether or not the locational elements (either in the encoding hashref or the location argument) are relative to the absolute start/end of the Bio::LocatableSeq, or to the internal, relative coordinate system (beginning at 1); defaults to 0 (i.e. relative) cds Title : cds Usage : $cds = $obj->cds(-nogaps => 1); Function: obtain the "spliced" DNA sequence, by removing any nucleotides that participate in an UTR, forward frameshift or intron, and replacing any unknown nucleotide implied by a backward frameshift or gap with N's. Returns : a Bio::Seq::EncodedSeq object, with an encoding consisting only of "CCCC..". Args : nogaps - strip any gap characters (resulting from 'G' or 'B' encodings), rather than replacing them with N's. translate Title : translate Usage : $prot = $obj->translate(@args); Function: obtain the protein sequence encoded by the underlying DNA sequence; same as $obj->cds()->translate(@args). Returns : a Bio::PrimarySeq object. Args : same as the translate() function of Bio::PrimarySeqI protseq Title : seq Usage : $protseq = $obj->protseq(); Function: obtain the raw protein sequence encoded by the underlying DNA sequence; This is the same as calling $obj->translate()->seq(); Returns : a string of single-letter amino acid codes Args : same as the seq() function of Bio::PrimarySeq; note that this function may not be used to set the protein sequence; see the dnaseq() function for that. dnaseq Title : dnaseq Usage : $dnaseq = $obj->dnaseq(); $obj->dnaseq("ACGTGTCGT", "CCCCCCCCC"); $obj->dnaseq(-seq => "ATG", -encoding => "CCC", -location => $loc ); @introns = $obj->$dnaseq(-encoding => 'I') Function: get/set the underlying DNA sequence; will overwrite any current DNA and/or encoding information present. Returns : a string of single-letter nucleotide codes, including any gaps implied by the encoding. Args : seq - the DNA sequence to be used as a replacement encoding - the encoding of the DNA sequence (see the new() constructor); defaults to all 'C' if setting a new DNA sequence. If no new DNA sequence is being provided, then the encoding is used as a "filter" for which to return fragments of non-overlapping DNA that match the encoding. location - optional, the location of the DNA sequence to get/set; defaults to the entire sequence. perl v5.14.2 2012-03-02 Bio::Seq::EncodedSeq(3pm)
All times are GMT -4. The time now is 01:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy