# HG changeset patch # User david-hoover # Date 1406125627 14400 # Node ID 17e442abb3de9966ec22b7a9a8bf70ef1ba80d5b Uploaded diff -r 000000000000 -r 17e442abb3de bowtie_build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bowtie_build.xml Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,22 @@ + + Build index for Bowtie alignment + + + bowtie_build_wrapper.pl + + + + ./bowtie_build_wrapper.pl $fastafile "$output.files_path" $output "$fastafile.name" + + + + + + + + + + + + + diff -r 000000000000 -r 17e442abb3de bowtie_build_wrapper.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bowtie_build_wrapper.pl Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,33 @@ +#!/usr/bin/perl + +use File::Copy qw/ copy /; + +$ENV{PATH} .= ":/usr/local/apps/mirdeep2/2.0.0.5:/usr/local/apps/bowtie/0.12.9:/usr/local/apps/viennarna/current/bin:/usr/local/randfold-2.0/bin"; + +$fastafile = $ARGV[0]; +$file_path = $ARGV[1]; +$output_file = $ARGV[2]; +$fastafile_text = $ARGV[3]; + +$output_basename = `basename $output_file`; +chomp $output_basename; +$filepath_basename = `basename $file_path`; +chomp $filepath_basename; + +$output_dir = $output_file; +$output_dir =~ s/$output_basename/$filepath_basename/; + +system ("mkdir -p $file_path"); +copy ($fastafile, $output_file); +copy ($output_file, $file_path); + +system ("bowtie-build $fastafile $file_path/$output_basename"); + +open (OUTPUT,">$output_file"); +print OUTPUT "

Bowtie index on $fastafile_text

