diff --git a/MinION_mobile_lab.R b/MinION_mobile_lab.R index ee9bfa6..a79f3ec 100644 --- a/MinION_mobile_lab.R +++ b/MinION_mobile_lab.R @@ -222,6 +222,7 @@ if (pair_strands_flag == 1) { system(paste0(PYCOQC, " -f ", d2_basecalling, "/sequencing_summary.txt -b ", d2_preprocessing, "/barcoding_summary.txt -o ", d2, "/qc/pycoQC_report.html")) } demu_files <- list.files(path = d2_preprocessing, pattern = "BC", full.names = TRUE) + for (i in 1:length(demu_files)) { BC_val_curr <- substr(x = basename(demu_files[i]), start = 3, stop = 4) if (paste0("BC", BC_val_curr) %in% BC_int) { @@ -229,7 +230,7 @@ for (i in 1:length(demu_files)) { cat(text = paste0("Now trimming adapters with Porechop for sample BC", BC_val_curr), sep = "\n") if (disable_porechop_demu_flag == 1) { system(paste0("mkdir ", d2_preprocessing, "/BC", BC_val_curr, "_porechop_dir_tmp")) - system(paste0(PORECHOP, " -i ", d2_preprocessing, "/BC", BC_val_curr, "_tmp1.fastq -o ", d2_preprocessing, "/BC", BC_val_curr, "_porechop_dir_tmp/BC", BC_val_curr, ".fastq")) + system(paste0(PORECHOP, " -i ", d2_preprocessing, "/BC", BC_val_curr, "_tmp1.fastq -o ", d2_preprocessing, "/BC", BC_val_curr, "_porechop_dir_tmp/BC", BC_val_curr, ".fastq --extra_end_trim ", primers_length)) } else { system(paste0(PORECHOP, " -i ", d2_preprocessing, "/BC", BC_val_curr, "_tmp1.fastq -b ", d2_preprocessing, "/BC", BC_val_curr, "_porechop_dir_tmp --require_two_barcodes")) } @@ -267,7 +268,7 @@ for (i in 1:length(demu_files)) { system(paste0("rm ", d3, "/BC", BC_val_curr, ".fastq")) system(paste0("rm ", d3, "/BC", BC_val_curr, ".fasta")) next - } + } cat(text = paste0("Mean read length for sample BC", BC_val_curr, " after filtering: ", sprintf("%.0f", mean(ws_ok)), " (", sprintf("%.0f", sd(ws_ok)), ")"), file = logfile, sep = "\n", append = TRUE) cat(text = paste0("Mean read length for sample BC", BC_val_curr, " after filtering: ", sprintf("%.0f", mean(ws_ok)), " (", sprintf("%.0f", sd(ws_ok)), ")"), sep = "\n") png(paste0(d2, "/qc/hist_BC", BC_val_curr, "_unfiltered.png")) diff --git a/config_MinION_mobile_lab.R b/config_MinION_mobile_lab.R index 33c53de..300b5f5 100644 --- a/config_MinION_mobile_lab.R +++ b/config_MinION_mobile_lab.R @@ -21,7 +21,7 @@ #if do_subsampling_flag <- 1, subsampling of num_fast5_files fast5 files is performed; otherwise set do_subsampling_flag <- 0 do_subsampling_flag <- 0 #num_fast5_files is the number of fast5 files to be subsampled/analysed (if do_subsampling_flag <- 1) -num_fast5_files <- 25 +num_fast5_files <- 50000 #BC_int are the barcodes used in the experiment #BC_int <- c("BC01", "BC02", "BC03", "BC04", "BC05", "BC06", "BC07", "BC08", "BC09", "BC10", "BC11", "BC12") BC_int <- c("BC01", "BC02", "BC03", "BC04", "BC05", "BC06", "BC07", "BC08", "BC09", "BC10", "BC11", "BC12") @@ -41,8 +41,8 @@ save_space_flag <- 0 #set the maximum number of threads to be used num_threads <- 30 #set a mean amplicon length [bp] -amplicon_length <- 700 -#fixed_lenfil_flag <- 1 if you want to keep reads in the range [amplicon_length - lenfil_tol/2; amplicon_length + lenfil_tol/2]; otherwise set fixed_lenfil_flag <- 0 if you want to keep reads in the range [mean_length -2*sd; mean_length + 2*sd] where mean_length and sd are evaluated on a sample basis +amplicon_length <- 710 +#fixed_lenfil_flag <- 1 if you want to keep reads in the range [amplicon_length - lenfil_tol/2; amplicon_length + lenfil_tol/2]; otherwise set fixed_lenfil_flag <- 1 if you want to keep reads in the range [mean_length -2*sd; mean_length + 2*sd] where mean_length and sd are evaluated on a sample basis fixed_lenfil_flag <- 0 #if fixed_lenfil_flag <- 1, lenfil_tol [bp] is the size of the window centered in amplicon_length for reads to be kept lenfil_tol <- 300 diff --git a/install.sh b/install.sh index 16459b6..8f37bcf 100644 --- a/install.sh +++ b/install.sh @@ -19,12 +19,11 @@ # PIPELINE_DIR=$(realpath $( dirname "${BASH_SOURCE[0]}" )) -MINICONDA_DIR=$(which conda | sed 's/miniconda3.*$/miniconda3/') +MINICONDA_DIR=$(which conda | sed 's/bin.*$//') conda config --add channels bioconda conda config --add channels conda-forge conda config --add channels r -conda config --add channels anaconda -conda create -n ONTrack_env python=3.6 blast emboss vsearch seqtk mafft porechop minimap2 samtools nanopolish bedtools r bioconductor-biostrings +conda create -n ONTrack_env python=3.6 blast emboss vsearch seqtk mafft porechop minimap2 samtools nanopolish r bioconductor-biostrings source activate ONTrack_env pip install pycoQC echo -e "\n" diff --git a/version.txt b/version.txt index 25f1bf7..d88857a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -ONTrack-v1.4.2 +ONTrack-v1.5.0