changeset 18:22d79320085c draft

Uploaded
author big-tiandm
date Thu, 30 Oct 2014 21:31:55 -0400
parents b75750b21aa4
children e0884a4b996b
files DEGseq_2.pl fastx_clipper get_genelist.pl html.pl install_DEG.R matching.pl rfam.pl siRNA.pl siRNA.xml tool_dependencies.xml
diffstat 5 files changed, 200 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/DEGseq_2.pl	Wed Oct 29 05:03:38 2014 -0400
+++ b/DEGseq_2.pl	Thu Oct 30 21:31:55 2014 -0400
@@ -25,13 +25,8 @@
 my $mark1=$opts{mark1};
 my $mark2=$opts{mark2};
 my $fileout=$outputdir."degseq.R";
-my $log=$outputdir."LOG.txt";
 
 open OUT,">$fileout"; #output file  
-open LOG,">$log";
-print LOG "JOB start!\t";
-print LOG `date`;
-print LOG "\n";
 #my ($name,$dir);
 #$name=basename($filein);
 print OUT "library(DEGseq)\n";
@@ -49,42 +44,12 @@
 }
 close OUT;
 
-print LOG "Prepare for DEGseq!\t";
-print LOG `date`;
-print LOG "\n";
 
 system("R CMD BATCH $fileout");
 
 wait;
 
