This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Run Unafold Melting.Pl From Matlab

Hello,

i'm have been trying to get matlab run the UNAFold melt.pl pearl script and to retrieve the results.

But i'm stuck right now.

One approach was to generate a batch-file with the syntax, but this did not worked out:

UNAFoldDir = 'C:\UNAFold\bin\';

Seq1Name = 'Seq1'; Seq1Sequence = 'CTGCTTTCCTGAGAGCAGTACCTCATTAGTTTCCCTGAATTTGGGGGGGGGGG'; Seq1 = struct('Header', Seq1Name, 'Sequence', Seq1Sequence); fastawrite(strcat(UNAFoldDir, 'Seq1.fas'), Seq1);

% Write StartUNA File fid = fopen(strcat(UNAFoldDir, 'StartUNA.bat'),'w'); fwrite(fid, ['perl ..\bin\melt.pl -n DNA -C 0.1 Seq1.fas Seq1.fas > Seq1-Seq2-Results.txt']); fclose(fid);

Then i tryed it with the Matlab in-build pearl commando:

perl('C:\UNAFold\bin\melt.pl','-n DNA -C 0.1 Seq1.fas Seq1.fas')

But all i get are error messages like this one: ??? Error using ==> perl at 82 System error: Error: file not specified Run 'melt.pl -h' for help Command executed: perl C:\UNAFold\bin\melt.pl "-n DNA -C 0.1 C:\UNAFold\bin\Seq1.fas C:\UNAFold\bin\Seq1.fas"

Running perl('C:\UNAFold\bin\melt.pl','-h') works fine, so there should be no problem with the directory-path from unafold.

I have never worked with UNAFold/Pearl-scripts before.

I would be grateful for every suggestion! :-)

Best regards, Mike

matlab dna

Does the file "C:UNAFoldbinSeq1.fas" exist? If so, are you sure melt.pl does not require any other files to be specified on the command line?

1 answer

Hello Lars,

i found an solution, there was only a mistake in the syntax (on both sides, perl- & matlab-code):

perl('C:UNAFoldbinmelt.pl', '-n', 'DNA', '-C', '0.01', 'Seq1.fas', 'Seq1.fas)

works now, and it does not need a batch file to work so no "painful" data in via matlab and some files generated by unafold. ;-)

br, mike

Log in to answer this question.