Sponsored Content
Top Forums Shell Programming and Scripting Creating a condition on a bash script Post 303005293 by germany1517 on Monday 16th of October 2017 09:15:04 PM
Old 10-16-2017
Creating a condition on a bash script

I wrote a code to find codons in a DNA string. The only problem I have is how do I make the code only work for a file with DNA. This means the file only has the characters a,c,g,t and no white space characters.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help needed with creating challenging bash script with creating directories

Hi, Can someone help me with creating a bash shell script. I need to create a script that gets a positive number n as an argument. The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Discussion started by: I-1
7 Replies

2. Shell Programming and Scripting

bash script for testing existence of files/folders and creating if neither exist

Hi, I am new to shell-scripting, and doing a lot of reading. I am having some trouble getting started with a simple testing of scripting. I have been experimenting with if, loops, for, test, etc., but still unsure. I seem to have the hang of it when it comes to creating a single file or... (6 Replies)
Discussion started by: me2
6 Replies

3. Programming

Creating a bash script that create/open database

Hi. I have two text files(tables) which include some information and I want to make some query codes using them. First of all, I want to create bash script that read this two tables, create/open database and insert data from files into database. #!/bin/bash while read line; do ... (1 Reply)
Discussion started by: rlaxodus
1 Replies

4. Shell Programming and Scripting

Script in bash wchich creating a new users...

Hi, I am a new on this forum but i like :) I need a script in bash which will be crating a new user with folder for websites. For example: I will run this program and he creating a new user(with my name) and folder whcich name like user and if i will localho/~user in browser, she show me files from... (1 Reply)
Discussion started by: puclavv
1 Replies

5. Shell Programming and Scripting

Creating an Interactive Bash Script to Analyze a PCAP

Hello Everyone, I am currently trying to write a Bash Script to call a PCAP file. The command I will use in the script will be the following: tshark -r test.pcap -T fields -e frame.number -e frame.time -e eth.src -e eth.dst -e ip.src -e ip.dst -r ip.proto -E header=y -E separator=, quote=d -E... (4 Replies)
Discussion started by: MrTuxor
4 Replies

6. Shell Programming and Scripting

Need BASH Script Help to Move Files While Creating Directories

I've got this script to loop through all folders and move files that are more than 2 years old. I'm using the install command because it creates the necessary directories on the destination path and then I remove the source. I'd like to change the script to use the mv command since it is much... (4 Replies)
Discussion started by: consultant
4 Replies

7. Shell Programming and Scripting

Bash script if condition not executing

issue is with .txt files (7 Replies)
Discussion started by: anil529
7 Replies

8. Shell Programming and Scripting

Need Multiple checks inside if condition in a bash shell script

Hi, I need to perform the untar and rm operation if the file found is a .tar and does not have test.tar or hello.tar as the file names. Below is the loop to check the same. for tf in *.tar do if ] then found=1 ... (1 Reply)
Discussion started by: mohtashims
1 Replies

9. Shell Programming and Scripting

Creating bash script to process a data file based on the menu

Hey, im fairly new to unix and Im trying to make this unix project that would display a menu and do the following. MENU =========================== (p, P) Print users info (a, A) Add new user (s, S) Search user (d, D) Delete user (x,X) Exit Enter your choice: Trying to... (3 Replies)
Discussion started by: ultimaxtrd
3 Replies

10. UNIX for Beginners Questions & Answers

Condition in bash script

I want get from user and pass these parameters to bash script. script should copy files in user home directory. FYI: each file might be exist or not, might be one of them exist or four of them. Here is my script, it always copy file1 and seems only one of them execute! #!/bin/bash for... (6 Replies)
Discussion started by: indeed_1
6 Replies
Bio::Tools::CodonTable(3pm)				User Contributed Perl Documentation			       Bio::Tools::CodonTable(3pm)

