Mercurial > repos > drosofff > mississipi_gcc2
comparison MirParser.xml @ 0:de6a6afc5a79 draft default tip
Uploaded
| author | drosofff |
|---|---|
| date | Tue, 24 Jun 2014 12:16:43 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:de6a6afc5a79 |
|---|---|
| 1 <tool id="MirParser" name="Parse miRNAs" version="0.9.1"> | |
| 2 <description>from sRbowtie aligment</description> | |
| 3 <requirements><requirement type='package'>bowtie-inspect</requirement></requirements> | |
| 4 <parallelism method="basic"></parallelism> | |
| 5 <command interpreter="python"> | |
| 6 MirParser.py | |
| 7 #if $refGenomeSource.genomeSource == "history": | |
| 8 $refGenomeSource.ownFile ## index source sys.arg[1] | |
| 9 --do_not_extract_index ## sys.argv[2] | |
| 10 #else: | |
| 11 #silent reference= filter( lambda x: str( x[0] ) == str( $input_list.dbkey ), $__app__.tool_data_tables[ 'bowtie_indexes' ].get_fields() )[0][-1] | |
| 12 $reference ## sys.argv[1] | |
| 13 --extract_index ## sys.argv[2] | |
| 14 #end if | |
| 15 $output1 ## for pre-mirs ## sys.argv[3] | |
| 16 $output2 ## for mature mirs ## sys.argv[4] | |
| 17 $GFF3 ## sys.argv[5] | |
| 18 #if $plotting.plottingOption == "yes": | |
| 19 $lattice_dataframe ## sys.argv[6] | |
| 20 $plotCode ## sys.argv[7] | |
| 21 $latticePDF ## sys.argv[8] | |
| 22 #else: | |
| 23 "dummy_dataframe_path" ## sys.argv[6] | |
| 24 "dummy_plotCode" ## sys.argv[7] | |
| 25 "dummy_latticePDF" ## sys.argv[8] | |
| 26 #end if | |
| 27 #for $i in $refGenomeSource.input_list | |
| 28 $i $i.ext "$i.name" ## sys.argv[9,10,11] modulo 3 | |
| 29 #end for | |
| 30 #silent plottingoption = $plotting.plottingOption | |
| 31 </command> | |
| 32 <inputs> | |
| 33 <conditional name="refGenomeSource"> | |
| 34 <param name="genomeSource" type="select" label="Will you select a reference genome from your history or use a built-in index?" help="Built-ins were indexed using default options"> | |
| 35 <option value="indexed">Use a built-in index</option> | |
| 36 <option value="history">Use one from the history</option> | |
| 37 </param> | |
| 38 <when value="indexed"> | |
| 39 <param name="input_list" type="data" label="Select multiple alignments to parse" multiple="true"> | |
| 40 <validator type="dataset_metadata_in_data_table" table_name="bowtie_indexes" metadata_name="dbkey" metadata_column="0" message="database not set for this bowtie output. Select the database(=genome used for matching) manually, or select a reference fasta from your history."/> | |
| 41 </param> | |
| 42 </when> | |
| 43 <when value="history"> | |
| 44 <param name="input_list" type="data" label="Select multiple alignments to parse" multiple="true"/> | |
| 45 <param name="ownFile" type="data" format="fasta" label="Select the fasta reference" /> | |
| 46 </when> | |
| 47 </conditional> <!-- refGenomeSource --> | |
| 48 <param name="GFF3" type="data" label="miRbase GFF3 guide" /> | |
| 49 <conditional name="plotting"> | |
| 50 <param name="plottingOption" type="select" label="Additional mir coverage graphs"> | |
| 51 <option value="no" selected="True">No</option> | |
| 52 <option value="yes">YES</option> | |
| 53 </param> | |
| 54 <when value="yes"> | |
| 55 <param name="display" type="select" label="Display Coverage with absolute number of reads or relatively to the total number of read matching the gene or mir"> | |
| 56 <option value="relative" selected="True">Relative Coverage</option> | |
| 57 <option value="absolute">Absolute Coverage</option> | |
| 58 </param> | |
| 59 </when> | |
| 60 </conditional> | |
| 61 </inputs> | |
| 62 <configfiles> | |
| 63 <configfile name="plotCode"> | |
| 64 #if $plotting.plottingOption == "yes": | |
| 65 graph_type = "${plotting.display}" ## "relative" or "absolute" | |
| 66 ## Setup R error handling to go to stderr | |
| 67 options( show.error.messages=F, | |
| 68 error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } ) | |
| 69 library(lattice) | |
| 70 coverage = read.delim("${lattice_dataframe}", header=T) | |
| 71 Numb_of_biosamples = length(levels(coverage\$sample)) | |
| 72 if (graph_type=="relative") { | |
| 73 graph = xyplot(countsNorm~offsetNorm | mir, data=coverage, groups=polarity, col=c("red", "blue"), type="l", lwd=1, | |
| 74 scales=list(x=list(cex=.5), y=list(cex=.5)), par.strip.text=list(cex=.5), strip=strip.custom(which.given=1, bg="lightblue"), layout=c(Numb_of_biosamples,15), as.table=TRUE, main="miRNA coverage maps") | |
| 75 } else { | |
| 76 graph = xyplot(counts~offset | mir, data=coverage, groups=polarity, col=c("red", "blue"), type="l", lwd=1, | |
| 77 scales=list(x=list(cex=.5), y=list(cex=.5)), par.strip.text=list(cex=.5), strip=strip.custom(which.given=1, bg="lightblue"), layout=c(Numb_of_biosamples,15), as.table=TRUE, main="miRNA coverage maps") | |
| 78 } | |
| 79 ## pdf output | |
| 80 pdf(file="${latticePDF}", paper="special", height=11.69, width=8.2677) | |
| 81 plot(graph, newpage = T) | |
| 82 dev.off() | |
| 83 #end if | |
| 84 </configfile> | |
| 85 </configfiles> | |
| 86 | |
| 87 <outputs> | |
| 88 <data format="tabular" name="output1" label="Premirs Count Lists"/> | |
| 89 <data format="tabular" name="output2" label="Mature Mirs Count Lists"/> | |
| 90 <data format="tabular" name="lattice_dataframe" label="Lattice Dataframe"> | |
| 91 <filter>plotting['plottingOption'] == "yes"</filter> | |
| 92 </data> | |
| 93 <data format="pdf" name="latticePDF" label="Mir coverage"> | |
| 94 <filter>plotting['plottingOption'] == "yes"</filter> | |
| 95 </data> | |
| 96 </outputs> | |
| 97 <help> | |
| 98 | |
| 99 **What it does** | |
| 100 | |
| 101 This tool uses a specie-specific GFF3 file from mirBase_ to guide the parsing of an alignment file produced with the sRbowtie tool. | |
| 102 | |
| 103 .. _mirBase: ftp://mirbase.org/pub/mirbase/CURRENT/genomes/ | |
| 104 | |
| 105 ------ | |
| 106 | |
| 107 .. class:: warningmark | |
| 108 | |
| 109 the Guide GFF3 file must be in the following format: | |
| 110 | |
| 111 2L . miRNA_primary_transcript 243035 243141 . - . ID=MI0005821;Alias=MI0005821;Name=dme-mir-965 | |
| 112 | |
| 113 2L . miRNA 243055 243076 . - . ID=MIMAT0005480;Alias=MIMAT0005480;Name=dme-miR-965-3p;Derives_from=MI0005821 | |
| 114 | |
| 115 2L . miRNA 243096 243118 . - . ID=MIMAT0020861;Alias=MIMAT0020861;Name=dme-miR-965-5p;Derives_from=MI0005821 | |
| 116 | |
| 117 2L . miRNA_primary_transcript 857542 857632 . + . ID=MI0005813;Alias=MI0005813;Name=dme-mir-375 | |
| 118 | |
| 119 2L . miRNA 857596 857617 . + . ID=MIMAT0005472;Alias=MIMAT0005472;Name=dme-miR-375-3p;Derives_from=MI0005813 | |
| 120 | |
| 121 2L . miRNA 857556 857579 . + . ID=MIMAT0020853;Alias=MIMAT0020853;Name=dme-miR-375-5p;Derives_from=MI0005813 | |
| 122 | |
| 123 2L . miRNA_primary_transcript 1831685 1831799 . - . ID=MI0011290;Alias=MI0011290;Name=dme-mir-2280 | |
| 124 | |
| 125 With name for mature miRNA (3rd column = miRNA) containing either the -3p or -5p string in the attribute Name (Name=dme-miR-965-3p, for instance) | |
| 126 | |
| 127 ------ | |
| 128 | |
| 129 **Input formats** | |
| 130 | |
| 131 1. One or sereral alignment files generated with sRbowtie tool and **renamed** according to the name of the biosample (avoid spaces in biosample labels) | |
| 132 | |
| 133 .. class:: warningmark | |
| 134 | |
| 135 Alignment datasets generated with sRbowtie must be renamed according to a biosample name | |
| 136 | |
| 137 2. A GFF3 file retrieved from mirBase_ | |
| 138 | |
| 139 ------ | |
| 140 | |
| 141 **Outputs** | |
| 142 | |
| 143 Two count list files for counts of reads aligned to pre-mir or mature miRNA | |
| 144 | |
| 145 A pdf of pre-mir coverages. Red coverages indicate that the mir gene is in the genomic up strand, blue coverages indicate that the mir gene is in the genomic down strand. | |
| 146 | |
| 147 </help> | |
| 148 </tool> |
