Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Samtools installation using Cygwin

    I'm trying to install samtools 1.1 under Cygwin but I got the following error message. Did anyone have the same error?

    $ make
    gcc -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_CURSES_LIB=1 -I. -Ihtslib-1.1 -c -o bam_index.o bam_index.c
    Assembler messages:
    Fatal error: can't create bam_index.o: Permission denied
    Makefile:116: recipe for target 'bam_index.o' failed
    make: *** [bam_index.o] Error 1


    I'm using Windows 8, 64-bit, and Cygwin 1.7.34.

  • #2
    You may want to make a partition and dual boot Linux to save the hassle, unless you only need to perform a small set of specific operations.

    Forgive me if you are more experienced with programming, this may be exactly what you want. For a novice bioinformatician like me it seems as though navigating the data and learning how to use the tools and/or fix bugs is challenging as is. I am not sure if going through Cygwin will help with that.

    Comment


    • #3
      Some people may just use PuTTY or ssh to do data analysis on a remote machine/computing cluster.

      Comment


      • #4
        Thank you for your fast answer. I'm definitely not experienced in programming. I wonder how I could solve this error without dual booting my PC.

        Comment


        • #5
          I was able to compile samtools 0.1.19 a few months ago on windows 8.1 using MinGW to do the compilation (I don't remember what additional work it took to get going, but I seem to remember turning to MinGW when cygwin failed). That was on a work computer I didn't have the option of dual booting.
          That being said, it's a sad, lonely road trying to run any of the standard NGS tools on windows. If samtools is the only program you need, fighting windows might be worth it, but if you're planning on using any additional tools, take the pain of setting up a dual boot. Almost all of the tools are written for Linux first, and are generally easy to install and run, whereas on Windows, you often need to compile them yourself (if they even compile on Windows) and it can be really hard to find support (I've had cases recently where author supplied Windows binaries don't even start. That's about the level of thought and support put into making them Windows compatible).

          Comment


          • #6
            You can run Picard in Windows, which has most or all of the features of samtools. I prefer samtools, though. Long term, if you plan to do lots of different things with various programs, I would also recommend a dual-boot setup... it will make things a lot simpler.

            Comment


            • #7
              The specific error you get seems to be saying that you are missing write permissions in the directory you are trying to compile samtools. Anyway, I have the same opinion as the others here - trying to get high-throughput bioinformatics software packages to run under Windows is more trouble than learning to use Linux.

              If you have enough memory (4 GB would be possible, but 8+ GB better), I'd recommend you to install a virtual machine (e.g. VirtualBox) with Ubuntu (or possibly BioLinux) instead of setting up a dual boot system - saves you the reboots and even makes a bit of integration possible: I do it the other way around - Windows VM guest on a Linux host, and have it set up to open certain Microsoft office files with software within my Windows virtual machine. Getting Windows 8 to dual boot is a hassle, as well.

              Comment


              • #8
                Thank you everyone who replied. I really appreciated knowing I have some options.
                My computer is only 4 GB and unfortunately dual booting is not a option for me.
                I'll try Picard first. And then MinGW.
                As sarvidsson said I'm "missing write permissions in the directory", I moved samtools to another directory and installation went further. But, at the end I had a different error message.

                gcc: error: unrecognized command line option ‘-pthread’
                Makefile:126: recipe for target 'samtools' failed
                make: *** [samtools] Error 1

                It seems to be an endless adventure installing samtools under Cygwin. So, I'm giving up.

                Comment


                • #9
                  I just downloaded samtools 1.2 source (as bzipped tarball), decompressed and untarred

                  Then .. 2 things ....

                  #1 Change line by adding the exp and log defines ...
                  CPPFLAGS = $(DFLAGS) $(INCLUDES)
                  to
                  CPPFLAGS = $(DFLAGS) $(INCLUDES) -Dexpl=exp -Dlogl=log

                  #2 Change all instances of "-pthread" to "-lpthread"

                  Result ; It Works (at least it compiles and produces and EXE) ...

                  finneyr@NCI-01874532 /cygdrive/c/rich/samtools-1.2
                  $ ./samtools.exe

                  Program: samtools (Tools for alignments in the SAM format)
                  Version: 1.2 (using htslib 1.2.1)

                  Usage: samtools <command> [options]

                  Commands:
                  -- indexing
                  faidx index/extract FASTA
                  index index alignment
                  -- editing
                  calmd recalculate MD/NM tags and '=' bases
                  fixmate fix mate information
                  reheader replace BAM header
                  rmdup remove PCR duplicates
                  targetcut cut fosmid regions (for fosmid pool only)
                  -- file operations
                  bamshuf shuffle and group alignments by name
                  cat concatenate BAMs
                  merge merge sorted alignments
                  mpileup multi-way pileup
                  sort sort alignment file
                  split splits a file by read group
                  bam2fq converts a BAM to a FASTQ
                  -- stats
                  bedcov read depth per BED region
                  depth compute the depth
                  flagstat simple stats
                  idxstats BAM index stats
                  phase phase heterozygotes
                  stats generate stats (former bamcheck)
                  -- viewing
                  flags explain BAM flags
                  tview text alignment viewer
                  view SAM<->BAM<->CRAM conversion


                  ______




                  Compiling under Visual C is another story; I've done by hacking the code on earlier samtools.
                  Last edited by Richard Finney; 02-06-2015, 01:58 PM.

                  Comment


                  • #10
                    Hi Richard Finney,
                    Thank you for your help! I downloaded samtools-1.2 as you recommended. It’s written in my original Makefile:
                    CC = gcc
                    CPPFLAGS = $(DFLAGS) $(INCLUDES)
                    CFLAGS = -g -Wall -O2
                    LDFLAGS =
                    LDLIBS =
                    DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_CURSES_LIB=1

                    So, I changed CPPFLAGS to:
                    CPPFLAGS = -Dexpl=exp -Dlogl=log
                    But, when I changed "-pthread" to "-lpthread" I had an error message:

                    $ make
                    Makefile:126: *** separator missing. Stop.
                    Last edited by Karina Martins; 02-06-2015, 05:23 PM.

                    Comment


                    • #11
                      I made a mistake; I miscopied and didn't proofread.

                      See edit in previous post ... previous post is now edited.

                      CPPFLAGS = $(DFLAGS) $(INCLUDES)

                      should be

                      CPPFLAGS = $(DFLAGS) $(INCLUDES) -Dexpl=exp -Dlogl=log


                      Note added "-Dexpl=exp -Dlogl=log"
                      Last edited by Richard Finney; 02-06-2015, 02:01 PM.

                      Comment


                      • #12
                        Thank you, Richard
                        I tried, but it's still not working. Now, I'm having a bunch of other errors.
                        The first one is:

                        bedidx.o: In function `bed_read':
                        /cygdrive/c/samtools-1.2/bedidx.c:170: undefined reference to `gzopen'
                        /cygdrive/c/samtools-1.2/bedidx.c:170.text+0xec4): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `gzopen'

                        It's followed by dozens of other 'undefined reference to'
                        I searched similar errors in the web, but couldn't fix those errors.

                        Comment


                        • #13
                          Try the solution here: http://stackoverflow.com/questions/1...-to-gzopen-etc

                          Edit the makefile.

                          Comment


                          • #14
                            All -lz comes after the lists of objects in my Makefile...

                            Comment

                            Latest Articles

                            Collapse

                            • seqadmin
                              Advancing Precision Medicine for Rare Diseases in Children
                              by seqadmin




                              Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
                              12-16-2024, 07:57 AM
                            • seqadmin
                              Recent Advances in Sequencing Technologies
                              by seqadmin



                              Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.

                              Long-Read Sequencing
                              Long-read sequencing has seen remarkable advancements,...
                              12-02-2024, 01:49 PM

                            ad_right_rmr

                            Collapse

                            News

                            Collapse

                            Topics Statistics Last Post
                            Started by seqadmin, 12-17-2024, 10:28 AM
                            0 responses
                            26 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 12-13-2024, 08:24 AM
                            0 responses
                            42 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 12-12-2024, 07:41 AM
                            0 responses
                            28 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 12-11-2024, 07:45 AM
                            0 responses
                            42 views
                            0 likes
                            Last Post seqadmin  
                            Working...
                            X