''' This program is meant to copy the files that you have in your SavedData.csv file to a new directory for further analysis by the Click1_Click2_Cut.R program. Note that this program will copy only the files contained within the SavedData.csv file to the new directory. To run this program you should have all of your pair profiles that you want to select from as well as your SavedData.csv file all in one directory. ''' path_var_old <- r"(F:\Backup Plus (Backup)\7.8.2022\s0301\ck\Translocation_Traces)" # Save the directory that you have your pair profiles and SavedData.csv file in to the variable "path_var_old". savedData_filename <- "SavedData.csv" #Name of your SavedData.csv file #Create the SavedData directory that you will copy the pair profiles contained within your SavedData.csv file to. dir.create(paste(toString(path_var_old), "SavedData", sep = "///"), showWarnings = FALSE) output_dir <- paste(path_var_old, "SavedData", sep = "\\") #Read in your SavedData.csv file savedData <- read.csv(list.files(path_var_old, savedData_filename, full.name = TRUE), header = FALSE, sep = ",") #Save onlyl the filenames column (last column) to the fileNames variable. Then delete the blank space that is present at the beginning of each filename. fileNames <- savedData[, 13] #If your filenames column is not the 13th column in your SavedData.csv file, simply change "13" to whatever column number that it is in. fileNames <- substring(fileNames, 2) #Paste the directory information to the start of each filename so that R knows where to find the files. path_files <- paste(path_var_old, fileNames, sep = "\\") #Paste the directory information to the start of your SavedData.csv file path_SavedData <- paste(path_var_old, savedData_filename, sep = "\\") #Copy the files from your current directory to the output directory. file.copy(path_files, output_dir, overwrite = TRUE) file.copy(path_SavedData, output_dir, overwrite = TRUE)