Skip to contents

An R wrapper around the AnnoTALE 'AnnoTALE.jar build' program. It usually takes its input from the file generated by the run_annotale_predict function.

Usage

run_annotale_build(
  fasta_file,
  output_dir = tempfile("annotale_build_"),
  opt_param = "c=5 s=0.01",
  java_args = "-Xms512M -Xmx6G",
  annotale_jar = .tantale_tool("annotale")
)

Arguments

fasta_file

Path to a TALE_DNA_sequences_* fasta file, as written by run_annotale_predict's "predict" stage, to be classified into groups.

output_dir

Directory where output will be written, created if it does not exist. The default is a new directory under tempdir(), which R deletes when the session ends: give a path to keep the results.

opt_param

A single string of options for AnnoTALE build, as key=value pairs separated by spaces. The default writes out the tool's own defaults: c, the cutoff on the distance that defines the maximum extent of a TALE class (5), and s, the significance level on the alignment p-value (0.01). An option left out of a string of your own keeps its default. The keys this function sets itself (t, outdir) are refused: use fasta_file and output_dir.

java_args

A single string of options for the Java virtual machine, placed before -jar. The default starts Java with 512 MB of memory and lets it grow to 6 GB; raise -Xmx if build runs out of memory.

annotale_jar

Path to the AnnoTALE jar file. The default is the copy tantale_setup() downloads; give a path to use another version.

Value

output_dir, invisibly. If AnnoTALE exits with a non-zero status, the function stops with an error of class tantale_error_annotale_failed.

Examples

# \donttest{
# Needs a Java runtime and the tools tantale_setup() downloads. Chained
# from run_annotale_predict()'s own output, since that is the file build
# normally classifies.
fasta <- tantale_genome("MAI1")
predict_out <- file.path(tempdir(), "annotale_build_example", "predict")
run_annotale_predict(fasta, output_dir = predict_out)
#> Running AnnoTALE predict for "MAI1"
#>   java -jar
#>   '/home/cunnac/snap/codium/495/.local/share/R/tantale/tools-1/AnnoTALEcli-1.5.jar'
#>   predict Sensitive=false
#>   g='/home/cunnac/snap/codium/495/.local/share/R/tantale/genomes-1/MAI1.fa'
#>   s='MAI1' outdir='/tmp/Rtmp17aOMt/annotale_build_example/predict/Predict'
#> Running AnnoTALE analyze for "MAI1"
#>   java -jar
#>   '/home/cunnac/snap/codium/495/.local/share/R/tantale/tools-1/AnnoTALEcli-1.5.jar'
#>   analyze
#>   t='/tmp/Rtmp17aOMt/annotale_build_example/predict/Predict/TALE_DNA_sequences_(MAI1).fasta'
#>   outdir='/tmp/Rtmp17aOMt/annotale_build_example/predict/Analyze'
predicted <- list.files(file.path(predict_out, "Predict"),
                        pattern = "^TALE_DNA_sequences_", full.names = TRUE)
build_out <- file.path(tempdir(), "annotale_build_example", "build")
run_annotale_build(predicted, output_dir = build_out)
#> Running AnnoTALE build
#>   java -Xms512M -Xmx6G -jar
#>   '/home/cunnac/snap/codium/495/.local/share/R/tantale/tools-1/AnnoTALEcli-1.5.jar'
#>   build c=5 s=0.01
#>   t='/tmp/Rtmp17aOMt/annotale_build_example/predict/Predict/TALE_DNA_sequences_(MAI1).fasta'
#>   outdir='/tmp/Rtmp17aOMt/annotale_build_example/build'
list.files(build_out)
#>  [1] "Class_1"             "Class_2"             "Class_3"            
#>  [4] "Class_4"             "Class_5"             "Class_6"            
#>  [7] "Class_7"             "Class_8"             "Class_9"            
#> [10] "Class_builder.xml"   "Tree_of_classes.pdf" "protocol_build.txt" 
# }