changeset 15:61d0a6318711 draft

Uploaded
author davidvanzessen
date Thu, 17 Nov 2016 07:33:21 -0500
parents 59765d2c8890
children 4e596473c25c
files merge_and_filter.r shm_csr.xml
diffstat 2 files changed, 127 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/merge_and_filter.r	Fri Nov 11 07:31:48 2016 -0500
+++ b/merge_and_filter.r	Thu Nov 17 07:33:21 2016 -0500
@@ -175,14 +175,12 @@
 		result$unique.def = paste(result$CDR2.IMGT.seq, result$FR3.IMGT.seq, result$CDR3.IMGT.seq)
 	}
 	
-	if(grepl("keep", filter.unique)){
-		result$unique.def = paste(result$unique.def, gsub(",.*", "", result$best_match)) #keep the unique sequences that are in multiple classes
-		result = result[!duplicated(result$unique.def),]
-	} else {
+	if(filter.unique == "remove"){
 		result = result[duplicated(result$unique.def) | duplicated(result$unique.def, fromLast=T),]
-		result$unique.def = paste(result$unique.def, gsub(",.*", "", result$best_match)) #keep the unique sequences that are in multiple classes, gsub so the unmatched don't have a class after it
-		result = result[!duplicated(result$unique.def),]
 	}
+	result$unique.def = paste(result$unique.def, gsub(",.*", "", result$best_match)) #keep the unique sequences that are in multiple classes, gsub so the unmatched don't have a class after it
+	
+	result = result[!duplicated(result$unique.def),]
 }
 
 write.table(result, gsub("before_unique_filter.txt", "after_unique_filter.txt", before.unique.file), sep="\t", quote=F,row.names=F,col.names=T)
@@ -197,8 +195,21 @@
 
 result$past = do.call(paste, c(result[unlist(strsplit(unique.type, ","))], sep = ":"))
 
+
+
+
+result.matched = result[!grepl("unmatched", result$best_match),]
+result.unmatched = result[grepl("unmatched", result$best_match),]
+
+result = rbind(result.matched, result.unmatched)
+
 result = result[!(duplicated(result$past)), ]
 
+
+
+
+
+
 result = result[,!(names(result) %in% c("past", "best_match_class"))]
 
 print(paste("Number of sequences in result after", unique.type, "filtering:", nrow(result)))
--- a/shm_csr.xml	Fri Nov 11 07:31:48 2016 -0500
+++ b/shm_csr.xml	Thu Nov 17 07:33:21 2016 -0500
@@ -75,27 +75,115 @@
 		<citation type="doi">10.1093/bioinformatics/btv359</citation>
 	</citations>
 	<help>
