Question: problem use htseq-count in bash script
0
gravatar for o.omidan
8 weeks ago by
o.omidan10
o.omidan10 wrote:

Hi I write an bash script to automate my workflow. but the count section not work and throw this error. I can not figure it out why exact same command run from console is ok but has error in script

CMD="${PYTHON_EXE} -m HTSeq.scripts.count -i gene_name -r name ${1}_sort.sam ${ANNOT_PATH} >${COUNT_PATH}${1}.count"

echo Running $CMD

if  $CMD ; then
    echo "${GREEN}Counting done${NC}"
else
    echo "${RED}Counting failed; see htseq-count error message${NC}"
fi

it generate the command like:

/usr/bin/python3 -m HTSeq.scripts.count -i gene_name -r name /home/user/bin/SRR5122422_sort.sam /home/user/bin/GRCh37.87.gtf >/mnt/disk2/Count_Files/SRR5122422.count

and the error is:

file does not contain alignment data
  [Exception type: ValueError, raised in libcalignmentfile.pyx:947]

use "htseq-count" or "/usr/bin/python3 -m HTSeq.scripts.count" generate same error. the path for sam and gtf file is ok.

script htseq-count • 160 views
ADD COMMENTlink modified 8 weeks ago • written 8 weeks ago by o.omidan10

I guess there is something with your SAM file, check if the format is correct

ADD REPLYlink written 8 weeks ago by JC12k

if I copy and past the generated command in console it run without any error. so I think file is ok

ADD REPLYlink written 8 weeks ago by o.omidan10
1

in your bash script, how the path for the SAM file is being generated? I see /home/user/bin/ but you are using just ${1} which I guess is just SRR5122422

ADD REPLYlink written 8 weeks ago by JC12k

I pass SRR5122422 as argument to script

./myscript.sh SRR5122422

ADD REPLYlink written 8 weeks ago by o.omidan10
1
gravatar for o.omidan
8 weeks ago by
o.omidan10
o.omidan10 wrote:

ok . it work after I edit like this

CMD="${PYTHON_EXE} -m HTSeq.scripts.count -i gene_name -r name ${1}_sort.sam ${ANNOT_PATH} "

echo Running $CMD

if  $CMD >${COUNT_PATH}${1}.count; then
    echo "${GREEN}Counting done${NC}"
else
    echo "${RED}Counting failed; see htseq-count error message${NC}"
fi
ADD COMMENTlink modified 8 weeks ago • written 8 weeks ago by o.omidan10

so, it was the path ;)

ADD REPLYlink written 8 weeks ago by JC12k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1752 users visited in the last hour
_