From 792661b5703bd49a61a522cc95215bbd1dac73dc Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Tue, 9 Jul 2024 11:10:53 +0200 Subject: [PATCH 1/2] remove patterns from correct_insertion_vc --- bin/cigar_parser.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cigar_parser.R b/bin/cigar_parser.R index 2092a926..69215757 100755 --- a/bin/cigar_parser.R +++ b/bin/cigar_parser.R @@ -547,7 +547,7 @@ correct_insertion_vc <- function(cut_site_position, insertion_row, gRNA){ after_inserted <- substr(as.character(bam[[1]]$seq[bam[[1]]$qname == insertion_row$Ids]), nts_bef_nt+1+insertion_row$Length + diff, nts_bef_nt+insertion_row$Length+3 + diff) if(before_inserted == before_cut && after_inserted == after_cut){ - return(list(Modification="ins", Start=cut_site_position+1, Length=insertion_row$Length, Ids=insertion_row$Ids, above_error_rate=insertion_row$above_error_rate, in_pick = insertion_row$in_pick, freq = insertion_row$freq, Perc=insertion_row$Perc, patterns=insertion_row$patterns, pre_ins_nt=before_inserted, ins_nt=inserted, post_ins_nt=after_inserted)) + return(list(Modification="ins", Start=cut_site_position+1, Length=insertion_row$Length, Ids=insertion_row$Ids, above_error_rate=insertion_row$above_error_rate, in_pick = insertion_row$in_pick, freq = insertion_row$freq, Perc=insertion_row$Perc, pre_ins_nt=before_inserted, ins_nt=inserted, post_ins_nt=after_inserted)) } else { return(insertion_row) } @@ -772,7 +772,7 @@ ref_fasta = opt$reference gRNA_sequence = opt$gRNA_sequence sample_id = opt$sample_name temp = opt$template -spikes = opt$spikes ### yes or no +spikes = opt$spikes files_summary = opt$summary_file cut_pos_prot = as.numeric(opt$cut_site) mock = opt$mock From 42b1fc04fc48f72a7ec3aab7c2671cf8f722ef8c Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Tue, 9 Jul 2024 11:19:19 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + bin/cigar_parser.R | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbf28080..0fa6ea58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix singularity image pull tag for MAGeCKFlute ([#160](https://github.com/nf-core/crisprseq/pull/160)) - Skip dolar signs on containerOptions ([#163](https://github.com/nf-core/crisprseq/pull/163)) +- Fix error in R script when adding patterns ([#170](https://github.com/nf-core/crisprseq/pull/170)) ### Deprecated diff --git a/bin/cigar_parser.R b/bin/cigar_parser.R index 69215757..18e867ab 100755 --- a/bin/cigar_parser.R +++ b/bin/cigar_parser.R @@ -547,7 +547,7 @@ correct_insertion_vc <- function(cut_site_position, insertion_row, gRNA){ after_inserted <- substr(as.character(bam[[1]]$seq[bam[[1]]$qname == insertion_row$Ids]), nts_bef_nt+1+insertion_row$Length + diff, nts_bef_nt+insertion_row$Length+3 + diff) if(before_inserted == before_cut && after_inserted == after_cut){ - return(list(Modification="ins", Start=cut_site_position+1, Length=insertion_row$Length, Ids=insertion_row$Ids, above_error_rate=insertion_row$above_error_rate, in_pick = insertion_row$in_pick, freq = insertion_row$freq, Perc=insertion_row$Perc, pre_ins_nt=before_inserted, ins_nt=inserted, post_ins_nt=after_inserted)) + return(list(Modification="ins", Start=cut_site_position+1, Length=insertion_row$Length, Ids=insertion_row$Ids, above_error_rate=insertion_row$above_error_rate, in_pick = insertion_row$in_pick, freq = insertion_row$freq, Perc=insertion_row$Perc, patterns=insertion_row$patterns, pre_ins_nt=before_inserted, ins_nt=inserted, post_ins_nt=after_inserted)) } else { return(insertion_row) } @@ -900,6 +900,7 @@ if (dim(alignment_info)[1] != 0){ separated_indels["post_ins_nt"]<-NA }else if(dim(separated_indels_ins_all)[1]>0){ separated_indels <- separated_indels_ins_all + separated_indels["patterns"]<-NA }