changeset 60:3b5fe323f563 draft

Uploaded
author davidvanzessen
date Wed, 26 Jul 2017 10:24:49 -0400
parents 1ad34508be98
children 275e759e7985
files merge_and_filter.r shm_csr.xml
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/merge_and_filter.r	Tue Jul 18 05:03:55 2017 -0400
+++ b/merge_and_filter.r	Wed Jul 26 10:24:49 2017 -0400
@@ -219,7 +219,9 @@
 
 if(filter.unique != "no"){
 	clmns = names(result)
-	if(empty.region.filter == "leader"){
+	if(filter.unique == "remove_vjaa"){
+		result$unique.def = paste(result$V.GENE.and.allele, result$J.GENE.and.allele, result$CDR3.IMGT.seq)
+	} else if(empty.region.filter == "leader"){
 		result$unique.def = paste(result$FR1.IMGT.seq, result$CDR1.IMGT.seq, result$FR2.IMGT.seq, result$CDR2.IMGT.seq, result$FR3.IMGT.seq, result$CDR3.IMGT.seq)
 	} else if(empty.region.filter == "FR1"){
 		result$unique.def = paste(result$CDR1.IMGT.seq, result$FR2.IMGT.seq, result$CDR2.IMGT.seq, result$FR3.IMGT.seq, result$CDR3.IMGT.seq)
@@ -229,7 +231,7 @@
 		result$unique.def = paste(result$CDR2.IMGT.seq, result$FR3.IMGT.seq, result$CDR3.IMGT.seq)
 	}
 	
-	if(filter.unique == "remove"){
+	if(grepl("remove", filter.unique)){
 		result = result[duplicated(result$unique.def) | duplicated(result$unique.def, fromLast=T),]
 		unique.defs = data.frame(table(result$unique.def))
 		unique.defs = unique.defs[unique.defs$Freq >= filter.unique.count,]
--- a/shm_csr.xml	Tue Jul 18 05:03:55 2017 -0400
+++ b/shm_csr.xml	Wed Jul 26 10:24:49 2017 -0400
@@ -33,6 +33,7 @@
 		<conditional name="filter_unique">
 			<param name="filter_unique_select" type="select" label="Filter unique sequences" help="See below for an example.">
 				<option value="remove" selected="true">Remove uniques (Based on nucleotide sequence + C)</option>
+				<option value="remove_vjaa">Remove uniques (Based on V+J+CDR3 (AA))</option>
 				<option value="keep">Keep uniques (Based on nucleotide sequence + C)</option>
 				<option value="no">No</option>
 			</param>