Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • gkuffel
    Genomics Lab Mgr.
    • Oct 2012
    • 14

    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
  • wdecoster
    Member
    • Oct 2015
    • 97

    #2
    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'

    Comment

    Latest Articles

    Collapse

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by SEQadmin2, 06-09-2026, 11:58 AM
    0 responses
    30 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 06-05-2026, 10:09 AM
    0 responses
    38 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 06-04-2026, 08:59 AM
    0 responses
    42 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 06-02-2026, 12:03 PM
    0 responses
    64 views
    0 reactions
    Last Post SEQadmin2  
    Working...