-my $outfile=$outputdir."result.txt";
-open OUT ,">$outfile";
-my $deg=$outputdir."output_score.txt";
-open IN,"<$deg";
-my %hash;
-while (my $aline=<IN>) {
-	chomp $aline;
-	if($aline=~/^\"/){print OUT "#GeneID\tchromsome\tvalue1\tvalue2\ttag\n";next;}
-	my @temp=split/\t/,$aline;
-	#$hash{$temp[0].$temp[1].$temp[2]}=$temp[$#temp];
-	#my @tmp=split/\|/,$temp[0];
-	#my @tmp=split/\:/,$temp[0];
-	#my @po=split/\-/,$tmp[1];
-	print OUT $temp[0],"\t",$temp[1],"\t",$temp[2],"\t",$temp[-1],"\n";
-}
-close IN;
 
-#open IN,"<$filein";
-#while (my $aline=<IN>) {
-#	chomp $aline;
-#	my @temp=split/\t/,$aline;
-#	if (defined $hash{$temp[0].$temp[2].$temp[3]}) {print OUT $aline,"\t",$hash{$temp[0].$temp[2].$temp[3]},"\n";
-#	}
-#}
-
-print LOG "Finish all JOB !\t";
-print LOG `date`;
-print LOG "\n";
 
 sub usage{
 print <<"USAGE";
Binary file fastx_clipper has changed
--- a/siRNA.pl	Wed Oct 29 05:03:38 2014 -0400
+++ b/siRNA.pl	Thu Oct 30 21:31:55 2014 -0400
@@ -143,6 +143,8 @@
 for (my $i=0;$i<@mark ;$i++) {
 	$id{$mark[$i]}=$i+4;
 }
+
+
 group_and_filter();   #collapse reads to tags
 
 rfam();
@@ -423,16 +425,20 @@
 }
 
 sub dec_pel{
-	print "start:\n";
+	print "\n******************\nstart:\n";
 	Time();
 	my $sample=shift(@_);
 	my @each=split/\s+/,$sample;
 	print "$each[0]\t$each[1]\n";
 	my $deg_sample_dir=$deg_dir."$each[0]_VS_$each[1]\/";
 	mkdir ("$deg_sample_dir");
+	print "read: $read\n";
+	print "deg_sample_dir: $deg_sample_dir\n";
+	print "$id{$each[0]}\t$each[0]\n";
+	print "$id{$each[1]}\t$each[1]\n";
 	my $deg=`perl $path\/DEGseq_2.pl -i $read -outdir $deg_sample_dir -column1 $id{$each[0]} -mark1 $each[0] -column2 $id{$each[1]} -mark2 $each[1]`; #-depth1 -depth2
 	my $time2=time();
-	print "end:\n";
+	print "end:\n*************************\n";
 	Time();
 	sleep 1;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/siRNA.xml	Thu Oct 30 21:31:55 2014 -0400
@@ -0,0 +1,106 @@
+<tool id="plant_sirna_v1" name="siRNA" veision="1.0.0">
+  <description>tool for plant siRNA analisis</description>
+
+  <requirements>
+    <requirement type="set_environment">SCRIPT_PATH</requirement>
+    <requirement type="package" version="0.12.7">bowtie</requirement>
+    <requirement type="package" version="3.0.1">R</requirement>
+    <requirement type="package" version="1.20.0">degseq</requirement>
+	<requirement type="package" version="0.0.13">fastx_toolkit </requirement>
+	<requirement type="package" version="1.96">threads</requirement>
+	<requirement type="package" version="1.06">Parallel-ForkManager</requirement>
+	<requirement type="package" version="2.59">SVG</requirement>
+	<requirement type="package" version="1.4">Boost-Graph</requirement>
+  </requirements>
+
+  <command interpreter="perl">siRNA.pl 
+   ## Change this to accommodate the number of threads you have available.
+        -t \${GALAXY_SLOTS:-4}
+
+	-path \$SCRIPT_PATH
+
+    #for $j, $s in enumerate( $series )
+    ##rank_of_series=$j
+    -i ${s.input}
+    -tag ${s.tag}
+    #end for
+
+   ## Do or not annotate siRNAs by function
+    #if $params.function_anno == "yes":
+     -nat $params.nat -repeat $params.repeat
+	#end if
+   
+   ## Do or not DEG
+    #if $degseq.degseq_analysis == "yes" :
+    -deg $degseq.deg
+    #end if
+
+  -format $format -g $genome -f $gff -mis $mis -rfam $rfam -v $v -a $a -n $mapnt -d $d -p $p -l $l  -cen $cen -span $span > run.log
+
+  </command>
+
+  <inputs>
+
+   <repeat name="series" title="Series">
+     <param name="input" type="data" label="Raw data file"/>
+     <param name="tag" type="text" data_ref="input" label="Sample name of raw data"/>
+   </repeat>
+
+	<param name="format" type="select" lable="raw data format" multiple="false">
+	  <option value="fastq">Raw data is fastq. format</option>
+	  <option value="fasta">Raw data is fasta. format</option>
+	</param>
+	
+	<param name="genome"  type="data" label="genome sequence fasta file"/>
+	<!--param type="data" name="index" label="genome sequence bowtie index"/-->
+	<param name="gff" type="data" label="gff file" />
+	<param name="mis" type="integer" value="0" label="number of allowed mismatches when mapping reads to genome" />
+	<param name="rfam" type="data" label="rfam sequence file" />
+	<param name="v" type="integer" value="0" label="report end-to-end hits less than v mismatches"/>
+	<param name="a" type="text" value="ATCTCGTATG" label="3' adapter sequence" />
+	<param name="mapnt" type="integer" value="25" label="a read is allowed to map up to this number of positions in the genome" />
+	<param name="d" type="integer" value="100" label="distance of tag to merged a cluster" />
+
+	<param name="p" type="select" lable="cluster method" multiple="false">
+	  <option value="F">conventional</option>
+	  <option value="T">NIBLES</option>
+	</param>
+	<param name="l" type="integer" value="1000" label="the length of the upstream and downstream,used in position annotate" />
+
+
+	<conditional name="params">
+		<param name="function_anno" type="select" label="Do or not annotate siRNAs by function">
+		  <option value="no" selected="true">no</option>
+		  <option value="yes">yes</option>
+		 </param>
+		 <when value="yes">
+			<param name="nat" type="data" label="atural antisense transcripts file" />
+			<param name="repeat" type="data" label="repeat information file out of Repeatmasker" />
+		 </when>
+    </conditional> <!-- params -->
+	
+	<param name="cen" type="data" label="centromere file input" />
+	<param name="span" type="integer" value="50000" label="plot span" />
+	
+    <conditional name="degseq">
+       <param name="degseq_analysis" type="select" label="Do or not identify Difference Expression Clusters">
+		  <option value="no" selected="true">no</option>
+		  <option value="yes">yes</option>
+       </param>
+       <when value="yes">
+			<param name="deg" type="data" label="file config of de sample" />
+        </when>
+    </conditional>
+    
+  </inputs>
+
+  <outputs>
+   <data format="txt" name="siRNA cluster" from_work_dir="cluster_runs/total.result" label="${tool.name} on ${on_string}: siRNA cluster"/>
+   <data format="html" name="analysis result" from_work_dir="cluster_runs/result.html" label="${tool.name} on ${on_string}: analysis result"/>
+
+  </outputs>
+
+ <help>
+
+ </help>
+ </tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Thu Oct 30 21:31:55 2014 -0400
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<tool_dependency>
+    <package name="fastx_toolkit" version="0.0.13">
+        <repository changeset_revision="ec66ae4c269b" name="package_fastx_toolkit_0_0_13" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
+    </package>
+    <package name="bowtie" version="0.12.7">
+        <repository changeset_revision="9f9f38617a98" name="package_bowtie_0_12_7" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
+    </package>
+    <set_environment version="1.0">
+        <environment_variable action="set_to" name="SCRIPT_PATH">$REPOSITORY_INSTALL_DIR</environment_variable>
+    </set_environment>
+	<package name="R" version="3.0.1">
+	   <repository changeset_revision="c5ff6dd33c79" name="package_r_3_0_1" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu" />
+	</package>
+
+	<package name="degseq" version="1.20.0">
+		<install version="1.0">
+		   <actions>
+		      <action type="set_environment_for_install">
+                    <repository changeset_revision="c5ff6dd33c79" name="package_r_3_0_1" owner="iuc" toolshed="http://toolshed.g2.bx.psu.edu">
+                        <package name="R" version="3.0.1" />
+                    </repository>
+              </action>
+		      <action type="shell_command">R CMD BATCH $REPOSITORY_INSTALL_DIR/install_DEG.R </action>
+		   </actions>
+		</install>
+	</package>
+
+	<package name="threads" version="1.96">
+	   <install version="1.0">
+		   <actions>
+		     <action type="download_by_url">http://www.cpan.org/authors/id/J/JD/JDHEDDEN/threads-1.96.tar.gz</action>
+			 <action type="shell_command">perl Makefile.PL PREFIX=$INSTALL_DIR </action>
+			 <action type="shell_command">make</action>
+			 <action type="shell_command">make install</action>
+			 <action type="set_environment">
+			   <environment_variable action="prepend_to" name="PERL5LIB">$INSTALL_DIR/lib</environment_variable>
+			 </action>
+		   </actions>
+	   </install>
+	</package>
+
+
+	<package name="Parallel-ForkManager" version="1.06">
+	   <install version="1.0">
+		   <actions>
+		     <action type="download_by_url">http://www.cpan.org/authors/id/S/SZ/SZABGAB/Parallel-ForkManager-1.06.tar.gz</action>
+			 <action type="shell_command">perl Makefile.PL PREFIX=$INSTALL_DIR </action>
+			 <action type="shell_command">make</action>
+			 <action type="shell_command">make install</action>
+			 <action type="set_environment">
+			   <environment_variable action="prepend_to" name="PERL5LIB">$INSTALL_DIR/lib</environment_variable>
+			 </action>
+		   </actions>
+	   </install>
+	</package>
+
+	<package name="SVG" version="2.59">
+	   <install version="1.0">
+		   <actions>
+		     <action type="download_by_url">http://www.cpan.org/authors/id/S/SZ/SZABGAB/SVG-2.59.tar.gz</action>
+			 <action type="shell_command">perl Makefile.PL PREFIX=$INSTALL_DIR </action>
+			 <action type="shell_command">make</action>
+			 <action type="shell_command">make install</action>
+			 <action type="set_environment">
+			   <environment_variable action="prepend_to" name="PERL5LIB">$INSTALL_DIR/lib</environment_variable>
+			 </action>
+		   </actions>
+	   </install>
+	</package>
+
+	<package name="Boost-Graph" version="1.4">
+	   <install version="1.0">
+		   <actions>
+		     <action type="download_by_url">http://www.cpan.org/authors/id/D/DB/DBURDICK/BoostGraph/Boost-Graph-1.4.tar.gz</action>
+			 <action type="shell_command">perl Makefile.PL PREFIX=$INSTALL_DIR </action>
+			 <action type="shell_command">make</action>
+			 <action type="shell_command">make install</action>
+			 <action type="set_environment">
+			   <environment_variable action="prepend_to" name="PERL5LIB">$INSTALL_DIR/lib</environment_variable>
+			 </action>
+		   </actions>
+	   </install>
+	</package>
+
+</tool_dependency>