Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • SAM tools, BAM files... help for beginning

    Hi all,

    I am completely new in use of SAM tools and any kind of next. gen. seq. data analysis. Also I don’t have any experience with writing scripts…
    We just got sequencing data (small RNA) from our run at Ion Torrent PGM sequencer. Data are in BAM format. Based on what I have found, these data have to firstly be sorted, indexed from which BAI file will be generated. In this format data (sequences reads) can be viewed by other programs (e.g. Bamview).
    I have downloaded SAM tools, unzipped tar file (samtools-0.1.19.tar.bz2) and got samtools folder with different files.
    If I want to sort, index my BAM data how can I do that exactly (step-by-step)? I have Mac OS - can I used application called Terminal?
    I don’t plan to use this program for much more than just sorting, indexing my files (if this is the only thing that I need to do with them before being readable and further analysis) – can you please give me some advices how to do that?

    Many thanks,
    Vic

  • #2
    SAM tools, BAM files... help for

    Hi,

    Have a look at the FAQ and manual pages for samtools.

    ttp://sourceforge.net/apps/mediawiki/samtools/index.php?title=SAM_FAQ




    Best wishes,
    Maria

    Comment


    • #3
      BAM sorting, indexing problem

      Thanks for reference!

      I have made a small progress but still having problems. I was not able to sort my BAM sequencing file data and then to index them.
      I have copied all (3) my BAM in one folder with samtools (samtools-0.1.19 folder and samtools-0.1.19.tar.bz2). I have tried (as an example) command (in Terminal) “samtools view myfile.bam>my file.sam” and it worked – I got a new SAM file from BAM file in that folder. But when I tried command “samtools sort myfile.bam myfile.sorted” which should sort data in my BAM file it gives message “-bash: samtools: command not found”.
      Can you please help me with this?
      I suppose that data should be sorted than indexed (to get BAM.BAI) and then can be further processed/viewed in other programs – is it correct or anything else is necessary to do with them?

      Thanks,
      Vic

      Comment


      • #4
        Originally posted by vicm View Post
        I have made a small progress but still having problems. I was not able to sort my BAM sequencing file data and then to index them.
        I have copied all (3) my BAM in one folder with samtools (samtools-0.1.19 folder and samtools-0.1.19.tar.bz2). I have tried (as an example) command (in Terminal) “samtools view myfile.bam>my file.sam” and it worked – I got a new SAM file from BAM file in that folder. But when I tried command “samtools sort myfile.bam myfile.sorted” which should sort data in my BAM file it gives message “-bash: samtools: command not found”.
        Can you please help me with this?
        If you haven't installed samtools, then trying to run 'samtools view myfile.bam > my file.sam' on its own like that won't work. It needs to be on the PATH, a list of folders the operating system will check for tools.

        Instead, try running samtools with an explicit path. If as in your example samtools is in the current directory (represented as a dot), try './samtools view myfile.bam > my file.sam' instead. If your samtools is in /home/vicm/samtools-0.1.19/samtools, then use that: '/home/vicm/samtools-0.1.19/samtools view myfile.bam > my file.sam'

        Originally posted by vicm View Post
        I suppose that data should be sorted than indexed (to get BAM.BAI) and then can be further processed/viewed in other programs – is it correct or anything else is necessary to do with them?
        For most tasks yes, take the mapped reads as a BAM file, coordinate sort, and then index.
        Last edited by maubp; 04-01-2013, 02:53 AM. Reason: Answered second Q too

        Comment


        • #5
          samtools installation

          Thanks for your answer. I think commands (and pathway) themselves were OK... but the problem was that I have not installed samtools (properly).
          I have tried to find it in google... but still I am not sure how to install samtools (and get it to work) exactly "step by step". Can you please tell me this (or give me reference were it is clearly written)? I suppose, then when I will use those commands given on http://samtools.sourceforge.net/ it should work.

          Many thanks,
          Vic

          Comment


          • #6
            What sort of BAM did you get? mapped or unmapped?
            What do you want to do with the data? Do you want to assemble it or map it to a genome?
            My lab got some data from a torrent recently as an unmapped BAM, first thing we did was convert it to fastq so we could actually use it.

            Typically you index a BAM file that is the output of mapping raw reads to a genome/transcriptome which allows you to view it in something like IGV. I don't think you will get very much from trying to look at raw reads in a viewer.

            Comment


            • #7
              Not sure if it is the same for RNA, but this is what I do for DNA. I hope you can get some hints from it:
              First you need a reference genome, for example hg19 for human DNA. Second, install properly some programs you need: bwa, picard, and samtools. Usually you get that by unzipping them in a directory and running make in linux, I think its install in Mac. Be sure you have proper access to them from your working directory by setting the path. If you have trouble with the path, just work in the same directory the programs are installed.
              Then you need a pipeline:
              #align
              bwa bwasw -t 5 hg19M/hg19M your_file.fastq > your_file.sam

              #order
              java -jar picard/AddOrReplaceReadGroups.jar I=your_file.sam O=your_fileordered.bam SORT_ORDER=coordinate RGPL=IT RGSM=MITO RGPU=Random RGLB=hg19

              #put some header
              java -jar picard/AddOrReplaceReadGroups.jar I=your_fileordered.bam O=your_fileorderedheader.bam LB=whatever PL=ION_TORRENT PU=whatever SM=whatever

              #index (you get an additional bai file)
              samtools index your_fileorderedheader.bam

              Now you would be able to see your data with some viewing program such as IGV

              !Don't desperate if starting seems tough. It has happened to everyone!
              Last edited by AJERYC; 04-03-2013, 10:38 PM.

              Comment

              Latest Articles

              Collapse

              • seqadmin
                Current Approaches to Protein Sequencing
                by seqadmin


                Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                04-04-2024, 04:25 PM
              • seqadmin
                Strategies for Sequencing Challenging Samples
                by seqadmin


                Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                03-22-2024, 06:39 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 04-11-2024, 12:08 PM
              0 responses
              25 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              29 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 09:21 AM
              0 responses
              25 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-04-2024, 09:00 AM
              0 responses
              52 views
              0 likes
              Last Post seqadmin  
              Working...
              X