SEQanswers

Go Back   SEQanswers > Applications Forums > RNA Sequencing



Similar Threads
Thread Thread Starter Forum Replies Last Post
HTSeq install fatakias Bioinformatics 12 11-12-2015 07:22 AM
htseq-count paolo.kunder Bioinformatics 10 10-22-2014 04:45 AM
Problem using HTSeq pinki999 Bioinformatics 4 10-23-2012 09:40 PM
help with HTSeq installation madhuk11 Bioinformatics 4 06-07-2012 10:04 AM
in HTSeq example, pyplot hibachings2013 RNA Sequencing 0 06-29-2011 05:38 AM

Reply
 
Thread Tools
Old 06-08-2012, 03:10 PM   #1
wangli
Member
 
Location: Texas

Join Date: Apr 2012
Posts: 48
Default HTSeq errors

Hi, dear patrons

i had an error when running HT-seq in python.

******$ python
Python 2.6.1 (r261:67515, Aug 2 2010, 20:10:18)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import HTSeq
>>> import numpy
>>> htseq-count --mode=intersection-nonempty CAR01_tophatHits_sorted.bam merged.gtf >> CAR01_gene_counts.txt
File "<stdin>", line 1
htseq-count --mode=intersection-nonempty CAR01_tophatHits_sorted.bam merged.gtf >> CAR01_gene_counts.txt
^
SyntaxError: invalid syntax

i cannot figure out the problem. Can anyone give me some suggestions and hints?

I will appreciated it a lot.

Best wishes
Li
wangli is offline   Reply With Quote
Old 06-08-2012, 11:12 PM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Try executing the htseq-count command from the command line rather than within python.
dpryan is offline   Reply With Quote
Old 06-09-2012, 10:08 AM   #3
wangli
Member
 
Location: Texas

Join Date: Apr 2012
Posts: 48
Default

Thanks, dpryan!

I made a file named as htseq_count.py and then execute it in the terminal.

The content of the file is as follows:
#!/usr/bin/python2.6 -tt

import numpy
import HTSeq

htseq-count --mode=intersection-nonempty /users/shared/HTSeq/CAR01_tophatHits_sorted.bam /users/shared/HTSeq/merged.gtf >> CAR01_gene_count.txt

But I still got errors shown here:
File "./htseq_count.py", line 6
htseq-count --mode=intersection-nonempty /users/shared/HTSeq/CAR01_tophatHits_sorted.bam /users/shared/HTSeq/merged.gtf >> CAR01_gene_count.txt
SyntaxError: can't assign to operator

It seems that python cannot find htseq-count. In python shell, i typed dir(HTSeq) and didnot find "htseq-count".

It is my first experience with python. Sorry for my naive questions. Can someone point out my error? Thanks!
wangli is offline   Reply With Quote
Old 06-09-2012, 02:44 PM   #4
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

Don't bother with python, execute the command directly in the shell. No shell scripting, nothing like that. Just open a terminal and type:
Code:
htseq-count --mode=intersection-nonempty /users/shared/HTSeq/CAR01_tophatHits_sorted.bam /users/shared/HTSeq/merged.gtf > CAR01_gene_count.txt
from an appropriate location.
dpryan is offline   Reply With Quote
Old 06-09-2012, 02:55 PM   #5
wangli
Member
 
Location: Texas

Join Date: Apr 2012
Posts: 48
Default

Thanks a lot, dpryan! It works!
wangli is offline   Reply With Quote
Reply

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 11:58 AM.


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