Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • #16
    Thanks GenoMax,

    Please take a look at this.
    The following is the listing of files shown in the directory.

    ADMIN@USER ~
    $ ls -1 samtools-0.1.19
    AUTHORS
    bam.c
    bam.h
    bam.h~
    bam.o
    bam_aux.c
    bam_aux.o
    bam_cat.c
    bam_cat.o
    bam_color.c
    bam_color.o
    bam_endian.h
    bam_import.c
    bam_import.o
    bam_index.c
    bam_index.o
    bam_lpileup.c
    bam_lpileup.o
    bam_mate.c
    bam_mate.o
    bam_md.c
    bam_md.o
    bam_pileup.c
    bam_pileup.o
    bam_plcmd.c
    bam_plcmd.o
    bam_reheader.c
    bam_reheader.o
    bam_rmdup.c
    bam_rmdup.o
    bam_rmdupse.c
    bam_rmdupse.o
    bam_sort.c
    bam_sort.o
    bam_stat.c
    bam_stat.o
    bam_tview.c
    bam_tview.h
    bam_tview.o
    bam_tview_curses.c
    bam_tview_curses.o
    bam_tview_html.c
    bam_tview_html.o
    bam2bcf.c
    bam2bcf.h
    bam2bcf.o
    bam2bcf_indel.c
    bam2bcf_indel.o
    bam2depth.c
    bam2depth.o
    bamshuf.c
    bamshuf.o
    bamtk.c
    bamtk.o
    bcftools
    bedcov.c
    bedcov.o
    bedidx.c
    bedidx.o
    bgzf.c
    bgzf.h
    bgzf.o
    bgzip.c
    ChangeLog.old
    COPYING
    cut_target.c
    cut_target.o
    errmod.c
    errmod.h
    errmod.o
    examples
    faidx.c
    faidx.h
    faidx.o
    INSTALL
    kaln.c
    kaln.h
    kaln.o
    khash.h
    klist.h
    knetfile.c
    knetfile.h
    knetfile.o
    kprobaln.c
    kprobaln.h
    kprobaln.o
    kseq.h
    ksort.h
    kstring.c
    kstring.h
    kstring.o
    libbam.a
    Makefile
    Makefile.mingw
    misc
    NEWS
    padding.c
    padding.o
    phase.c
    phase.o
    razf.c
    razf.h
    razf.o
    razip.c
    sam.c
    sam.h
    sam.o
    sam_header.c
    sam_header.h
    sam_header.o
    sam_view.c
    sam_view.o
    sample.c
    sample.h
    sample.o
    samtools.1
    win32
    Last edited by nuseqr; 03-25-2014, 10:43 PM.

    Comment


    • #17
      Based on this listing samtools executable does not seem to be in this directory. Is it in win32 (I assume that is a directory)?

      Comment


      • #18
        No it was not in the Win32 folder. I instead copied a samtools.exe file in to the samtools-0.1.19 directory.

        Then typed
        ADMIN@USER ~
        $ cd samtools-0.1.19

        ADMIN@USER ~/samtools-0.1.19
        $ ./samtools

        then the following was listed

        Program: samtools (Tools for alignments in the SAM format)
        Version: 0.1.18 (r982:295)

        Usage: samtools <command> [options]

        Command: view SAM<->BAM conversion
        sort sort alignment file
        mpileup multi-way pileup
        depth compute the depth
        faidx index/extract FASTA
        tview text alignment viewer
        index index alignment
        idxstats BAM index stats (r595 or later)
        fixmate fix mate information
        flagstat simple stats
        calmd recalculate MD/NM tags and '=' bases
        merge merge sorted alignments
        rmdup remove PCR duplicates
        reheader replace BAM header
        cat concatenate BAMs
        targetcut cut fosmid regions (for fosmid pool only)
        phase phase heterozygotes

        Comment


        • #19
          Looks like you are all set.

          Comment


          • #20
            Hello,

            I need to use Samtools to create bam index files so that I can use
            IGV to look at DNA bam files.

            OK, I am not clued up at all in UNIX so naturally, as a Samtools installation does not seem to run smoothly, I am having some trouble.

            I have read as best as I can and have installed Cygwin, downloaded Samtool-0.1.19 and used the following commands:-

            tar xvjf samtools-0.1.19.tar.bz2
            cd samtools-0.1.19
            make

            Initially I had the problem of a missing zlib but I have gone back to Cygwin and added that package.

            Now when I issue the command "make" I get the following errors:-
            $ make
            make[1]: Entering directory '/cygdrive/c/Sam/samtools-0.1.19'
            make[2]: Entering directory '/cygdrive/c/Sam/samtools-0.1.19'
            make[2]: Nothing to be done for 'lib'.
            make[2]: Leaving directory '/cygdrive/c/Sam/samtools-0.1.19'
            make[2]: Entering directory '/cygdrive/c/Sam/samtools-0.1.19/bcftools'
            make[2]: Nothing to be done for 'lib'.
            make[2]: Leaving directory '/cygdrive/c/Sam/samtools-0.1.19/bcftools'
            make[2]: Entering directory '/cygdrive/c/Sam/samtools-0.1.19/misc'
            make[2]: Nothing to be done for 'lib'.
            make[2]: Leaving directory '/cygdrive/c/Sam/samtools-0.1.19/misc'
            gcc -c -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_tview_curses.c -o bam_tview_curses.o
            bam_tview_curses.c:5:20: fatal error: curses.h: No such file or directory
            #include <curses.h>
            ^
            compilation terminated.
            Makefile:24: recipe for target 'bam_tview_curses.o' failed
            make[1]: *** [bam_tview_curses.o] Error 1
            make[1]: Leaving directory '/cygdrive/c/Sam/samtools-0.1.19'
            Makefile:27: recipe for target 'all-recur' failed
            make: *** [all-recur] Error 1


            I have gone looking for curses.h in Cygwin but it does not appear to be there.

            Also, I have three Makefile files in differnt directories, but they do not have
            CFALGS or DFLAGS. ( It had been suggested that the makefile need modifying.)

            May I ask what I should do next.

            Thanks in anticipation

            Comment


            • #21
              Seems you're still missing the ncurses library.

              On ubuntu-based system you'd just do:
              Code:
              sudo apt-get install libncurses5-dev libncursesw5-dev
              But Cygwin is a little different...

              Googling it up did turn up a few posts on this matter:
              http://sourceforge.net/p/samtools/ma...ail.gmail.com/

              http://www.cygwin.com/ml/cygwin-anno.../msg00124.html

              You can go for either one... The first one shows you how to compile without the ncurses library, and the other one gives you steps on how to install the library on Cygwin.

              Comment


              • #22
                Originally posted by Cytosine View Post
                Seems you're still missing the ncurses library.

                On ubuntu-based system you'd just do:
                Code:
                sudo apt-get install libncurses5-dev libncursesw5-dev
                But Cygwin is a little different...

                Googling it up did turn up a few posts on this matter:
                http://sourceforge.net/p/samtools/ma...ail.gmail.com/

                http://www.cygwin.com/ml/cygwin-anno.../msg00124.html

                You can go for either one... The first one shows you how to compile without the ncurses library, and the other one gives you steps on how to install the library on Cygwin.
                I have had a look at both the links, thank you Cytosine ...

                The second link is quite old, 2001, and while I can find the ncurses package and have installed it, the second part, terminfo package is there but there appears to be no libncurses5 or libncurses6 packages available. I see libncurses10 is already installed, and 7, 8 and 9 available. I did not install these.

                I still got errors on 'make'

                Then I tried changing the parameters in the 'makefile' file as suggested by the first link but it still would not install with 'make'

                My current errors are:-
                $ make
                make[1]: Entering directory '/cygdrive/c/sam/samtools-0.1.19'
                make[2]: Entering directory '/cygdrive/c/sam/samtools-0.1.19'
                make[2]: Nothing to be done for 'lib'.
                make[2]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19'
                make[2]: Entering directory '/cygdrive/c/sam/samtools-0.1.19/bcftools'
                make[2]: Nothing to be done for 'lib'.
                make[2]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19/bcftools'
                make[2]: Entering directory '/cygdrive/c/sam/samtools-0.1.19/misc'
                make[2]: Nothing to be done for 'lib'.
                make[2]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19/misc'
                gcc -I/usr/include/ncurses -o samtools bam_tview.o bam_plcmd.o sam_view.o bam_rmdup.o bam_rmdupse.o bam_mate.o bam_stat.o bam_color.o bamtk.o kaln.o bam2bcf.o bam2bcf_indel.o errmod.o sample.o cut_target.o phase.o bam2depth.o padding.o bedcov.o bamshuf.o bam_tview_curses.o bam_tview_html.o libbam.a -Lbcftools -lbcf -lcurses -lm -lz -lpthread
                /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lcurses
                collect2: error: ld returned 1 exit status
                Makefile:48: recipe for target 'samtools' failed
                make[1]: *** [samtools] Error 1
                make[1]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19'
                Makefile:28: recipe for target 'all-recur' failed
                make: *** [all-recur] Error 1

                Any other thoughts?
                Can Samtools be installed in a Windows 32 bit environment?

                Comment


                • #23
                  From what I see in the error report you did not make the proper adjustments in the Makefile.

                  Did you set -D_CURSES_LIB=1 to -D_CURSES_LIB=0 ?

                  and added the "#" in the following line?
                  LIBCURSES= -lcurses # -lXCurses --> LIBCURSES="" #-lcurses # -lXCurses

                  You need to disable both searching for and linking the library if you want to remove it from the final executable.


                  Give this another try and show me the report then.

                  Comment


                  • #24
                    I tend to return files to their original format when something does not work, otherwise we don't know what is going on.

                    However, with the first part of my makefile :-

                    CC= gcc
                    CFLAGS= -g -Wall -O2 #-m64 #-arch ppc
                    CFLAGS= -I/usr/include/ncurses
                    #LDFLAGS= -Wl,-rpath,\$$ORIGIN/../lib
                    DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=0
                    KNETFILE_O= knetfile.o
                    LOBJS= bgzf.o kstring.o bam_aux.o bam.o bam_import.o sam.o bam_index.o \
                    bam_pileup.o bam_lpileup.o bam_md.o razf.o faidx.o bedidx.o \
                    $(KNETFILE_O) bam_sort.o sam_header.o bam_reheader.o kprobaln.o bam_cat.o
                    AOBJS= bam_tview.o bam_plcmd.o sam_view.o \
                    bam_rmdup.o bam_rmdupse.o bam_mate.o bam_stat.o bam_color.o \
                    bamtk.o kaln.o bam2bcf.o bam2bcf_indel.o errmod.o sample.o \
                    cut_target.o phase.o bam2depth.o padding.o bedcov.o bamshuf.o \
                    bam_tview_curses.o bam_tview_html.o
                    PROG= samtools
                    INCLUDES= -I.
                    SUBDIRS= . bcftools misc
                    LIBPATH=
                    LIBCURSES= # -lcurses # -lXCurses
                    etc etc

                    When I run 'make', the error report is:-

                    $ make
                    make[1]: Entering directory '/cygdrive/c/sam/samtools-0.1.19'
                    make[2]: Entering directory '/cygdrive/c/sam/samtools-0.1.19'
                    make[2]: Nothing to be done for 'lib'.
                    make[2]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19'
                    make[2]: Entering directory '/cygdrive/c/sam/samtools-0.1.19/bcftools'
                    make[2]: Nothing to be done for 'lib'.
                    make[2]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19/bcftools'
                    make[2]: Entering directory '/cygdrive/c/sam/samtools-0.1.19/misc'
                    make[2]: Nothing to be done for 'lib'.
                    make[2]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19/misc'
                    gcc -I/usr/include/ncurses -o samtools bam_tview.o bam_plcmd.o sam_view.o bam_rmdup.o bam_rmdupse.o bam_mate.o bam_stat.o bam_color.o bamtk.o kaln.o bam2bcf.o bam2bcf_indel.o errmod.o sample.o cut_target.o phase.o bam2depth.o padding.o bedcov.o bamshuf.o bam_tview_curses.o bam_tview_html.o libbam.a -Lbcftools -lbcf -lm -lz -lpthread
                    errmod.o:errmod.c: (.text+0xd96): undefined reference to `expl'
                    errmod.o:errmod.c: (.text+0xdbe): undefined reference to `logl'
                    collect2: error: ld returned 1 exit status
                    Makefile:48: recipe for target 'samtools' failed
                    make[1]: *** [samtools] Error 1
                    make[1]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19'
                    Makefile:28: recipe for target 'all-recur' failed
                    make: *** [all-recur] Error 1

                    Looks like the lcurses problem is fixed but now we have undefined references to expl and logl.

                    Do you thoughts on these?

                    Comment


                    • #25
                      A little further info;
                      If I do a 'make clean', then a 'make', I get the more explanatory errors:-

                      prob1.c: In function ‘mc_cal_y’:
                      prob1.c:774:7: warning: incompatible implicit declaration of built-in function ‘ expl’ [enabled by default]
                      x = expl(ma->t - (ma->t1 + ma->t2));

                      errmod.c: In function ‘cal_coef’:
                      errmod.c:44:18: warning: incompatible implicit declaration of built-in function ‘expl’ [enabled by default]
                      sum = sum1 + expl(lC[n<<8|k] + k*le + (n-k)*le1);
                      ^
                      errmod.c:45:31: warning: incompatible implicit declaration of built-in function ‘logl’ [enabled by default]
                      beta[k] = -10. / M_LN10 * logl(sum1 / sum);

                      errmod.o:errmod.c: (.text+0xd96): undefined reference to `expl'
                      errmod.o:errmod.c: (.text+0xdbe): undefined reference to `logl'
                      collect2: error: ld returned 1 exit status


                      Does this help?

                      Comment


                      • #26
                        Undefined reference would probably mean you unlinked a library too much.
                        I suggest you try to modify the makefile like this now: (keep the 2 changes you made before)

                        - Put a "#" before CFLAGS
                        - Delete the # before LDFLAGS

                        CC= gcc
                        CFLAGS= -g -Wall -O2 #-m64 #-arch ppc
                        #CFLAGS= -I/usr/include/ncurses
                        LDFLAGS= -Wl,-rpath,\$$ORIGIN/../lib
                        DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=0
                        KNETFILE_O= knetfile.o

                        That will basically remove any reference to ncurses and will link back the libraries that possibly contain the 'expl' and 'logl' functions.

                        What does make tell you after this?

                        Comment


                        • #27
                          Thank you Cytosine for taking the time to help me with this, I much appreciate it.

                          I added the # before the second CFLAGS, (I am guessing the first CFLAGS parameters are needed), and deleted it from the LDFLAGS, so the first couple of lines of 'Makefile' now read:-

                          CC= gcc
                          CFLAGS= -g -Wall -O2 #-m64 #-arch ppc
                          # CFLAGS= -I/usr/include/ncurses
                          LDFLAGS= -Wl,-rpath,\$$ORIGIN/../lib
                          DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=0

                          However when I run 'make' I am still getting the same errors:-

                          $ make
                          make[1]: Entering directory '/cygdrive/c/sam/samtools-0.1.19'
                          make[2]: Entering directory '/cygdrive/c/sam/samtools-0.1.19'
                          make[2]: Nothing to be done for 'lib'.
                          make[2]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19'
                          make[2]: Entering directory '/cygdrive/c/sam/samtools-0.1.19/bcftools'
                          make[2]: Nothing to be done for 'lib'.
                          make[2]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19/bcftools'
                          make[2]: Entering directory '/cygdrive/c/sam/samtools-0.1.19/misc'
                          make[2]: Nothing to be done for 'lib'.
                          make[2]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19/misc'
                          gcc -g -Wall -O2 -o samtools bam_tview.o bam_plcmd.o sam_view.o bam_rmdup.o bam_rmdupse.o bam_mate.o bam_stat.o bam_color.o bamtk.o kaln.o bam2bcf.o bam2bcf_indel.o errmod.o sample.o cut_target.o phase.o bam2depth.o padding.o bedcov.o bamshuf.o bam_tview_curses.o bam_tview_html.o -Wl,-rpath,\$ORIGIN/../lib libbam.a -Lbcftools -lbcf -lm -lz -lpthread
                          errmod.o: In function `cal_coef':
                          /cygdrive/c/sam/samtools-0.1.19/errmod.c:44: undefined reference to `expl'
                          /cygdrive/c/sam/samtools-0.1.19/errmod.c:45: undefined reference to `logl'
                          collect2: error: ld returned 1 exit status
                          Makefile:48: recipe for target 'samtools' failed
                          make[1]: *** [samtools] Error 1
                          make[1]: Leaving directory '/cygdrive/c/sam/samtools-0.1.19'
                          Makefile:28: recipe for target 'all-recur' failed
                          make: *** [all-recur] Error 1

                          Hmmmmm.... not any better!

                          Comment


                          • #28
                            That's odd... The expl and logl function declarations are in math.h, which you are including in your makefile.

                            Did you do make clean after each try? Could be some code got compiled without it and make does not register it.

                            Comment


                            • #29
                              I was thinking I needed some maths library so installed gmp, libgmp and libgmp3 but identical error to above.

                              Edit, yes I did a make clean then make each time.

                              I don't see math.h in my 'makefile' Can you give me a line to add please?
                              Last edited by Scorpion43; 08-03-2014, 11:35 PM. Reason: messages crossed

                              Comment


                              • #30
                                There is an old post about this same problem on this forum: link

                                There it is proposed to rename the functions in the DFLAGS line in the makefile:

                                DFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=0 -Dexpl=exp -Dlogl=log


                                Try this and if it still doesn't work go consult the forum thread in the link.

                                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
                                33 views
                                0 likes
                                Last Post seqadmin  
                                Started by seqadmin, 12-13-2024, 08:24 AM
                                0 responses
                                49 views
                                0 likes
                                Last Post seqadmin  
                                Started by seqadmin, 12-12-2024, 07:41 AM
                                0 responses
                                34 views
                                0 likes
                                Last Post seqadmin  
                                Started by seqadmin, 12-11-2024, 07:45 AM
                                0 responses
                                46 views
                                0 likes
                                Last Post seqadmin  
                                Working...
                                X