36 | | * ''htseq-count -f bam -m intersection-strict --stranded=reverse MySample.accepted_hits.sortedByName.bam gene_models.gtf >| MySample.counts.txt'' |
37 | | * Note that htseq-count assumes that your reads are strand-specific; default is --stranded=yes |
38 | | * If your reads are not stranded, use "--stranded=no" (or half of your reads won't be counted). If they're stranded and in the opposite direction from the transcript, use "--stranded=reverse". |
39 | | * Note the "-" can be used for input from standard input (stdin) |
40 | | * For paired-end reads the sam file has to be sorted by read name: ''bsub "samtools sort -n -o accepted_hits.sortedByName.bam -m 5G -O bam -T temp accepted_hits.bam"'' |
41 | | * To request a certain amount of memory and a specific node use ''bsub -R "rusage[mem=50000]" -m NodeName '' |
42 | | * Remove the rows at the bottom with descriptions like no_feature, ambiguous, etc. |
| 36 | |
| 37 | {{{ |
| 38 | #Note that htseq-count assumes that your reads are strand-specific; default is --stranded=yes |
| 39 | #If your reads are not stranded, use "--stranded=no" (or half of your reads won't be counted). |
| 40 | #If they're stranded and in the opposite direction from the transcript, use "--stranded=reverse". |
| 41 | |
| 42 | htseq-count -f bam -m intersection-strict --stranded=reverse MySample.accepted_hits.sortedByName.bam gene_models.gtf > MySample.counts.txt |
| 43 | |
| 44 | #Examine to see the last rows at the bottom with descriptions like no_feature, ambiguous, etc. |
| 45 | #if too many reads are thrown out. Otherwise, these rows can be removed for downstream analysis. |
| 46 | |
| 47 | #For PE reads the bam files needs to be sorted by name (default for htseq-count), eg. |
| 48 | #bsub "samtools sort -n -o accepted_hits.sortedByName.bam -m 5G -O bam -T temp accepted_hits.bam" |
| 49 | #If the bam file is sorted by coordinate you may try htseq-count -r option, eg. -r pos , however, |
| 50 | #this may not always work (htseq-count throws numerous errors). |
| 51 | |
| 52 | #To request a certain amount of memory and a specific node use bsub -R "rusage[mem=50000]" -m NodeName |
| 53 | |
| 54 | }}} |
| 55 | |