SEQanswers

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 02:48 AM
htseq-count low count problem gandalf886 Bioinformatics 3 08-23-2014 07:05 AM
how to use bash script to make iterative loop through directory with two file types jddavis Bioinformatics 2 05-23-2013 07:02 AM
multiBamCov or htseq-count to count read per feature ? NicoBxl Bioinformatics 1 07-03-2012 02:05 AM
Running stampy in bash script grafab Bioinformatics 7 04-23-2012 02:00 AM

Reply
 
Thread Tools
Old 08-25-2016, 10:21 AM   #1
gkuffel
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:

#!/bin/bash

for samples in *.sam

do
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

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

Join Date: Oct 2015
Posts: 97
Default

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
Reply

Tags
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 02:48 AM.


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