-		Takes an IMGT zip (http://www.imgt.org/HighV-QUEST/search.action) file and creates a summarization of the mutation analysis.  
-		
-		+--------------------------+
-		|       unique filter      |
-		+--------+--------+--------+
-		| values | remove | keep   |
-		+--------+--------+--------+
-		|   A    |   A    |   A    |
-		+--------+--------+--------+
-		|   A    |   B    |   B    |
-		+--------+--------+--------+
-		|   B    |   D    |   C    |
-		+--------+--------+--------+
-		|   B    |        |   D    |
-		+--------+--------+--------+
-		|   C    |        |        |
-		+--------+--------+--------+
-		|   D    |        |        |
-		+--------+--------+--------+
-		|   D    |        |        |
-		+--------+--------+--------+
-		
+<![CDATA[
+**References**
+
+Yaari, G. and Uduman, M. and Kleinstein, S. H. (2012). Quantifying selection in high-throughput Immunoglobulin sequencing data sets. In *Nucleic Acids Research, 40 (17), pp. e134–e134.* [`doi:10.1093/nar/gks457`_]
+
+.. _doi:10.1093/nar/gks457: http://dx.doi.org/10.1093/nar/gks457
+
+Gupta, Namita T. and Vander Heiden, Jason A. and Uduman, Mohamed and Gadala-Maria, Daniel and Yaari, Gur and Kleinstein, Steven H. (2015). Change-O: a toolkit for analyzing large-scale B cell immunoglobulin repertoire sequencing data: Table 1. *In Bioinformatics, 31 (20), pp. 3356–3358.* [`doi:10.1093/bioinformatics/btv359`_]
+
+.. _doi:10.1093/bioinformatics/btv359: http://dx.doi.org/10.1093/bioinformatics/btv359
+
+-----
+
+**Input files**
+
+IMGT/HighV-QUEST .zip and .txz are accepted as input files.
+
+.. class:: infomark
+
+Note: Files can be uploaded by using “get data” and “upload file” and selecting “IMGT archive“ as a file type. 
+
+-----
+
+**Sequence starts at**
+
+Identifies the region which will be included in the analysis (analysed region)
+
+- Sequences which are missing a gene region (FR1/CDR1 etc) in the analysed region are excluded
+- Sequences containing an ambiguous base in the analysed region are excluded
+- All other filtering/analysis is based on the analysed region
+
+-----
+
+**Functionality filter**
+
+Allows filtering on productive rearrangement, unproductive rearrangements or both based on the assignment provided by IMGT. 
+
+**Filter unique sequences**
+
+*Remove unique:*
+
+  This filter consists of two different steps.
+
+  Step 1: removes all sequences of which the nucleotide sequence in the “analysed region” (see sequence starts at filter) occurs only once. (Sub)classes are not taken into account in this filter step.
+
+  Step 2: removes all duplicate sequences (sequences with the exact same nucleotide sequence in the analysed region and the same (sub)class).
+
+  .. class:: infomark
+
+  Note: This means that sequences with the same nucleotide sequence but a different (sub)class will be included in the results of both (sub)classes.
+
+*Keep unique:*
+
+  Removes all duplicate sequences (sequences with the exact same nucleotide sequence in the analysed region and the same (sub)class).
+
+Example of the sequences that are included using either the “remove unique filter” or the “keep unique filter”
+
++--------------------------+
+|       unique filter      |
++--------+--------+--------+
+| values | remove | keep   |
++--------+--------+--------+
+|   A    |   A    |   A    |
++--------+--------+--------+
+|   A    |   B    |   B    |
++--------+--------+--------+
+|   B    |   D    |   C    |
++--------+--------+--------+
+|   B    |        |   D    |
++--------+--------+--------+
+|   C    |        |        |
++--------+--------+--------+
+|   D    |        |        |
++--------+--------+--------+
+|   D    |        |        |
++--------+--------+--------+
+
+-----
+ 
+**Remove duplicates based on**
+
+Allows the selection of a single sequence per clone. Different definitions of a clone can be chosen. 
+
+.. class:: infomark
+
+Note: The first sequence (in the data set) of each clone is always included in the analysis. When the first matched sequence is unmatched (no subclass assigned) the first matched sequence will be included. This means that altering the data order (by for instance sorting) can change the sequence which is included in the analysis and therefore slightly influence results. 
+
+-----
+
+**Human Class/Subclass filter**
+
+.. class:: warningmark
+
+Note: This filter should only be applied when analysing human IGH data in which a (sub)class specific sequence is present. Otherwise please select the "do not assign (sub)class" option to prevent errors when running the pipeline. 
+
+The class percentage is based on the ‘chunk hit percentage’ (see below). The subclass percentage is based on the ‘nt hit percentage’ (see below).
+
+The SHM & CSR pipeline identifies human Cµ, Cα, Cγ and Cε constant genes by dividing the reference sequences for the subclasses (NG_001019) in 8 nucleotide chunks which overlap by 4 nucleotides. These overlapping chunks are then individually aligned in the right order to each input sequence. This alignment is used to calculate the chunck hit percentage and the nt hit percentage. 
+
+*Chunk hit percentage*: the percentage of the chunks that is aligned 
+
+*Nt hit percentage*: The percentage of chunks covering the subclass specific nucleotide match with the different subclasses. The most stringent filter for the subclass is 70% ‘nt hit percentage’ which means that 5 out of 7 subclass specific nucleotides for Cα or 6 out of 8 subclass specific nucleotides of Cγ should match with the specific subclass. 
+
+-----
+
+**Output new IMGT archives per class into your history?**
+
+If yes is selected, additional output files (one for each class) will be added to the history which contain information of the sequences that passed the selected filtering criteria. These files are in the same format as the IMGT/HighV-QUEST output files and therefore are also compatible with many other analysis programs, such as IGGalaxy. 
+
+]]>
 	</help>
 </tool>