Replacing stop codons without confirmation

651 views
Skip to first unread message

Brice Sarver

unread,
Aug 15, 2014, 6:17:59 PM8/15/14
to pamlso...@googlegroups.com
Hi Ziheng et al.,

I've written a script to prepare sets of genes for selection analyses in codeml. I will be performing estimation on thousands of genes, and I plan on farming out the work to a distributed cluster. However, the stop codon replacement has been causing some jobs to hang waiting on user input (and ultimately terminate).

Very few sequences have an internal stop codon, and I plan to write a script to screen out any; often, it's just a single individual with a point mutation/sequencing error. Is there a way to run codeml where it continues to run without user input (pressing 'enter') or, alternatively, revert back to the older terminate-with-error that it used to do previously?

Bego Dobon

unread,
Oct 16, 2014, 8:58:40 AM10/16/14
to pamlso...@googlegroups.com
Hi Brice, 
I had the same problem. For, now my solution is to use the command 'yes'.  It prints 'y' (or any string given) followed by a newline to stdout: 
> yes \n | script.sh 

It does the trick, but I would prefer if the program had the option to go back to the terminate-with-error or not to ask for user input.








Ziheng

unread,
Oct 16, 2014, 4:08:41 PM10/16/14
to pamlso...@googlegroups.com
I'll try to remember to terminate at stop codon.
as another option, you can search in the source code codeml.c or treesub.c for the string and edit the source code to exit.
Ziheng

Axel Wiberg

unread,
Jan 14, 2015, 11:03:59 AM1/14/15
to pamlso...@googlegroups.com
Hi all,

I too ran into this problem. My solution (after much digging around) was also to write a short shell script using expect. I've attached it here.
I call the script "expect_codeml.bsh" for each gene/control file in a for loop.

> expect_codeml.bsh codeml_control_file.ctl

I then look for the "???" substitutions when parsing the result files to determine whether stop codons were found so I can filter them out during further analysis.

Another thing I would be interested in is a completely silent mode of paml (i.e. one that doesn't print anything to the screen) the reason is that there are useful shell tools for farming out single operations to several threads and running them in parallel (e.g. GNU parallel) it seems to me that codeml would be well suited for use with this but I think the screen output causes some problems.



expect_codeml.bsh

Ziheng

unread,
Mar 2, 2015, 1:15:11 PM3/2/15
to pamlso...@googlegroups.com
Another thing I would be interested in is a completely silent mode of paml (i.e. one that doesn't print anything to the screen) the reason is that there are useful shell tools for farming out single operations to several threads and running them in parallel (e.g. GNU parallel) it seems to me that codeml would be well suited for use with this but I think the screen output causes some problems.


I would imagine redirection should work for this?

./codeml ../codeml.ctl > log.txt

On our college computer cluster, the screen output is collected into one file, in addition to the output files created by the program. 

ziheng



ymw...@gmail.com

unread,
Apr 29, 2015, 11:06:27 PM4/29/15
to pamlso...@googlegroups.com
Dear Axel,

I also encounter the same problem of a stop codon inside several genes.  I try to use your expect script to bypass the "Press Enter" problem.  I use codeml to test for many genes in the same files.
What I type in the command line is as below.
> expect expect_codeml.bsh codeml_control_file.ctl

It works for the first gene with a middle stop codon, but it does not work when the codeml runs into the 2nd gene with a middle stop codon and others afterward.
Is there a particular way to use this script for multiple genes with stop codeml?

Thanks

Ziheng

unread,
May 9, 2015, 12:23:41 PM5/9/15
to pamlso...@googlegroups.com
Will it work if you have lots of empty lines in the file?
Ziheng

Jilguero ostras

unread,
Jul 15, 2018, 1:59:13 PM7/15/18
to PAML discussion group
Hi,
I have the same problem. The program stops when it finds a stop codon. Could it be possible adding an option to codeml in order to avoid user confirmation?. For example that the program replaces the stop codon automatically. Thank you.
Best regards,
Jilguero.

Ziheng

unread,
Aug 1, 2018, 11:21:52 AM8/1/18
to PAML discussion group
if you open treesub.c and find and delete the following block, codeml will not bother you with this.  ziheng


   if (NColumnEdited) {
      printf("\n%2d columns are converted into ??? because of stop codons\nPress Enter to continue", NColumnEdited);
      getchar();
   }

Reply all
Reply to author
Forward
0 new messages