NAME
Bio::Tools::CodonTable - Codon table object SYNOPSIS
# This is a read-only class for all known codon tables. The IDs are # the ones used by nucleotide sequence databases. All common IUPAC # ambiguity codes for DNA, RNA and amino acids are recognized. use Bio::Tools::CodonTable; # defaults to ID 1 "Standard" $myCodonTable = Bio::Tools::CodonTable->new(); $myCodonTable2 = Bio::Tools::CodonTable->new( -id => 3 ); # change codon table $myCodonTable->id(5); # examine codon table print join (' ', "The name of the codon table no.", $myCodonTable->id(4), "is:", $myCodonTable->name(), " "); # print possible codon tables $tables = Bio::Tools::CodonTable->tables; while ( ($id,$name) = each %{$tables} ) { print "$id = $name "; } # translate a codon $aa = $myCodonTable->translate('ACU'); $aa = $myCodonTable->translate('act'); $aa = $myCodonTable->translate('ytr'); # reverse translate an amino acid @codons = $myCodonTable->revtranslate('A'); @codons = $myCodonTable->revtranslate('Ser'); @codons = $myCodonTable->revtranslate('Glx'); @codons = $myCodonTable->revtranslate('cYS', 'rna'); # reverse translate an entire amino acid sequence into a IUPAC # nucleotide string my $seqobj = Bio::PrimarySeq->new(-seq => 'FHGERHEL'); my $iupac_str = $myCodonTable->reverse_translate_all($seqobj); # boolean tests print "Is a start " if $myCodonTable->is_start_codon('ATG'); print "Is a terminator " if $myCodonTable->is_ter_codon('tar'); print "Is a unknown " if $myCodonTable->is_unknown_codon('JTG'); DESCRIPTION
Codon tables are also called translation tables or genetic codes since that is what they represent. A bit more complete picture of the full complexity of codon usage in various taxonomic groups is presented at the NCBI Genetic Codes Home page. CodonTable is a BioPerl class that knows all current translation tables that are used by primary nucleotide sequence databases (GenBank, EMBL and DDBJ). It provides methods to output information about tables and relationships between codons and amino acids. This class and its methods recognized all common IUPAC ambiguity codes for DNA, RNA and animo acids. The translation method follows the conventions in EMBL and TREMBL databases. It is a nuisance to separate RNA and cDNA representations of nucleic acid transcripts. The CodonTable object accepts codons of both type as input and allows the user to set the mode for output when reverse translating. Its default for output is DNA. Note: This class deals primarily with individual codons and amino acids. However in the interest of speed you can translate longer sequence, too. The full complexity of protein translation is tackled by Bio::PrimarySeqI::translate. The amino acid codes are IUPAC recommendations for common amino acids: A Ala Alanine R Arg Arginine N Asn Asparagine D Asp Aspartic acid C Cys Cysteine Q Gln Glutamine E Glu Glutamic acid G Gly Glycine H His Histidine I Ile Isoleucine L Leu Leucine K Lys Lysine M Met Methionine F Phe Phenylalanine P Pro Proline O Pyl Pyrrolysine (22nd amino acid) U Sec Selenocysteine (21st amino acid) S Ser Serine T Thr Threonine W Trp Tryptophan Y Tyr Tyrosine V Val Valine B Asx Aspartic acid or Asparagine Z Glx Glutamine or Glutamic acid J Xle Isoleucine or Valine (mass spec ambiguity) X Xaa Any or unknown amino acid It is worth noting that, "Bacterial" codon table no. 11 produces an polypeptide that is, confusingly, identical to the standard one. The only differences are in available initiator codons. NCBI Genetic Codes home page: http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=c EBI Translation Table Viewer: http://www.ebi.ac.uk/cgi-bin/mutations/trtables.cgi Amended ASN.1 version with ids 16 and 21 is at: ftp://ftp.ebi.ac.uk/pub/databases/geneticcode/ Thanks to Matteo diTomasso for the original Perl implementation of these tables. 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 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 - Heikki Lehvaslaiho Email: heikki-at-bioperl-dot-org APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ id Title : id Usage : $obj->id(3); $id_integer = $obj->id(); Function: Sets or returns the id of the translation table. IDs are integers from 1 to 15, excluding 7 and 8 which have been removed as redundant. If an invalid ID is given the method returns 0, false. Example : Returns : value of id, a scalar, 0 if not a valid Args : newvalue (optional) name Title : name Usage : $obj->name() Function: returns the descriptive name of the translation table Example : Returns : A string Args : None tables Title : tables Usage : $obj->tables() or Bio::Tools::CodonTable->tables() Function: returns a hash reference where each key is a valid codon table id() number, and each value is the corresponding codon table name() string Example : Returns : A hashref Args : None translate Title : translate Usage : $obj->translate('YTR') Function: Returns a string of one letter amino acid codes from nucleotide sequence input. The imput can be of any length. Returns 'X' for unknown codons and codons that code for more than one amino acid. Returns an empty string if input is not three characters long. Exceptions for these are: - IUPAC amino acid code B for Aspartic Acid and Asparagine, is used. - IUPAC amino acid code Z for Glutamic Acid, Glutamine is used. - if the codon is two nucleotides long and if by adding an a third character 'N', it codes for a single amino acid (with exceptions above), return that, otherwise return empty string. Returns empty string for other input strings that are not three characters long. Example : Returns : a string of one letter ambiguous IUPAC amino acid codes Args : ambiguous IUPAC nucleotide string translate_strict Title : translate_strict Usage : $obj->translate_strict('ACT') Function: returns one letter amino acid code for a codon input Fast and simple translation. User is responsible to resolve ambiguous nucleotide codes before calling this method. Returns 'X' for unknown codons and an empty string for input strings that are not three characters long. It is not recommended to use this method in a production environment. Use method translate, instead. Example : Returns : A string Args : a codon = a three nucleotide character string revtranslate Title : revtranslate Usage : $obj->revtranslate('G') Function: returns codons for an amino acid Returns an empty string for unknown amino acid codes. Ambiguous IUPAC codes Asx,B, (Asp,D; Asn,N) and Glx,Z (Glu,E; Gln,Q) are resolved. Both single and three letter amino acid codes are accepted. '*' and 'Ter' are used for terminator. By default, the output codons are shown in DNA. If the output is needed in RNA (tr/t/u/), add a second argument 'RNA'. Example : $obj->revtranslate('Gly', 'RNA') Returns : An array of three lower case letter strings i.e. codons Args : amino acid, 'RNA' reverse_translate_all Title : reverse_translate_all Usage : my $iup_str = $cttable->reverse_translate_all($seq_object) my $iup_str = $cttable->reverse_translate_all($seq_object, $cutable, 15); Function: reverse translates a protein sequence into IUPAC nucleotide sequence. An 'X' in the protein sequence is converted to 'NNN' in the nucleotide sequence. Returns : a string Args : a Bio::PrimarySeqI compatible object (mandatory) a Bio::CodonUsage::Table object and a threshold if only codons with a relative frequency above the threshold are to be considered. reverse_translate_best Title : reverse_translate_best Usage : my $str = $cttable->reverse_translate_best($seq_object,$cutable); Function: Reverse translates a protein sequence into plain nucleotide sequence (GATC), uses the most common codon for each amino acid Returns : A string Args : A Bio::PrimarySeqI compatible object and a Bio::CodonUsage::Table object is_start_codon Title : is_start_codon Usage : $obj->is_start_codon('ATG') Function: returns true(1) for all codons that can be used as a translation start, false(0) for others. Example : $myCodonTable->is_start_codon('ATG') Returns : boolean Args : codon is_ter_codon Title : is_ter_codon Usage : $obj->is_ter_codon('GAA') Function: returns true(1) for all codons that can be used as a translation tarminator, false(0) for others. Example : $myCodonTable->is_ter_codon('ATG') Returns : boolean Args : codon is_unknown_codon Title : is_unknown_codon Usage : $obj->is_unknown_codon('GAJ') Function: returns false(0) for all codons that are valid, true(1) for others. Example : $myCodonTable->is_unknown_codon('NTG') Returns : boolean Args : codon unambiguous_codons Title : unambiguous_codons Usage : @codons = $self->unambiguous_codons('ACN') Returns : array of strings (one-letter unambiguous amino acid codes) Args : a codon = a three IUPAC nucleotide character string _unambiquous_codons deprecated, now an alias for unambiguous_codons add_table Title : add_table Usage : $newid = $ct->add_table($name, $table, $starts) Function: Add a custom Codon Table into the object. Know what you are doing, only the length of the argument strings is checked! Returns : the id of the new codon table Args : name, a string, optional (can be empty) table, a string of 64 characters startcodons, a string of 64 characters, defaults to standard perl v5.14.2 2012-03-02 Bio::Tools::CodonTable(3pm)
All times are GMT -4. The time now is 08:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy