FIFTH UPDATE
This notebook contains:
1. a cell of Functions suitable for inclusion in a notebook or package.
2. a cell containing a “help” example that generates a bit of documentation.
3. a cell containing example usage in a notebook.
Immediately below is the results of a test with chromosome DNA and markers.
A longer battery of tests is underway.
A follow-on version is planned utilizing hybrid parallelism for varying problem sizes.
This notebook contains:
1. a cell of Functions suitable for inclusion in a notebook or package.
2. a cell containing a “help” example that generates a bit of documentation.
3. a cell containing example usage in a notebook.
Immediately below is the results of a test with chromosome DNA and markers.
A longer battery of tests is underway.
A follow-on version is planned utilizing hybrid parallelism for varying problem sizes.
Parameters: | |||||||
| |||||||
|
FUNCTIONS
In[]:=
EXAMPLE HELP USAGE
In[]:=
VWDC[{},{},"",helpTrue];
Variable Width Discrete Correlation, version 9/13/2024.
This function seeks exact and nearly exact matches of String subsequences in larger String sequences.
The subsequences are termed "queries" and the larger sequences are termed "targets".
The amount of acceptable error is controlled by option "eAccept".
Minimal execution:
VWDC[targets, queries, workingDirectory]
• targets must be a list of one or more String or existing File entities containing a String.
for example, they could be a chromosome sequence or subsequence.
• queries must be a list of one or more String entities to search for in the targets.
for example, they could be molecular markers, gene subsequences, etc.
• workingDirectory must be an existing (possibly empty) Directory path.
for example, FileNameJoin[{NotebookDirectory[],"vwdc tmp"}].
simultaneous execution of VWDC with the same workingDirectory is not recommended.
The minimal execution will write file "VWDC result.mx" to the workingDirectory.
Default options and alternatives:
VWDC[targets, queries, workingDirectory, targetLabels"Automatic", queryLabels"Automatic", eAccept"Automatic", resultFile"Automatic", parallelProcesses0, chattyFalse, helpFalse]
• targetLabels must either be "Automatic" or a List of String(s).
the number of labels must match the number of targets.
• queryLabels must either be "Automatic" or a List of String(s).
the number of labels must match the number of queries.
• eAccept must either be "Automatic" or an Integer ≥ 0.
it specifies the number of acceptable letter errors in a search.
"Automatic" will select a value appropriate for molecular markers.
an integer value will apply to all query searches.
zero returns exact query matches, which is faster by direct string search.
• resultFile must be None or "Automatic" or a valid File specification.
None causes VWDC to return a Table of values, e.g. result=VWDC[... .
"Automatic" will write the Table to "VWDC result.mx" in the workingDirectory.
anything else must be type File — choose file extensions appropriate for Table.
• parallelProcessors must be an integer either = 0 or > 1.
targets less than 80kB in length will likely not benefit from values > 0 in the current version.
targets less than 40kB in length can experience longer run times from values > 0.
• chattyTrue will make the program verbose, supplying information on options and computations.
• helpTrue displays this text.
TEST PROGRAM
In[]:=
myTargets={StringJoin[RandomChoice[{"A","T","C","G"},4095]]&[SeedRandom[4313]],StringJoin[RandomChoice[{"A","T","C","G"},4095]]&[SeedRandom[9639]]};myTargetLabels={"random 4313","random 9639"};myQueries={"ATGTTATAGTTGAGTGAGGATAA","TTGTCCGTTTCTTATACAAT"};myQueryLabels={"LMFC26 F","LMFC30 F"};myWorkDir=FileNameJoin[{NotebookDirectory[],"vwdc tmp"}];(*mustexist*)myResultFile=None;(*File[FileNameJoin[{NotebookDirectory[],StringRiffle[myTargetLabels,", "]<>"; "<>StringRiffle[myQueryLabels,", "]<>" test.tsv"}]];*)startTime=AbsoluteTime[];result=VWDC[myTargets,myQueries,myWorkDir,targetLabelsmyTargetLabels,queryLabelsmyQueryLabels,resultFilemyResultFile,parallelProcesses0,chattyFalse];finishTime=AbsoluteTime[];Print["elapsed time = ",ElapsedTimeStr[finishTime-startTime]];If[ToString[Head[myResultFile]]≠"File",Print[Grid[result,Alignment->Left,Frame->All,FrameStyle->Gray]]];