Hi, this may seem a little off the topic but does the batch language allow for commands like strcat, strcat, printf etc. For instance I want to parition data according to a consensus amino acid sequence. So I have the consensus amino acid sequence in a {site x amino acid} matrix as follows:
{ { 0, 1, 2, 3, 4}, { 14, 2, 5, 14, 5} }
which i can sort by column 1 to:
{ { 1, 2, 4, 0, 3 }, { 2, 5, 5, 14, 14 } }
so using a for and while loop i can identify which sites all have the same consensus amino acid. ie. site 1, sites 2 & 4, sites 0 & 3.
Now I want to create filters for each consensus amino acid (each of which will get a separate model). So some way of doing:
DataSetFilter myFilter1 = CreateFilter ( myData, 1, "1" ); /* AA 2 */
DataSetFilter myFilter2 = CreateFilter ( myData, 1, "2,4" ); /* AA 5 */
DataSetFilter myFilter3 = CreateFilter ( myData, 1, "0,3" ); /* AA 14 */
So I thought a for loop that will concatenate values in a matrix as a string, where the matrix is only retained for each AA. ie for AA 5
matrix = { 2, 4 }
stringVar = "";
for ( i = 0; i < k; i = i + 1 ) { /* k is the number of sites with AA 5 */
strcat ( stringVar, matrix [ i ] );
if ( i != k-1 ) {
strcat ( stringVar, ", " );
}
}
and then theoretically i can call this string with the CreateFilter?
DataSetFilter myFilter2 = CreateFilter ( myData, 1, stringVar ); /* AA 5 */
and finally the other problem would be how to index the myFilter in a forward loop...myFilter1, myFilter2, .... for 20 amino acids. i am pretty new to both HyPhy and the batch language so please let me know if i'm completely off the wall with this ?. thanks ./w