Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
automate seqalignment.bf (Read 4080 times)
cftian
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 5
automate seqalignment.bf
May 17th, 2011 at 6:53pm
 
  I am working on a batch file based on SeqAlignment.bf. It could run normally without showing any error messages, however I could only get the realignment files (translated sequences and .nuc) for the first .fasta file in my data set.  Sad But the "log" window showed that all the .fasta files have been analysed. Could you help me with this script? Huh

  regards!

Changfu

Code:
prefix = "C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster";
samples = 15;

inputRedirect = {};
/* an associative array, with string entries, used to replace the standard input */

for (bitt=1; bitt<samples; bitt=bitt+1)
{
inputRedirect["01"]="BLOSUM62"; /* Scoring Matrix */

inputRedirect["02"]="No penalty"; /* Do not penalize Prefix-Suffix Indels */

inputRedirect["03"]="Longest in file"; /* Use the longest sequence in the data file as the reference */

inputRedirect["04"]="No"; /* No reference coordinate sequence */

inputRedirect["05"]=prefix+" ("+bitt+").fasta"; /* data file path */

inputRedirect["06"]="No"; /* Skip sequences with unusurally poor allignment scores */

inputRedirect["07"]="No"; /* Only align in the provided direction - no reverse complement */

inputRedirect["08"]="Universal"; /* Choose genetic code - Genbank transl_table = 1 */

inputRedirect["09"]=prefix+bitt+"realignment";  /* save alignment files to */

ExecuteAFile (HYPHY_BASE_DIRECTORY + "TemplateBatchFiles"+
DIRECTORY_SEPARATOR+"SeqAlignment.bf", inputRedirect);

} 

Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: automate seqalignment.bf
Reply #1 - May 18th, 2011 at 11:09am
 
Hi Changfu,

This is odd -- could you print the inputRedirect variable before and after the call to ExecuteAFile and paste the output of your script to the console?

Just add

Code:
fprintf (stdout, inputRedirect, "\n");

 



before and after ExecuteAFile.

Sergei
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
cftian
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 5
Re: automate seqalignment.bf
Reply #2 - May 18th, 2011 at 5:50pm
 
Dear Sergei,

      Thank you for your reply!
      Here is the script: Code:
prefix = "C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster";
samples = 15;

inputRedirect = {};
/* an associative array, with string entries, used to replace the standard input */

for (bitt=1; bitt<samples; bitt=bitt+1)
{
inputRedirect["01"]="BLOSUM62"; /* Scoring Matrix */

inputRedirect["02"]="No penalty"; /* Do not penalize Prefix-Suffix Indels */

inputRedirect["03"]="Longest in file"; /* Use the longest sequence in the data file as the reference */

inputRedirect["04"]="No"; /* No reference coordinate sequence */

inputRedirect["05"]=prefix+" ("+bitt+").fasta"; /* data file path */

inputRedirect["06"]="No"; /* Skip sequences with unusurally poor allignment scores */

inputRedirect["07"]="No"; /* Only align in the provided direction - no reverse complement */

inputRedirect["08"]="Universal"; /* Choose genetic code - Genbank transl_table = 1 */

inputRedirect["09"]=prefix+bitt+".realignment";  /* save alignment files to */

fprintf (stdout, inputRedirect, "\n");

ExecuteAFile (HYPHY_BASE_DIRECTORY + "TemplateBatchFiles"+
DIRECTORY_SEPARATOR+"SeqAlignment.bf", inputRedirect);

fprintf (stdout, inputRedirect, "\n");

} 



and the output:

