problem use htseq-count in bash script
1
0
Entering edit mode
3.4 years ago
o.omidan ▴ 10

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.

htseq-count script • 1.8k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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 REPLY
0
Entering edit mode

I pass SRR5122422 as argument to script

./myscript.sh SRR5122422

ADD REPLY
1
Entering edit mode
3.4 years ago
o.omidan ▴ 10

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 COMMENT
0
Entering edit mode

so, it was the path ;)

ADD REPLY

Login before adding your answer.

Traffic: 2861 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6