How to run HTSeq in batch operation
1
0
Entering edit mode
6.9 years ago
yangzituo • 0

Hi everyone, I am new in RNA-seq and Python. Recently, I meet a problem. When I use HTSeq to count my SAM file, I have to do it one by one. So I check in the website and someone say it can be done in batch operation. There is following commands:

for i in *.sam
do
echo $i
./local/bin/htseq-count  $i ./hg19.gtf > $i.count
done

But I cannot use it in my python. Does anyone may help me?? Thanks a lot!!!

Python HTSeq RNA-Seq • 2.5k views
ADD COMMENT
0
Entering edit mode

But I cannot use it in my python.

What does that mean?
If you get an error message, it's very helpful to share that message too.

I have also added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

ADD REPLY
0
Entering edit mode

sorry, i am new in this fiels, here is the code that guy post:

for i in *.sam:
do
echo $i
.local/bin/ht-seq-count  $i ./hg19.gtf > $i.count

But when I follow him, it stop in line 1:

the system tells me "invalid syntax"

ADD REPLY
0
Entering edit mode

That's shell scripting code, not python.

ADD REPLY
0
Entering edit mode

oh, so it cannot use in the Python?

ADD REPLY
0
Entering edit mode

I again added code formatting to your post. See my previous comment on how you can do this yourself next time.

There are a couple of things wrong with that you command.

  • There shouldn't be a : after sam
  • You didn't add done (while you did include that in the previous command)
  • It's also not sure that you htseq-count (which you spelt differently the second time) is in that location. Try which htseq-count
  • Same for your hg19.gtf. Is the path specified correctly?

You have to be quite exact when executing commands.

ADD REPLY
0
Entering edit mode

thank you. But when I wirte the first code

for i in *.sam

the python tells me that "invalid syntax"

ADD REPLY
0
Entering edit mode

That's because, as Devon said, it's not Python code. You execute it just in your terminal (assuming you are using Linux/Mac).

ADD REPLY
0
Entering edit mode
6.9 years ago

You execute it just in your terminal (assuming you are using Linux/Mac).

ADD COMMENT

Login before adding your answer.

Traffic: 1861 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