Code:
{"01":"BLOSUM62",
"02":"No penalty",
"03":"Longest in file",
"04":"No",
"05":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster (1).fasta",
"06":"No",
"07":"No",
"08":"Universal",
"09":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster1.realignment"}

Selected sequence GL002701 as reference.
Detecting reading frames for each sequence...

Found:
	26 sequences in reading frame 1
	0 sequences in reading frame 2
	0 sequences in reading frame 3

There were 0 sequences with apparent frameshift/sequencing errors

Performing pairwise alignment with reference sequences

Merging pairwise alignments into a MSA
{"01":"BLOSUM62",
"02":"No penalty",
"03":"Longest in file",
"04":"No",
"05":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster (1).fasta",
"06":"No",
"07":"No",
"08":"Universal",
"09":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster1.realignment"}
{"01":"BLOSUM62",
"02":"No penalty",
"03":"Longest in file",
"04":"No",
"05":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster (2).fasta",
"06":"No",
"07":"No",
"08":"Universal",
"09":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster2.realignment"}

Selected sequence GL000030 as reference.
Detecting reading frames for each sequence...

Found:
	26 sequences in reading frame 1
	0 sequences in reading frame 2
	0 sequences in reading frame 3

There were 0 sequences with apparent frameshift/sequencing errors

Performing pairwise alignment with reference sequences

Merging pairwise alignments into a MSA
{"01":"BLOSUM62",
"02":"No penalty",
"03":"Longest in file",
"04":"No",
"05":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster (2).fasta",
"06":"No",
"07":"No",
"08":"Universal",
"09":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster2.realignment"}
{"01":"BLOSUM62",
"02":"No penalty",
"03":"Longest in file",
"04":"No",
"05":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster (3).fasta",
"06":"No",
"07":"No",
"08":"Universal",
"09":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster3.realignment"}

Selected sequence GL006574 as reference.
Detecting reading frames for each sequence...

Found:
	26 sequences in reading frame 1
	0 sequences in reading frame 2
	0 sequences in reading frame 3

There were 0 sequences with apparent frameshift/sequencing errors

Performing pairwise alignment with reference sequences

Merging pairwise alignments into a MSA
{"01":"BLOSUM62",
"02":"No penalty",
"03":"Longest in file",
"04":"No",
"05":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster (3).fasta",
"06":"No",
"07":"No",
"08":"Universal",
"09":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster3.realignment"}
{"01":"BLOSUM62",
"02":"No penalty",
"03":"Longest in file",
"04":"No",
"05":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster (4).fasta",
"06":"No",
"07":"No",
"08":"Universal",
"09":"C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/cluster4.realignment"}

Selected sequence GL006105 as reference.
Detecting reading frames for each sequence...

Found:
	26 sequences in reading frame 1
	0 sequences in reading frame 2
	0 sequences in reading frame 3

There were 0 sequences with apparent frameshift/sequencing errors

Performing pairwise alignment with reference sequences

Merging pairwise alignments into a MSA
... ...
... ...

 



Finally I just got two files ("cluster1.realignment" and "cluster1.realignment.nuc") in "C:/HYPHY2.0/tmp/HYPHY2.0/data/KaKs/".

It is really odd. Several other batch files have been run successfully in the same circumstances.

We are working on more than 4000 alignments, and exploring analyses did show that "SeqAlignment.bf" could reduce the false positive information cuased by "uncorrected coarse" alignments. Therefore, to automate "SeqAlignment.bf" is very important to our project.

If you already have a similar executive file by chance, could you post it here? Then I could have a try on my PC.

Thank you!

Changfu  
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: automate seqalignment.bf
Reply #3 - May 20th, 2011 at 11:06am
 
Hi Changfu,

This is very odd indeed. Can you replace the second frptintf statement with

Code:
fprintf (stdout, fNameC, "\n");
 



and paste the console output? Also, try changing forward slashes '/' with backslashes '\' in prefix and other paths, e.g.

Code:
prefix="C:\\HYPHY2.0\\tmp\\HYPHY2.0\\data\\KaKs\\cluster";
 



Sergei
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
cftian
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 5
Re: automate seqalignment.bf
Reply #4 - May 21st, 2011 at 5:45am
 
Hi, Sergei,

    I am sorry for taking you so much time. Here is the new script
    Code:
prefix = "C:\HYPHY2.0\tmp\HYPHY2.0\data\KaKs\cluster";
samples = 15;

inputRedirect = {};
/* an associative array, with string entries, used to replace the standard input */

for (bitt=1; bitt<samples; bitt=bitt+1)
{
inputRedirect["01"]="BLOSUM62"; /* Scoring Matrix */

inputRedirect["02"]="No penalty"; /* Do not penalize Prefix-Suffix Indels */

inputRedirect["03"]="Longest in file"; /* Use the longest sequence in the data file as the reference */

inputRedirect["04"]="No"; /* No reference coordinate sequence */

inputRedirect["05"]=prefix+" ("+bitt+").fasta"; /* data file path */

inputRedirect["06"]="No"; /* Skip sequences with unusurally poor allignment scores */

inputRedirect["07"]="No"; /* Only align in the provided direction - no reverse complement */

inputRedirect["08"]="Universal"; /* Choose genetic code - Genbank transl_table = 1 */

inputRedirect["09"]=prefix+bitt+".realignment";  /* save alignment files to */

fprintf (stdout, inputRedirect, "\n");

ExecuteAFile (HYPHY_BASE_DIRECTORY + "TemplateBatchFiles"+
DIRECTORY_SEPARATOR+"SeqAlignment.bf", inputRedirect);

fprintf (stdout, fNameC, "\n");

}
 




and the output

Code:
{"01":"BLOSUM62",
"02":"No penalty",
"03":"Longest in file",
"04":"No",
"05":"C:\\HYPHY2.0\tmp\\HYPHY2.0\\data\\KaKs\\cluster (1).fasta",
"06":"No",
"07":"No",
"08":"Universal",
"09":"C:\\HYPHY2.0\tmp\\HYPHY2.0\\data\\KaKs\\cluster1.realignment"}

Selected sequence GL002701 as reference.
Detecting reading frames for each sequence...

Found:
	26 sequences in reading frame 1
	0 sequences in reading frame 2
	0 sequences in reading frame 3

There were 0 sequences with apparent frameshift/sequencing errors

Performing pairwise alignment with reference sequences

Merging pairwise alignments into a MSA
C:\HYPHY2.0\tmp\HYPHY2.0\data\KaKs\cluster1.realignment.nuc
{"01":"BLOSUM62",
"02":"No penalty",
"03":"Longest in file",
"04":"No",
"05":"C:\\HYPHY2.0\tmp\\HYPHY2.0\\data\\KaKs\\cluster (2).fasta",
"06":"No",
"07":"No",
"08":"Universal",
"09":"C:\\HYPHY2.0\tmp\\HYPHY2.0\\data\\KaKs\\cluster2.realignment"}

Selected sequence GL000030 as reference.
Detecting reading frames for each sequence...

Found:
	26 sequences in reading frame 1
	0 sequences in reading frame 2
	0 sequences in reading frame 3

There were 0 sequences with apparent frameshift/sequencing errors

Performing pairwise alignment with reference sequences

Merging pairwise alignments into a MSA
C:\HYPHY2.0\tmp\HYPHY2.0\TemplateBatchFiles\Universal.nuc
{"01":"BLOSUM62",
"02":"No penalty",
"03":"Longest in file",
"04":"No",
"05":"C:\\HYPHY2.0\tmp\\HYPHY2.0\\data\\KaKs\\cluster (3).fasta",
"06":"No",
"07":"No",
"08":"Universal",
"09":"C:\\HYPHY2.0\tmp\\HYPHY2.0\\data\\KaKs\\cluster3.realignment"}

Selected sequence GL006574 as reference.
Detecting reading frames for each sequence...

Found:
	26 sequences in reading frame 1
	0 sequences in reading frame 2
	0 sequences in reading frame 3

There were 0 sequences with apparent frameshift/sequencing errors

Performing pairwise alignment with reference sequences

Merging pairwise alignments into a MSA
C:\HYPHY2.0\tmp\HYPHY2.0\TemplateBatchFiles\Universal.nuc
... ... ... ...
 



I have checked the "C:\HYPHY2.0\tmp\HYPHY2.0\TemplateBatchFiles\Universal.nuc" and "Universal"(translated sequence in the same folder). They are exactly the realignment files produced from the last ".fasta" file in my list (14th in the above mentioned script). The path was changed after 1st round, and the file names became "Universal" for all the following output files. I have no idea how could this happen.

Looking forward to your message.

Regards.

Changfu
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: automate seqalignment.bf
Reply #5 - May 23rd, 2011 at 10:54am
 
Hi Changfu,

Looks like a HyPhy bug -- let me see if I can fix it for you today. Thanks for alerting me.

Sergei
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
cftian
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 5
Re: automate seqalignment.bf
Reply #6 - May 24th, 2011 at 6:23pm
 
Hi, Sergei,

Thank you! Looking forward to your good news!

Regards.

Changfu
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: automate seqalignment.bf
Reply #7 - May 27th, 2011 at 10:18am
 
Hi Changfu,

Please replace the SeqAlignment.bf file inside HyPhy2.0/TemplateBatchFiles with the one I attach and the bug should go away.

Sergei
Back to top
 
Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login (1 KB | )

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
cftian
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 5
Re: automate seqalignment.bf
Reply #8 - May 28th, 2011 at 6:41am
 
Hi, Sergei,

    Thank you very much. The new Seqalignment.bf works well!
      Cheesy Cheesy Grin Grin
    Best regards!

Changfu

Back to top
 
 
IP Logged