Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTseq - count - high ambiguous count rate and reads with missing mate encountered 4galaxy7 Bioinformatics 0 12-14-2015 03:48 AM
htseq-count low count problem gandalf886 Bioinformatics 3 08-23-2014 08:05 AM
how to use bash script to make iterative loop through directory with two file types jddavis Bioinformatics 2 05-23-2013 08:02 AM
multiBamCov or htseq-count to count read per feature ? NicoBxl Bioinformatics 1 07-03-2012 03:05 AM
Running stampy in bash script grafab Bioinformatics 7 04-23-2012 03:00 AM

Thread Tools
Old 08-25-2016, 11:21 AM   #1
Genomics Lab Mgr.
Location: Chicago

Join Date: Oct 2012
Posts: 14
Default Bash script to automate htseq-count

Hi everyone-

I am trying to write a script to automate htseq-count on a large number of samples. The script runs but then throws the following error: "Please provide 2 arguments". Does anyone see something obvious I am missing:


for samples in *.sam

gtf = "Galaxy135-\[Escherichia_coli_str_k_12_substr_mg1655.GCA_000005845.2.29.gtf\].gtf"
echo $sample
describer=$(echo ${sample} | sed 's/.sam//')
echo $describer

htseq-count -m union -r pos -i gene_name -a 10 ${describer}.sam $gtf > ${describer}.counts

gkuffel is offline   Reply With Quote
Old 08-25-2016, 01:18 PM   #2
Location: Antwerp, Belgium

Join Date: Oct 2015
Posts: 97

I would advice using gnu parallel, with a command like this:

find . -name '*.bam' | parallel 'htseq-count -f bam -q -t gene -i gene_id {} pathtoyourgtf.gtf > {.}.counts'
wdecoster is offline   Reply With Quote

bash, htseq count, htseq-count dexseq, python

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -8. The time now is 03:39 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO