Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • qoiopipq
    Junior Member
    • Apr 2016
    • 7

    Installing HTSeq on python (mac)

    I am trying to install HTSeq-0.6.1 on mac. I downloaded and setup python2.7 from Anaconda2, which include key packages: Numpy, Scipy, etc

    When I tried to install HTSeq on this python, it couldn't complete the installation (it stop at the step "changing mode of build/..."):

    svi-3216:HTSeq-0.6.1 aliu$ /Users/aliu/anaconda2/bin/python setup.py build
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.5-x86_64-2.7
    creating build/lib.macosx-10.5-x86_64-2.7/HTSeq
    copying HTSeq/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/HTSeq
    copying HTSeq/_HTSeq_internal.py -> build/lib.macosx-10.5-x86_64-2.7/HTSeq
    copying HTSeq/StepVector.py -> build/lib.macosx-10.5-x86_64-2.7/HTSeq
    copying HTSeq/_version.py -> build/lib.macosx-10.5-x86_64-2.7/HTSeq
    creating build/lib.macosx-10.5-x86_64-2.7/HTSeq/scripts
    copying HTSeq/scripts/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/HTSeq/scripts
    copying HTSeq/scripts/qa.py -> build/lib.macosx-10.5-x86_64-2.7/HTSeq/scripts
    copying HTSeq/scripts/count.py -> build/lib.macosx-10.5-x86_64-2.7/HTSeq/scripts
    running build_ext
    building 'HTSeq._HTSeq' extension
    creating build/temp.macosx-10.5-x86_64-2.7
    creating build/temp.macosx-10.5-x86_64-2.7/src
    gcc -fno-strict-aliasing -I/Users/aliu/anaconda2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/aliu/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/Users/aliu/anaconda2/include/python2.7 -c src/_HTSeq.c -o build/temp.macosx-10.5-x86_64-2.7/src/_HTSeq.o -w
    gcc -bundle -undefined dynamic_lookup -L/Users/aliu/anaconda2/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/src/_HTSeq.o -L/Users/aliu/anaconda2/lib -o build/lib.macosx-10.5-x86_64-2.7/HTSeq/_HTSeq.so
    building 'HTSeq._StepVector' extension
    gcc -fno-strict-aliasing -I/Users/aliu/anaconda2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/aliu/anaconda2/include/python2.7 -c src/StepVector_wrap.cxx -o build/temp.macosx-10.5-x86_64-2.7/src/StepVector_wrap.o -w
    g++ -bundle -undefined dynamic_lookup -L/Users/aliu/anaconda2/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/src/StepVector_wrap.o -L/Users/aliu/anaconda2/lib -o build/lib.macosx-10.5-x86_64-2.7/HTSeq/_StepVector.so
    running build_scripts
    creating build/scripts-2.7
    copying and adjusting scripts/htseq-qa -> build/scripts-2.7
    copying and adjusting scripts/htseq-count -> build/scripts-2.7
    changing mode of build/scripts-2.7/htseq-qa from 644 to 755
    changing mode of build/scripts-2.7/htseq-count from 644 to 755
    svi-3216:HTSeq-0.6.1 aliu$

    svi-3216:~ aliu$ ./anaconda2/bin/python
    Python 2.7.11 |Anaconda 4.0.0 (x86_64)| (default, Dec 6 2015, 18:57:58)
    [GCC 4.2.1 (Apple Inc. build 5577)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    Anaconda is brought to you by Continuum Analytics.
    Please check out: http://continuum.io/thanks and https://anaconda.org
    >>> import HTSeq
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: No module named HTSeq
    >>>

    Any suggestions would be great! Thanks!
  • wdecoster
    Member
    • Oct 2015
    • 97

    #2
    According to the website (http://www-huber.embl.de/HTSeq/doc/install.html) you have to execute the following

    python setup.py build
    sudo python setup.py install

    or to just install for you as user and not as root for all users:
    python setup.py install --user

    Comment

    • dpryan
      Devon Ryan
      • Jul 2011
      • 3478

      #3
      You can skip "python setup.py build" and just directly "python setup.py --user install" (or "pip install --user ."). The latter calls the former internally.

      Comment

      • qoiopipq
        Junior Member
        • Apr 2016
        • 7

        #4
        Thanks! Solved this by just typing "python setup.py install --user".

        Comment

        • dpryan
          Devon Ryan
          • Jul 2011
          • 3478

          #5
          BTW, since you're already using anaconda, you could also "conda install -c bioconda htseq". That'd be faster and pretty much guaranteed to work.

          Comment

          • qoiopipq
            Junior Member
            • Apr 2016
            • 7

            #6
            I tried to run htseq count (using anaconda) on one of my sorted bam files, which is around 2.2 GB, but it is very slow.... It's already been 1 day and it's still running. Can I do anything to speed up the process? Will sorting the bam file in names rather than coordinates help?

            this is the command I used:
            python /Users/aliu/anaconda2/bin/htseq-count -f bam -r pos Liver_accepted_hits_sorted.bam /Users/aliu/Mus_musculus.DEXSeq.chr.gff > liver2.txt

            and also I got this warning:
            Warning: No features of type 'exon' found.

            Thanks!

            Comment

            • dpryan
              Devon Ryan
              • Jul 2011
              • 3478

              #7
              HTSeq-count probably isn't running at all. Have a look at the GFF file, it's likely the case that the "exon" entries have been renamed "exonic_bin" or something like that, so you'll need to specify that when running htseq-count. Presuming you want these counts as input with DEXSeq, you should use the wrapper around htseq-count that comes with DEXSeq (there's a bit in the vignette about this).

              Comment

              • qoiopipq
                Junior Member
                • Apr 2016
                • 7

                #8
                I had a quick look at my GFF file, it has a column contains either "aggregate_gene" or "exonic_part", I guess "exonic_part" is the "exonic_bin" you mentioned. So I will specify it and give it a go.

                $ less genes_dexseq.gff | head
                chr1 dexseq_prepare_annotation.py aggregate_gene 3214482 3671498 . gene_id "Xkr4"
                chr1 dexseq_prepare_annotation.py exonic_part 3214482 3216968 . transcripts "NM_001011874"; exonic_part_number "001"; gene_id "Xkr4"
                chr1 dexseq_prepare_annotation.py exonic_part 3421702 3421901 . transcripts "NM_001011874"; exonic_part_number "002"; gene_id "Xkr4"
                chr1 dexseq_prepare_annotation.py exonic_part 3670552 3671498 . transcripts "NM_001011874"; exonic_part_number "003"; gene_id "Xkr4"
                chr1 dexseq_prepare_annotation.py aggregate_gene 4290846 4409241 . gene_id "Rp1"
                chr1 dexseq_prepare_annotation.py exonic_part 4290846 4293012 . transcripts "NM_001195662"; exonic_part_number "001"; gene_id "Rp1"
                chr1 dexseq_prepare_annotation.py exonic_part 4343507 4350091 . transcripts "NM_011283"; exonic_part_number "002"; gene_id "Rp1"

                Comment

                • wdecoster
                  Member
                  • Oct 2015
                  • 97

                  #9
                  Good morning. Indeed, the warning is likely your problem and you need -t exonic_part in your command. -t exon is the default, that's why htseq-count couldn't find a single feature of type 'exon'.

                  Comment

                  • qoiopipq
                    Junior Member
                    • Apr 2016
                    • 7

                    #10
                    Finally, it worked!! I used the htseq-count that comes with DEXSeq without specifying 'exonic_part'. Actually, the 3rd column in Dmel.BDGP5.25.62.DEXSeq.chr.gff (sample dataset in the vignette) contains 'exonic_part' for exons and 'aggregate_gene' for genes:

                    chr2L Drosophila_melanogaster.BDGP5.25.62.gtf.gz aggregate_gene 7529 9484 . + . gene_id "FBgn0031208"
                    chr2L Drosophila_melanogaster.BDGP5.25.62.gtf.gz exonic_part 7529 8116 . + . transcripts "FBtr0300689+FBtr0300690"; exonic_part_number "001"; gene_id "FBgn0031208"
                    chr2L Drosophila_melanogaster.BDGP5.25.62.gtf.gz exonic_part 8193 8589 . + . transcripts "FBtr0300689+FBtr0300690"; exonic_part_number "002"; gene_id "FBgn0031208"

                    So, just put in this: python ...path to dexseq/dexseq_count.py [options] annotation.gff sorted.bam output.txt

                    Cheers!

                    Comment

                    Latest Articles

                    Collapse

                    • SEQadmin2
                      Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                      by SEQadmin2


                      I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

                      Here are nine questions we think about, in roughly the order they matter, before...
                      06-18-2026, 07:11 AM
                    • SEQadmin2
                      From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
                      by SEQadmin2


                      Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


                      The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
                      ...
                      06-02-2026, 10:05 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, Today, 11:10 AM
                    0 responses
                    5 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-17-2026, 06:09 AM
                    0 responses
                    41 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-09-2026, 11:58 AM
                    0 responses
                    102 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-05-2026, 10:09 AM
                    0 responses
                    123 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...