/usr/share/hyphy/TemplateBatchFiles/SplitSequencesByPattern.bf is in hyphy-common 2.2.6+dfsg-3build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | ExecuteAFile (HYPHY_LIB_DIRECTORY + "TemplateBatchFiles" + DIRECTORY_SEPARATOR + "Utility" + DIRECTORY_SEPARATOR + "ReadDelimitedFiles.bf");
SetDialogPrompt ("Please choose a data file:");
DataSet ds = ReadDataFile (PROMPT_FOR_FILE);
fprintf (stdout, "\n\nData Read:\n", ds);
fprintf (stdout, "\nA regular expression to split with");
fscanf (stdin,"String",regExp);
DataSetFilter allData = CreateFilter (ds,1);
GetString (taxonNames,allData,-1);
splitIDs = {};
usedNames = {};
for (k=0; k<allData.species; k=k+1)
{
newName = normalizeSequenceID (taxonNames[k], "usedNames");
if (newName != taxonNames[k])
{
SetParameter (ds,k,newName);
}
}
GetString (taxonNames,allData,-1);
for (k=0; k<allData.species; k=k+1)
{
match = taxonNames[k]$regExp;
if (match[0]>=0)
{
matchTo = (taxonNames[k])[match[0]][match[1]];
if (Abs(splitIDs[matchTo]) == 0)
{
splitIDs[matchTo] = {};
}
(splitIDs[matchTo])[k+1] = 1;
}
}
basePath = LAST_FILE_PATH;
keys = Rows(splitIDs);
for (k=0; k<Columns(keys); k=k+1)
{
fileOut = basePath + "." + keys[k];
DataSetFilter splitDF = CreateFilter (ds,1,"",(splitIDs[keys[k]])[speciesIndex+1]);
fprintf (fileOut,CLEAR_FILE,splitDF);
fprintf (stdout, keys[k], " matched ", splitDF.species, " sequences\n");
}
|