Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ksw9
    Member
    • May 2013
    • 32

    #1

    Genes of interest from SAM/BAM files

    Hi,
    I am trying to compare paired-end Illumina data with standard MLST approaches for genotyping bacteria. What is the best way to extract known marker genes (using coordinates from a reference) from SAM/BAM files created by mapping samples to this reference?

    Ultimately, I just want to compare the genotyping capacity of this shotgun data with traditional, MLST methods and ensure that we are getting good coverage of the MLST markers of choice. I would like to generate consensus sequences from short read data of the makers of interest and am unsure the best way to do this.

    Thank you!
  • crazyhottommy
    Senior Member
    • Apr 2012
    • 187

    #2
    I am not sure what you want to do, but look at bedtools. it may help you.

    Comment

    • GenoMax
      Senior Member
      • Feb 2008
      • 7138

      #3
      1. http://seqanswers.com/forums/showthread.php?t=39766

      Assuming that you are referring to extracting reads that map to certain marker genes: samtools view should allow you to pull out reads from specified gene regions.

      2. http://seqanswers.com/forums/showthread.php?t=38969

      Samtools mpileup should generate the consensus sequence.

      Comment

      • ksw9
        Member
        • May 2013
        • 32

        #4
        Thank you for your help!

        Comment

        • ksw9
          Member
          • May 2013
          • 32

          #5
          I am trying to generate a consensus sequence using the following command:

          samtools mpileup -uf B31.fna Sample_Bbcap10_006_004_MLST.bam | bcftools view -cg - | /home/bioinfo/software/samtools/samtools-0.1.19/bcftools/vcfutils.pl vcf2fq > cns.fq

          and struggling with the error:

          Use of uninitialized value in length at /home/bioinfo/software/samtools/samtools-0.1.19/bcftools/vcfutils.pl line 544, <> line 57.


          Does anyone have any insight on this? I'm just beginning with SAMtools and really appreciate the support.

          Comment

          • GenoMax
            Senior Member
            • Feb 2008
            • 7138

            #6
            Have you indexed your reference genome file (B31.fna) with samtools faidx? That is a fasta format file correct?

            Code:
            $ samtools faidx B31.fna
            Last edited by GenoMax; 02-21-2014, 11:44 AM.

            Comment

            • ksw9
              Member
              • May 2013
              • 32

              #7
              Yes, it is a fasta and I did index with samtools faidx.

              Comment

              • shuoguo
                Member
                • Sep 2012
                • 23

                #8
                looks to me the error occurs at last step. does "vcfutils.pl" takes stdin?

                Comment

                • GenoMax
                  Senior Member
                  • Feb 2008
                  • 7138

                  #9
                  @ksw9: This may be an obvious question but was the reference file used for generation of the indexes and the alignments to generate the BAM's? Based on the name it looks like that may be a 454 sequence file. What aligner did you use?

                  Comment

                  • ksw9
                    Member
                    • May 2013
                    • 32

                    #10
                    I used BWA for mapping paired-end Illumina reads to the reference genome.

                    Comment

                    • ksw9
                      Member
                      • May 2013
                      • 32

                      #11
                      Okay, I think my problem was in my original .bed file which now has contigs appropriately labeled.

                      I guess my question is this: if I have extracted reads mapping only to loci of interest using:
                      samtools view -h -L MLST.bed Sample_006_004.bam > Sample_006_004_MLST.sam

                      then should I create a new reference sequence including only the loci of interest in order to generate the consensus sequence only for the loci of interest (and not generate the consensus for the entire genome)?

                      Thank you for all of your help!

                      Comment

                      • shuoguo
                        Member
                        • Sep 2012
                        • 23

                        #12
                        Originally posted by ksw9 View Post
                        Okay, I think my problem was in my original .bed file which now has contigs appropriately labeled.

                        I guess my question is this: if I have extracted reads mapping only to loci of interest using:
                        samtools view -h -L MLST.bed Sample_006_004.bam > Sample_006_004_MLST.sam

                        then should I create a new reference sequence including only the loci of interest in order to generate the consensus sequence only for the loci of interest (and not generate the consensus for the entire genome)?

                        Thank you for all of your help!
                        Good to know, thanks!

                        Comment

                        Latest Articles

                        Collapse

                        • SEQadmin2
                          The Factors Reshaping Genome Assembly
                          by SEQadmin2



                          When the Human Genome Project declared the human genome finished in 2003, portions of the sequence were still missing, including many of its most repetitive and structurally complex regions.1 Still, for the next two decades, researchers analyzed their sequencing data against the single linear reference that came out of this effort. Released in 2013 as GRCh38, that reference has powered countless discoveries, but it has gaps and cannot capture the genetic diversity of the world’s...
                          Today, 07:04 AM
                        • SEQadmin2
                          16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
                          by SEQadmin2





                          NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification,...
                          10-30-2026, 06:46 AM

                        ad_right_rmr

                        Collapse

                        News

                        Collapse

                        Topics Statistics Last Post
                        Started by SEQadmin2, Yesterday, 11:11 AM
                        0 responses
                        14 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 11-17-2026, 06:27 AM
                        0 responses
                        39 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 11-12-2026, 07:59 AM
                        0 responses
                        55 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 11-05-2026, 09:25 AM
                        0 responses
                        62 views
                        0 reactions
                        Last Post SEQadmin2  
                        Working...