Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to pass a single quote to the program? Post 303036115 by Aurimas on Friday 14th of June 2019 09:08:29 AM
Old 06-14-2019
My input was:

Code:
#!/bin/bash
read -p "amino acid: " AAA
if [[ "ALA ARG ASN ASP CYS GLN GLY GLU HIS ILE \
	   LEU LYS MET PHE PRO SER THR TRP TYR VAL" =~ $AAA ]]
then
	for i in HS_*.pdb; 
		do
    		cat $i | voronota get-balls-from-atoms-file --annotated \
    			   | voronota calculate-contacts --annotated \
    			   | voronota query-contacts --inter-residue --match-first "'R<$AAA>'" --match-second "'A<C1',C2',C3',C4',C5',O1,O2,O3,O4,O5,O1',O2',O3',O4',O5',N1,N2,N3,C1,C2,C3,C4,C5>'" \
    			   | awk '{sum += $3} END {print sum}'
		done
else
	exit 1
fi

Then I wrote ./voronota_improved_interface_atoms.sh
When asked for amino acid: I entered ALA and the answer given was 28 blank values:
Code:

So apperently single quote is not passed as an argument unless I am doing something wrong :/
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing a single quote

Hi there I have a data file like so below 'A/1';'T100002';'T100002';'';'01/05/2004';'31/05/2004';'01/06/2004';'08/06/2004';'1.36';'16';'0.22';'0';'0';'1.58';'0';'0';'0';'0';'0';'0';'clientes\resumen\200405\resumen_T100002_T100002_1.pdf';'';'0001';'S';'20040501';'';'02';'0';'S';'N'... (3 Replies)
Discussion started by: rjsha1
3 Replies

2. Shell Programming and Scripting

single quote

Hi I have a shell script with many lines as below: comment on column dcases.proj_seq_num is dcases_1sq; .... .... I want the above script to be as below: comment on column dcases.proj_seq_num is 'dcases_1sq'; I want to have single quotes like that as above for the entire shell... (2 Replies)
Discussion started by: dreams5617
2 Replies

3. Shell Programming and Scripting

escaping single quote

hi, echo 'abc' will give output abc how can i get output as 'abc' plz help. thanks in advance (3 Replies)
Discussion started by: javeed7
3 Replies

4. Shell Programming and Scripting

