Sponsored Content
Full Discussion: Fixing a shell script
Top Forums Shell Programming and Scripting Fixing a shell script Post 302957318 by RudiC on Friday 9th of October 2015 06:35:20 AM
Old 10-09-2015
This one creates three files: DNA.OUT, RNA.OUT, and AminoAcids from the input file, and prints the numbers of non-empty and empty lines in the file:
Code:
awk '
/^[     ]*$/    {EMP++
                 next
                }
/^>/    {$0=""
        }

        {print > "DNA.out"
         gsub (/A/, "U")
         gsub (/C/, "c")
         gsub (/G/, "C")
         gsub (/T/, "A")
         gsub (/c/, "G")
         print > "RNA.OUT"
         gsub (/.../, "& ")
         gsub (/UU[CU] /, "Phe ")
         gsub (/UA[UC] /, "Tyr ")
         gsub (/GC[ACGU] /, "Ala ")
         gsub (/GG[ACGU] /, "Gly ")
         gsub (/CC[ACGU] /, "Pro ")
         gsub (/AC[ACGU] /, "Thr ")
         gsub (/GU[ACGU] /, "Val ")
         gsub (/(CG[ACGU]|AG[AG]) /, "Arg ")
         gsub (/(CU[ACGU]|UU[AG]) /, "Leu ")
         gsub (/(UC[ACGU]|AG[CU]) /, "Ser ")
         print > "AminoAcids"
        }

END     {print "lines: ", NR-EMP
         print "empty: ", EMP
        }
' file

I did NOT convert ALL of the RNA-Amino combinations from your sed file; should be easliy doable for you with the samples given...
This User Gave Thanks to RudiC For This Post:
 

9 More Discussions You Might Find Interesting

1. Linux

fixing with sed

I am trying to replace the value of $f3 but its not working . I don't know what I am missing here . cat dim_copy.20080516.sql | grep -i "create view" | grep -v OPSDM002 | while read f1 f2 f3 f4 f5 f6 f7 f8 f9 do echo " $f3 " sed -e... (13 Replies)
Discussion started by: capri_drm
13 Replies

2. Shell Programming and Scripting

Fixing the width of a word

Is there a way to fix the width of the word being printed to a file? I am trying to create an output to a file with columns , like a spread sheet. I have used "\t" to adjust the columns but still it does not show well in the file, mainly due to the variable length values in the column so \t does... (1 Reply)
Discussion started by: davidtd
1 Replies

3. Shell Programming and Scripting

help fixing awk statement

awk "BEGIN {if($MessageREAD<$ThresholdW) {print \"OK\" ; exit 0} else if(($MessageREAD>=$ThresholdW) && ($MessageREAD<$ThresholdC)) {print \"WARNING\" ; exit 1}" else if($MessageREAD<=$ThresholdC) {print \"CRITICAL\" ;... (4 Replies)
Discussion started by: SkySmart
4 Replies

4. Solaris

help needed for fixing zfs bug

Hi Experts I've problem in a my office server (solaris 10 - x86) version. x4600 M2 hardware This system is getting rebooted because of zfs bug I've applied patch using live upgrade with live new environment created and applied the patch which oracle suggested( 144501-19), it asks for... (3 Replies)
Discussion started by: SunSolars_admin
3 Replies

5. Homework & Coursework Questions

Help fixing my database script

1. The problem statement, all variables and given/known data: I need help I get a variant of syntax errors when compiling my script to maintain a database. It's a simple database meant to create/view/maintain vehicles. 2. Relevant commands, code, scripts, algorithms: my if statements have... (5 Replies)
Discussion started by: gamernerd101
5 Replies

6. AIX

Fixing security problem

Hi I use Rapid 7 to check some servers ( AIX 5.3 ) for security problems. There are 2 problems I don't know to deal with 1. Problem : TCP Sequence Number Approximation Vulnerability Solution : _Enable TCP MD5 Signature 2. Problem : HTTP Basic Authentication Enable Solution : _ Use... (5 Replies)
Discussion started by: bobochacha29
5 Replies

7. UNIX for Advanced & Expert Users

Help with fixing screen position

Hey guys, I am trying to make print a pattern with * on a 10*10 two dimensional array in a for loop and I want the incoming 10*10 to overlap the previous 10*10 so that the * look like it is moving. is there a way to fix the screen position? ever time it prints a 10*10 the screen moves. ... (3 Replies)
Discussion started by: amit14august
3 Replies

8. Shell Programming and Scripting

Help fixing awk code

can someone please help me spot and fix the issue with the following code: awk -F, -v SEARCHPATT="(Wed|Tue)" -v ADDISTR="Mon|Tue|Wed|Thu|Fri|Sat|Sun" -vVF="$VALFOUND" "BEGIN{ {D = D = 1 D = D = 2 } $0 ~ "," VF "," {L = 1 ... (9 Replies)
Discussion started by: SkySmart
9 Replies

9. UNIX for Beginners Questions & Answers

Getting started with fixing bugs for Linux

Okay I want to try my luck at fixing bugs for the Fedora OS, but I guess this question deals with any Linux distro or any open source OS for that matter. I want to know how I can start fixing bugs on the OS level. For example the particular bug that I want to target is this logout bug I mean... (6 Replies)
Discussion started by: sreyan32
6 Replies
YRI(1)																	    YRI(1)

NAME
yri - documentation tool in console for Ruby SYNOPSIS
yri [options] Path_to_object DESCRIPTION
yard(1) is an extensible documentation generation tool for the Ruby programming language. It enables the user to generate consistent, usable documentation that can be exported to a number of formats very easily, and also supports extending for custom Ruby constructs such as custom class level definitions. yri(1), synonym for yard ri gives the possibility to read the documentation for Ruby programs inside a console, pretty much like ri(1). OPTIONS
General Options: -b, --db FILE Use a specified .yardoc db to search in -T, --no-pager No pager -p, --pager PAGER Use PAGER as a pager Other options: -e, --load FILE A Ruby script to load before running command. --plugin PLUGIN Load a YARD plugin (gem with `yard-' prefix) --legacy Use old style Ruby parser and handlers. Always on in 1.8.x. --safe Enable safe mode for this instance -q, --quiet Show no warnings. --verbose Show more information. --debug Show debugging information. --backtrace Show stack traces -v, --version Show version. -h, --help Show a help message, similar to this page. EXAMPLES
yri String#gsub SEE ALSO
yard(1). AUTHORS
yard has been developed by Loren Segal <lsegal@soen.ca>. This manual page has been written for the Debian Project by CA(C)dric Boutillier (but may used by others). 2012-05-08 YRI(1)
All times are GMT -4. The time now is 01:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy