changeset 43:2325074a8461 draft

Uploaded
author davidvanzessen
date Thu, 26 Oct 2017 09:58:05 -0400
parents 9a47d7a552d6
children 1d8728f3ff37
files report_clonality/RScript.r tool_dependencies.xml
diffstat 2 files changed, 61 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/report_clonality/RScript.r	Thu Oct 26 09:08:37 2017 -0400
+++ b/report_clonality/RScript.r	Thu Oct 26 09:58:05 2017 -0400
@@ -988,39 +988,44 @@
 median.aa.l = data.frame(data.table(PRODF)[, list(median=as.double(median(as.numeric(.SD$CDR3.Length, na.rm=T), na.rm=T))), by=c("Sample")])
 write.table(median.aa.l, "AAMedianBySample.txt" , sep="\t",quote=F,na="-",row.names=F,col.names=F)
 
-
-#generate the "Sequences that are present in more than one replicate" dataset
-clonaltype.in.replicates = inputdata
-clonaltype.in.replicates = clonaltype.in.replicates[clonaltype.in.replicates$Functionality %in% c("productive (see comment)","productive"),]
-clonaltype.in.replicates = clonaltype.in.replicates[!(is.na(clonaltype.in.replicates$ID) | is.na(clonaltype.in.replicates$Top.V.Gene) | is.na(clonaltype.in.replicates$Top.J.Gene)),]
-clonaltype = unlist(strsplit(clonaltype, ","))
+if(clonaltype != "none"){
+	#generate the "Sequences that are present in more than one replicate" dataset
+	clonaltype.in.replicates = inputdata
+	clonaltype.in.replicates = clonaltype.in.replicates[clonaltype.in.replicates$Functionality %in% c("productive (see comment)","productive"),]
+	clonaltype.in.replicates = clonaltype.in.replicates[!(is.na(clonaltype.in.replicates$ID) | is.na(clonaltype.in.replicates$Top.V.Gene) | is.na(clonaltype.in.replicates$Top.J.Gene)),]
+	clonaltype = unlist(strsplit(clonaltype, ","))
 
-clonaltype.in.replicates$clonaltype = do.call(paste, c(clonaltype.in.replicates[c(clonaltype, "Replicate")], sep = ":"))
+	clonaltype.in.replicates$clonaltype = do.call(paste, c(clonaltype.in.replicates[paste_columns], sep = ":"))
 
-clonaltype.in.replicates = clonaltype.in.replicates[!duplicated(clonaltype.in.replicates$clonaltype),]
+	clonaltype.in.replicates = clonaltype.in.replicates[!duplicated(clonaltype.in.replicates$clonaltype),]
 
-clonaltype = clonaltype[-which(clonaltype == "Sample")]
+	clonaltype = clonaltype[-which(clonaltype == "Sample")]
 
-clonaltype.in.replicates$clonaltype = do.call(paste, c(clonaltype.in.replicates[clonaltype], sep = ":"))
-clonaltype.in.replicates = clonaltype.in.replicates[,c("clonaltype","Replicate", "ID", "Sequence", "Sample")]
+	clonaltype.in.replicates$clonaltype = do.call(paste, c(clonaltype.in.replicates[clonaltype], sep = ":"))
+	clonaltype.in.replicates = clonaltype.in.replicates[,c("clonaltype","Replicate", "ID", "Sequence", "Sample")]
 
 
-write.table(clonaltype.in.replicates, "clonaltypes_replicates_before_table.txt" , sep="\t",quote=F,na="-",row.names=F,col.names=T)
+	write.table(clonaltype.in.replicates, "clonaltypes_replicates_before_table.txt" , sep="\t",quote=F,na="-",row.names=F,col.names=T)
 
-clonaltype.counts = data.frame(table(clonaltype.in.replicates$clonaltype))
+	clonaltype.counts = data.frame(table(clonaltype.in.replicates$clonaltype))
 
-write.table(clonaltype.counts, "clonaltypes_counts.txt" , sep="\t",quote=F,na="-",row.names=F,col.names=T)
+	write.table(clonaltype.counts, "clonaltypes_counts.txt" , sep="\t",quote=F,na="-",row.names=F,col.names=T)
 
-names(clonaltype.counts) = c("clonaltype", "coincidence")
+	names(clonaltype.counts) = c("clonaltype", "coincidence")
 
-clonaltype.counts = clonaltype.counts[clonaltype.counts$coincidence > 1,]
+	clonaltype.counts = clonaltype.counts[clonaltype.counts$coincidence > 1,]
 
-clonaltype.in.replicates = clonaltype.in.replicates[clonaltype.in.replicates$clonaltype %in% clonaltype.counts$clonaltype,]
-clonaltype.in.replicates = merge(clonaltype.in.replicates, clonaltype.counts, by="clonaltype")
-clonaltype.in.replicates = clonaltype.in.replicates[order(-clonaltype.in.replicates$coincidence, clonaltype.in.replicates$clonaltype, clonaltype.in.replicates$Replicate),c("coincidence","clonaltype", "Sample", "Replicate", "ID", "Sequence")]
+	clonaltype.in.replicates = clonaltype.in.replicates[clonaltype.in.replicates$clonaltype %in% clonaltype.counts$clonaltype,]
+	clonaltype.in.replicates = merge(clonaltype.in.replicates, clonaltype.counts, by="clonaltype")
+	clonaltype.in.replicates = clonaltype.in.replicates[order(-clonaltype.in.replicates$coincidence, clonaltype.in.replicates$clonaltype, clonaltype.in.replicates$Replicate),c("coincidence","clonaltype", "Sample", "Replicate", "ID", "Sequence")]
 
 
-write.table(clonaltype.in.replicates, "clonaltypes_replicates.txt" , sep="\t",quote=F,na="-",row.names=F,col.names=T)
+	write.table(clonaltype.in.replicates, "clonaltypes_replicates.txt" , sep="\t",quote=F,na="-",row.names=F,col.names=T)
+} else {
+	cat("No clonaltype", file="clonaltypes_replicates_before_table.txt")
+	cat("No clonaltype", file="clonaltypes_counts.txt")
+	cat("No clonaltype", file="clonaltypes_replicates.txt")
+}
 
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Thu Oct 26 09:58:05 2017 -0400
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<tool_dependency>
+    <package name="igblastwrp" version="0.6">
+        <install version="1.0">
+            <actions>
+                <action type="download_by_url">https://github.com/mikessh/higblast/releases/download/v0.6/igblastwrapper_linux64.tar.gz</action>
+                <action type="move_file">
+                    <source>bin</source>
+                    <destination>$INSTALL_DIR/</destination>
+                </action>
+                <action type="move_file">
+                    <source>data</source>
+                    <destination>$INSTALL_DIR/</destination>
+                </action>
+                <action type="move_file">
+                    <source>igblastwrp.jar</source>
+                    <destination>$INSTALL_DIR/</destination>
+                </action>
+                <action type="set_environment">
+                    <environment_variable action="set_to" name="IGBLASTWRP">$INSTALL_DIR/</environment_variable>
+                </action>
+            </actions>
+        </install>
+        <readme>
+Downloads https://github.com/mikessh/higblast/
+        </readme>
+    </package>
+    <package name="weblogo" version="3.3">
+      <repository changeset_revision="648e4b32f15c" name="package_weblogo_3_3" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
+    </package>
+    <!--
+    <package name="circostools" version="0.20">
+      <repository name="package_circostools_0_20" owner="iuc" />
+    </package>
+    -->
+</tool_dependency>