# HG changeset patch # User lparsons # Date 1354908944 18000 # Node ID 5d969cb56112172cf57c7a9d736f26073be499df # Parent 971e20519fb89481a67c97bbb84790bda089d730 Version 0.3 - paried-end sorting is now built-in (uses Picard tools) diff -r 971e20519fb8 -r 5d969cb56112 htseq-count.xml --- a/htseq-count.xml Fri Oct 26 15:57:08 2012 -0400 +++ b/htseq-count.xml Fri Dec 07 14:35:44 2012 -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 + 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. + + @@ -93,9 +108,9 @@ - - - + + + samout_conditional['samout'] @@ -107,6 +122,7 @@ + @@ -124,6 +140,14 @@ + + + + + + + +