\n"; +$dirout = `ls $file_path`; + +foreach $file (split (/\n/, $dirout)) { + print OUTPUT "$file
\n"; +} +close (OUTPUT); diff -r 000000000000 -r 17e442abb3de env.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/env.sh Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,4 @@ +bowtie_build_wrapper.pl:$ENV{PATH} .= ":/usr/local/apps/mirdeep2/2.0.0.5:/usr/local/apps/bowtie/0.12.9:/usr/local/apps/viennarna/current/bin:/usr/local/randfold-2.0/bin"; +mapper_wrapper.pl:$ENV{PATH} .= ":/usr/local/apps/mirdeep2/2.0.0.5:/usr/local/apps/bowtie/0.12.9:/usr/local/apps/viennarna/current/bin:/usr/local/randfold-2.0/bin"; +mirdeep2_wrapper.pl:$ENV{PATH} .= ":/usr/local/apps/mirdeep2/2.0.0.5:/usr/local/apps/bowtie/0.12.9:/usr/local/apps/viennarna/current/bin:/usr/local/randfold-2.0/bin"; +target_spy_wrapper.sh:export PATH=/data/galaxy/appList/ViennaRNA/1.6.1/bin:/data/galaxy/appList/TargetSpy/bin:$PATH diff -r 000000000000 -r 17e442abb3de mapper.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mapper.xml Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,80 @@ + + Mapping using a bowtie index + + + mapper_wrapper.pl + + + + ./mapper_wrapper.pl $bowtie_index_name $output_arf $bowtie_index_name.extra_files_path $reads + + #if $reads.extension.startswith("fastq"): + -e + #end if + + #if $reads.extension.startswith("fasta"): + -c + #end if + + #if str($convert_rna) == "convert_rna_true": + -i + #end if + + #if str($remove_non_atcgun) == "remove_non_atcgun_true": + -j + #end if + + #if str($adapter_seq) != "": + -k $adapter_seq + #end if + + #if str($discard_short_reads) != "": + -l $discard_short_reads + #end if + + #if str($collapse_reads) == "Collapsed Reads Fasta": + -m + #end if + + #if str($map_mismatch) == "map_mismatch_false": + -q + #end if + + #if str($map_threshold) != "": + -r $map_threshold + #end if + + -h -s $output_fasta -n + + + + + + + + + + + + ^[ACGTUacgtu]+$ + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 17e442abb3de mapper_wrapper.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mapper_wrapper.pl Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,15 @@ +#!/usr/bin/perl + +$ENV{PATH} .= ":/usr/local/apps/mirdeep2/2.0.0.5:/usr/local/apps/bowtie/0.12.9:/usr/local/apps/viennarna/current/bin:/usr/local/randfold-2.0/bin"; + +$bowtie_index_name = $ARGV[0]; +$output_arf = $ARGV[1]; +$bowtie_files_path = $ARGV[2]; +$options = join (" ", @ARGV[3..$#ARGV]); + +$basename = `basename $bowtie_index_name`; +chomp $basename; + +system ("mapper.pl $options -p $bowtie_files_path/$basename -t $output_arf 2> /dev/null"); + +if (-s $output_arf == 0) {die "No reads aligned to the reference.";} diff -r 000000000000 -r 17e442abb3de mirdeep2.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirdeep2.xml Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,87 @@ + + Find miRNA candidates using output from mapping step + + + mirdeep2_wrapper.pl + + + + ./mirdeep2_wrapper.pl $collapsed_reads $bowtie_index $bowtie_index.extra_files_path $arf_file $mirna_ref $mirna_other $precursors "$html_output.files_path" "$collapsed_reads.name" $csv_output $html_output $survey_output $mrd_output + + #if str($min_stack_height) != '': + -a $min_stack_height + #end if + + #if str($max_num_precursors) != '': + -g $max_num_precursors + #end if + + #if str($min_score_cutoff) != '': + -b $min_score_cutoff + #end if + + #if str($disable_randfold) == 'disable_randfold_true': + -c + #end if + + #if str($ucsc_genome) != 'None': + -t $ucsc_genome + #end if + + #if str($star_seq) != 'None': + -s $star_seq + #end if + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +miRDeep2 is a software package for identification of novel and known miRNAs in deep sequencing data. Furthermore, it can be used for miRNA expression profiling across samples. + +The output files produced are: + +result.html: a html table giving an overview of novel and known miRNAs detected in the data. The table is hyperlinked to pdfs showing the signature and structure of each hairpin. + +result.csv: spread-sheet format of results.html + +survey.csv: spread-sheet of prediction accuracy for all score-cutoffs between -10 and 10. + +output.mrd: text output of the reported hairpins. + + + diff -r 000000000000 -r 17e442abb3de mirdeep2_wrapper.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirdeep2_wrapper.pl Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,71 @@ +#!/usr/bin/perl + +use File::Temp qw/ tempfile tempdir /; +use File::Copy qw/ copy /; +use Cwd; + +$ENV{PATH} .= ":/usr/local/apps/mirdeep2/2.0.0.5:/usr/local/apps/bowtie/0.12.9:/usr/local/apps/viennarna/current/bin:/usr/local/randfold-2.0/bin"; + +$collapsed_reads = $ARGV[0]; +$bowtie_index_name = $ARGV[1]; +$bowtie_files_path = $ARGV[2]; +$arf_file = $ARGV[3]; +$mirna_ref = $ARGV[4]; +$mirna_other = $ARGV[5]; +$precursors = $ARGV[6]; +$file_path = $ARGV[7]; +$input_name = $ARGV[8]; + +$csv_output = $ARGV[9]; +$html_output = $ARGV[10]; +$survey_output = $ARGV[11]; +$mrd_output = $ARGV[12]; + +# the rest are options +$options = join (" ", @ARGV[13..$#ARGV]); + +#point to correct bowtie index path +$basename = `basename $bowtie_index_name`; +chomp $basename; + +# create the path used to house the pdfs +chomp $file_path; +system ("mkdir -p $file_path"); + +# do all the dirty work in a temp directory +$cwd = cwd(); +$tempdir = tempdir(CLEANUP => 1); +chdir ($tempdir); + +if ($mirna_ref eq "None") {$mirna_ref="none";} +if ($mirna_other eq "None") {$mirna_other="none";} +if ($precursors eq "None") {$precursors="none";} + +$ret_mirdeep2 = `miRDeep2.pl $collapsed_reads $bowtie_files_path/$basename $arf_file $mirna_ref $mirna_other $precursors -v $options 2> /dev/null`; +system ("cp $tempdir/pdfs*/*.pdf $file_path"); + +$csv_file = `ls $tempdir/result*.csv`; +chomp $csv_file; +if ($csv_file eq "") {die "Error: Cannot find csv result file in dir $tempdir\n";} + +$html_file = `ls $tempdir/result*.html`; +chomp $html_file; +if ($html_file eq "") {die "Error: Cannot find html result file in dir $tempdir\n";} + +$survey_file = `ls $tempdir/mirdeep_runs/run*/survey.csv`; +chomp $survey_file; +if ($survey_file eq "") {die "Error: Cannot find survey result file in dir $tempdir\n";} + +$mrd_file = `ls $tempdir/mirdeep_runs/run*/output.mrd`; +chomp $mrd_file; +if ($mrd_file eq "") {die "Error: Cannot find hairpin result file in dir $tempdir\n";} + +# replacing mirdeep created links with relative links in galaxy +system ("sed -r -i 's/file:\\/\\/.+\\/(.+\\.pdf)/\\1/g' $html_file"); + +copy ($csv_file, $csv_output); +copy ($html_file, $html_output); +copy ($survey_file, $survey_output); +copy ($mrd_file, $mrd_output); + +chdir($cwd); diff -r 000000000000 -r 17e442abb3de target_spy.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/target_spy.xml Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,23 @@ + + Find targets for miRNAs + + + target_spy_wrapper.pl + + + + ./target_spy_wrapper.pl $mirna_file $trans_file $targets + + + + + + + + + + + + + + diff -r 000000000000 -r 17e442abb3de target_spy_wrapper.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/target_spy_wrapper.pl Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +use File::Temp qw/ tempfile tempdir /; +use File::Copy qw/ copy /; +use Cwd; + +$mirna_file = $ARGV[0]; +$trans_file = $ARGV[1]; +$targets = $ARGV[2]; + +# do all the dirty work in a temp directory +$cwd = cwd(); +$tempdir = tempdir(CLEANUP => 1); + +copy ("/data/galaxy/galaxy/shed_tools/toolshed.g2.bx.psu.edu/repos/nikhil-joshi/mirdeep2_and_targetspy/798fe7ba8b5e/mirdeep2_and_targetspy/mirdeep2/target_spy_wrapper.sh", $tempdir); +chdir ($tempdir); + +$ret_ts = `sh target_spy_wrapper.sh $mirna_file $trans_file`; +if ($ret_ts ne "") {die "TargetSpy error"} +copy ("targets", $targets); + +chdir($cwd); diff -r 000000000000 -r 17e442abb3de target_spy_wrapper.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/target_spy_wrapper.sh Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,4 @@ +export PATH=/data/galaxy/appList/ViennaRNA/1.6.1/bin:/data/galaxy/appList/TargetSpy/bin:$PATH + +TargetSpy -microRNAs $1 -transcripts $2 -result targets +gunzip targets.gz diff -r 000000000000 -r 17e442abb3de ucsc_browser_species.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ucsc_browser_species.txt Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,48 @@ +None +A.gambiae +A.mellifera +Cat +C.brenneri +C.briggsae +C.elegans +Chicken +Chimp +C.intestinalis +C.japonica +Cow +C.remanei +D.ananassae +D.erecta +D.grimshawi +D.melanogaster +D.mojavensis +Dog +D.persimilis +D.pseudoobscura +D.sechellia +D.simulans +D.virilis +D.yakuba +Fugu +GuineaPig +Horse +Human +Lamprey +Lancelet +Lizard +Marmoset +Medaka +Mouse +Opossum +Orangutan +Platypus +P.pacificus +Rat +Rhesus +S.cerevisiae +S.purpuratus +Stickleback +Tetraodon +X.tropicalis +Zebrafinch +Zebrafish diff -r 000000000000 -r 17e442abb3de ucsc_browser_species.txt.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ucsc_browser_species.txt.sample Wed Jul 23 10:27:07 2014 -0400 @@ -0,0 +1,48 @@ +None +A.gambiae +A.mellifera +Cat +C.brenneri +C.briggsae +C.elegans +Chicken +Chimp +C.intestinalis +C.japonica +Cow +C.remanei +D.ananassae +D.erecta +D.grimshawi +D.melanogaster +D.mojavensis +Dog +D.persimilis +D.pseudoobscura +D.sechellia +D.simulans +D.virilis +D.yakuba +Fugu +GuineaPig +Horse +Human +Lamprey +Lancelet +Lizard +Marmoset +Medaka +Mouse +Opossum +Orangutan +Platypus +P.pacificus +Rat +Rhesus +S.cerevisiae +S.purpuratus +Stickleback +Tetraodon +X.tropicalis +Zebrafinch +Zebrafish