# HG changeset patch # User Dave Bouvier # Date 1390849966 18000 # Node ID 3ffe4e2572a742b9573f5cec44ac3b412e1de8a6 # Parent 265ca0f35789ba11dfb0855395d153db39c6df1e# Parent 55bd18f8429c75a43ebdbbffd59f919e2b779ac4 Merge multiple heads. diff -r 55bd18f8429c -r 3ffe4e2572a7 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Mon Jan 27 14:12:46 2014 -0500 @@ -0,0 +1,3 @@ +^package$ +syntax: glob +*.pyc diff -r 55bd18f8429c -r 3ffe4e2572a7 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags Mon Jan 27 14:12:46 2014 -0500 @@ -0,0 +1,3 @@ +142ec9462fa644cd29642ea0ad10e9889ce75619 0.3 +3e7b1e8a69f9d79b8de603f24e466deb7b192100 0.3.release2 +496a7dc0786f8367264520dfff6e8e8e744de3b2 0.3.1 diff -r 55bd18f8429c -r 3ffe4e2572a7 README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Mon Jan 27 14:12:46 2014 -0500 @@ -0,0 +1,51 @@ +htseq-count wrapper for Galaxy +============================== + +Galaxy wrapper for +[htseq-count](http://www-huber.embl.de/users/anders/HTSeq/doc/count.html) +script from python +[HTSeq](http://www-huber.embl.de/users/anders/HTSeq/doc/index.html) package. + +Installation +------------ + +Installtion directly from the [Galaxy +Toolshed](http://toolshed.g2.bx.psu.edu/view/lparsons/htseq_count) is +recommended. + +Development +----------- + +Repository-Maintainer: Lance Parsons + +Repository-Development: + + +License +------- + +Copyright (c) 2012-2013, Lance R. Parsons +All rights reserved. + +Licensed under the BSD 2-Clause License: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -r 55bd18f8429c -r 3ffe4e2572a7 fabfile.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fabfile.py Mon Jan 27 14:12:46 2014 -0500 @@ -0,0 +1,26 @@ +from fabric.api import local +from fabric.operations import prompt +import os + + +def package(): + ''' + Pacakge for upload to toolshed + packaging 'test' version (default) uses local directory + otherwise, specify a mercurial tag to package + ''' + package_dir = 'package' + base_filename = os.path.join(package_dir, 'htseq-count') + version = prompt("Enter version number for package [test]:") + revision_option = '' + if version != '': + revision_option = '-r "%s"' % version + else: + version = 'test' + version_filename = '%s_%s.tar.gz' % (base_filename, version) + local('mkdir -p %s' % package_dir) + local('rm -f %s' % version_filename) + if version == 'test': + local('tar czvf %s --exclude "fabfile.*" --exclude "%s" --exclude ".hg*" *' % (version_filename, package_dir)) + else: + local('hg archive -t tgz %s -X "fabfile.*" -X "package" -X ".hg*" -p . "%s"' % (revision_option, version_filename)) diff -r 55bd18f8429c -r 3ffe4e2572a7 htseq-count.xml --- a/htseq-count.xml Fri Sep 21 17:45:33 2012 -0400 +++ b/htseq-count.xml Mon Jan 27 14:12:46 2014 -0500 @@ -1,10 +1,11 @@ - + - Count aligned reads in a BAM file that overlap features in a GFF file htseq-count -h | grep version | sed 's/^\(.*\)*\(version .*\)\./\2/' - numpy - htseq - samtools + numpy + htseq + samtools + picard ##set up input files @@ -17,9 +18,16 @@ #set $reference_fasta_filename = str( $samout_conditional.reference_source.ref_file.fields.path ) #end if #end if - - #if $samfile.extension == "bam": - samtools view $samfile | + #if str($singlepaired) == "paired": + ln -s $samfile local_input.sam && + java -Xmx2G -jar "\$JAVA_JAR_PATH/SortSam.jar" VALIDATION_STRINGENCY=LENIENT SORT_ORDER=queryname O=prepared_input.sam I=local_input.sam TMP_DIR="${__new_file_path__}" + || echo "Error running Picard MergeSamFiles" >&2 && + #else: + #if $samfile.extension == "bam": + samtools view $samfile | + #else + ln -s $samfile prepared_input.sam && + #end if #end if htseq-count --mode=$mode @@ -30,19 +38,26 @@ #if $samout_conditional.samout: --samout=$__new_file_path__/${samoutfile.id}_tmp #end if - #if $samfile.extension == "bam": - - - #else - $samfile - #end if + #if str($singlepaired) == "paired": + prepared_input.sam + #else: + #if $samfile.extension == "bam": + - + #else: + prepared_input.sam + #end if + #end if $gfffile | awk '{if ($1 ~ "no_feature|ambiguous|too_low_aQual|not_aligned|alignment_not_unique") print $0 | "cat 1>&2"; else print $0}' > $counts 2>$othercounts #if $samout_conditional.samout: && samtools view -Su -t ${reference_fasta_filename}.fai $__new_file_path__/${samoutfile.id}_tmp | samtools sort -o - sorted > $samoutfile #end if - - Paired-End data MUST be sorted by QUERY NAME, use "NGS: Picard - Paired Read Mate Fixer" to sort by QUERY NAME and output to SAM (not BAM) before using this tool on paired data. + + + Paired libraries will be sorted by read name prior to counting. + + @@ -79,7 +94,7 @@ - + @@ -93,9 +108,9 @@ - - - + + + samout_conditional['samout'] @@ -107,6 +122,7 @@ + @@ -124,6 +140,14 @@ + + + + + + + + + + + + + + $INSTALL_DIR/lib/python + $INSTALL_DIR/lib64/python + export PYTHONPATH=$PYTHONPATH:$INSTALL_DIR/lib/python:$INSTALL_DIR/lib64/python && python setup.py install --home $INSTALL_DIR --install-scripts $INSTALL_DIR/bin + + $INSTALL_DIR/lib/python:$INSTALL_DIR/lib64/python + $INSTALL_DIR/bin + + + + + Installation of HTSeq requires Python 2.5+ (does not yet work with Python 3), and the Nympy Python package. + + + +