Regex in grep to match all lines ending with a double quote (") OR a single quote (')

Hi, I've been trying to write a regex to use in egrep (in a shell script) that'll fetch the names of all the files that match a particular pattern. I expect to match the following line in a file: Name = "abc" The regex I'm using to match the same is: egrep -l '(^) *= *" ** *"$' /PATH_TO_SEARCH... (6 Replies)
Discussion started by: NanJ
6 Replies

5. Shell Programming and Scripting

Replace single quote with two single quotes in perl

Hi I want to replace single quote with two single quotes in a perl string. If the string is <It's Simpson's book> It should become <It''s Simpson''s book> (3 Replies)
Discussion started by: DushyantG
3 Replies

6. Shell Programming and Scripting

single quote replacement

hi all, i have a data in the file which of the formate : 100,102,103 and the required formate is \'100\',\'102\',\'103 Idealy we need to replace , with \',\' Regards arkesh (2 Replies)
Discussion started by: arkeshtk
2 Replies

7. Shell Programming and Scripting

How to insert a single quote to each record

I have a file as: 1 New used 1 used New I need o/p as: '1' 'New' 'used' '1' 'used' 'New' (12 Replies)
Discussion started by: karumudi7
12 Replies

8. Shell Programming and Scripting

Replacing all but the first and last double quote in a line with a single quote with awk

From: 1,2,3,4,5,This is a test 6,7,8,9,0,"This, is a test" 1,9,2,8,3,"This is a ""test""" 4,7,3,1,8,"""" To: 1,2,3,4,5,This is a test 6,7,8,9,0,"This; is a test" 1,9,2,8,3,"This is a ''test''" 4,7,3,1,8,"''"Is there an easy syntax I'm overlooking? There will always be an odd number... (5 Replies)
Discussion started by: Michael Stora
5 Replies

9. Shell Programming and Scripting

Awk: single quote match in If

Hello, I'd like to print line if column 5th doesn't match with exm. But to reach there I have to make sure I match single quote. I'm struggling to match that. I've input file like: Warning: Variants 'exm480340' and '5:137534453:G:C' have the same position. Warning: Variants 'exm480345'... (9 Replies)
Discussion started by: genome
9 Replies

10. Shell Programming and Scripting

Single quote _error_.

Hi all... (This is Don's domain.) I have come across an anomaly in sh and dash compared to bash. It involves echoing a character set to a file in sh and dash compared to bash. It is probably easier to show the code and results first. #!/usr/local/bin/dash #!/bin/sh #!/bin/bash echo... (4 Replies)
Discussion started by: wisecracker
4 Replies
Bio::CodonUsage::Table(3pm)				User Contributed Perl Documentation			       Bio::CodonUsage::Table(3pm)

NAME
Bio::CodonUsage::Table - for access to the Codon usage Database at http://www.kazusa.or.jp/codon. SYNOPSIS
use Bio::CodonUsage::Table; use Bio::DB::CUTG; use Bio::CodonUsage::IO; use Bio::Tools::SeqStats; # Get a codon usage table from web database my $cdtable = Bio::DB::CUTG->new(-sp => 'Mus musculus', -gc => 1); # Or from local file my $io = Bio::CodonUsage::IO->new(-file => "file"); my $cdtable = $io->next_data(); # Or create your own from a Bio::PrimarySeq compliant object, # $codonstats is a ref to a hash of codon name /count key-value pairs my $codonstats = Bio::Tools::SeqStats->count_codons($Seq_objct); # '-data' must be specified, '-species' and 'genetic_code' are optional my $CUT = Bio::CodonUsage::Table->new(-data => $codonstats, -species => 'Hsapiens_kinase'); print "leu frequency is ", $cdtable->aa_frequency('LEU'), " "; print "freq of ATG is ", $cdtable->codon_rel_frequency('ttc'), " "; print "abs freq of ATG is ", $cdtable->codon_abs_frequency('ATG'), " "; print "number of ATG codons is ", $cdtable->codon_count('ATG'), " "; print "GC content at position 1 is ", $cdtable->get_coding_gc('1'), " "; print "total CDSs for Mus musculus is ", $cdtable->cds_count(), " "; DESCRIPTION
This class provides methods for accessing codon usage table data. All of the methods at present are simple look-ups of the table or are derived from simple calculations from the table. Future methods could include measuring the codon usage of a sequence , for example, or provide methods for examining codon usage in alignments. SEE ALSO
Bio::Tools::CodonTable, Bio::WebAgent, Bio::CodonUsage::IO, Bio::DB::CUTG 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/ AUTHORS
Richard Adams, Richard.Adams@ed.ac.uk APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new Usage : my $cut = Bio::CodonUsage::Table->new(-data => $cut_hash_ref, -species => 'H.sapiens_kinase' -genetic_code =>1); Returns : a reference to a new Bio::CodonUsage::Table object Args : none or a reference to a hash of codon counts. This constructor is designed to be compatible with the output of Bio::Tools::SeqUtils::count_codons() Species and genetic code parameters can be entered here or via the species() and genetic_code() methods separately. all_aa_frequencies Title : all_aa_frequencies Usage : my $freq = $cdtable->all_aa_frequencies(); Returns : a reference to a hash where each key is an amino acid and each value is its frequency in all proteins in that species. Args : none codon_abs_frequency Title : codon_abs_frequency Usage : my $freq = $cdtable->codon_abs_frequency('CTG'); Purpose : To return the frequency of that codon as a percentage of all codons in the organism. Returns : a percentage frequency Args : a non-ambiguous codon string codon_rel_frequency Title : codon_rel_frequency Usage : my $freq = $cdtable->codon_rel_frequency('CTG'); Purpose : To return the frequency of that codon as a percentage of codons coding for the same amino acid. E.g., ATG and TGG would return 100 as those codons are unique. Returns : a percentage frequency Args : a non-ambiguous codon string probable_codons Title : probable_codons Usage : my $prob_codons = $cd_table->probable_codons(10); Purpose : to obtain a list of codons for the amino acid above a given threshold % relative frequency Returns : A reference to a hash where keys are 1 letter amino acid codes and values are references to arrays of codons whose frequency is above the threshold. Arguments: a minimum threshold frequency most_common_codons Title : most_common_codons Usage : my $common_codons = $cd_table->most_common_codons(); Purpose : To obtain the most common codon for a given amino acid Returns : A reference to a hash where keys are 1 letter amino acid codes and the values are the single most common codons for those amino acids Arguments: None codon_count Title : codon_count Usage : my $count = $cdtable->codon_count('CTG'); Purpose : To obtain the absolute number of the codons in the organism. Returns : an integer Args : a non-ambiguous codon string get_coding_gc Title : get_coding_gc Usage : my $count = $cdtable->get_coding_gc(1); Purpose : To return the percentage GC composition for the organism at codon positions 1,2 or 3, or an average for all coding sequence ('all'). Returns : a number (%-age GC content) or 0 if these fields are undefined Args : 1,2,3 or 'all'. set_coding_gc Title : set_coding_gc Usage : my $count = $cdtable->set_coding_gc(-1=>55.78); Purpose : To set the percentage GC composition for the organism at codon positions 1,2 or 3, or an average for all coding sequence ('all'). Returns : void Args : a hash where the key must be 1,2,3 or 'all' and the value the %age GC at that codon position.. species Title : species Usage : my $sp = $cut->species(); Purpose : Get/setter for species name of codon table Returns : Void or species name string Args : None or species name string genetic_code Title : genetic_code Usage : my $sp = $cut->genetic_code(); Purpose : Get/setter for genetic_code name of codon table Returns : Void or genetic_code id, 1 by default Args : None or genetic_code id, 1 by default if invalid argument. cds_count Title : cds_count Usage : my $count = $cdtable->cds_count(); Purpose : To retrieve the total number of CDSs used to generate the Codon Table for that organism. Returns : an integer Args : none (if retrieving the value) or an integer( if setting ). aa_frequency Title : aa_frequency Usage : my $freq = $cdtable->aa_frequency('Leu'); Purpose : To retrieve the frequency of an amino acid in the organism Returns : a percentage Args : a 1 letter or 3 letter string representing the amino acid common_codon Title : common_codon Usage : my $freq = $cdtable->common_codon('Leu'); Purpose : To retrieve the frequency of the most common codon of that aa Returns : a percentage Args : a 1 letter or 3 letter string representing the amino acid rare_codon Title : rare_codon Usage : my $freq = $cdtable->rare_codon('Leu'); Purpose : To retrieve the frequency of the least common codon of that aa Returns : a percentage Args : a 1 letter or 3 letter string representing the amino acid perl v5.14.2 2012-03-02 Bio::CodonUsage::Table(3pm)
All times are GMT -4. The time now is 10:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy