Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • To convert BAM file to BED file

    Hi,
    I used Bedtools to convert BAM to BED format for my sequencing data. But together with BED I need the corresponding BIM and FAM files, which are not generated automatically by it. It would be really helpful if anyone can suggest me another way for conversion of BAM to BED/BIM/FAM files.

    Thank you

  • #2
    Does anybody has an answer to my question??

    There seems to be no solution to it ,, but I suppose anybody who experienced it may have an answer to it.

    Comment


    • #3
      I'm not experienced but it appears that the BIM and FAM files are formats specifically output by the program PLINK. You don't "convert" a BAM file into these two file types. The BAM files represents your input data and the BED/BIM/FAM files the output of the analysis.

      Comment


      • #4
        Thanks

        Thanks a lot. I read about PLINK, but it would be helpful, if you discuss about the command to use to convert file formats. Calling plink in linux, says "Connecting to web" and shows error. I would rather like to try the command you suggest.

        Comment


        • #5
          Originally posted by Anjali View Post
          Thanks a lot. I read about PLINK, but it would be helpful, if you discuss about the command to use to convert file formats. Calling plink in linux, says "Connecting to web" and shows error. I would rather like to try the command you suggest.
          Anjali,

          I didn't suggest any command.

          I know nothing about BIM/FAM formats other than they appear to be files created by a particular usage of the PLINK software package.

          How about we try a different approach. Why do you believe you need to convert a BAM file into a BED/BIM/FAM file set?

          Comment


          • #6
            After further investigation I have found the BED file of the BED/BIM/FAM set produced by PLINK is NOT the same as the commonly understood BED files used for genomic data. The BED file of the BED/BIM/FAM set means Binary PED, and a PED file contains family/phenotype (i.e. pedigree) data.

            There is no relationship between a BAM (alignment) file and PLINK BED/BIM/BAM (phenotype/mapping/family) files.

            Comment


            • #7
              You are absolutely right. The BED file generated by PLINK is totally different from the one generated by other software like BEDTools and SAMtools, but the function of the file is the same, I suppose. The BED file should extract useful information from the allignment (BAM) file like the mapping positions, SNP and allele information etc. In my situation all this will only work if I have all the three formats with me.

              However, the other possibility is to convert BAM to a Variant Calling Format (VCF), it is also a very common file format but to process it , I need a Human genome FASTA Index, which I do not have.

              So then, now I wish to try using PLINK,, but the commands are not really clear.

              Comment


              • #8
                Hi, it seems you need to have a .ped and .map file as input to output a bed/bim/bam file on plink. See this link (slides 3 and 4) http://faculty.washington.edu/tathor...GWAS_Intro.pdf

                It seems you have to just create the .ped and .map files perhaps using a vi editor? Does anyone have more insight on this. I am just starting to use PLINK and find this very confusing.

                Comment


                • #9
                  from http://pngu.mgh.harvard.edu/~purcell...ata.shtml#bed:

                  To save space and time, you can make a binary ped file (*.bed). This will store the pedigree/phenotype information in separate file (*.fam) and create an extended MAP file (*.bim) (which contains information about the allele names, which would otherwise be lost in the BED file). To create these files use the command:

                  plink --file mydata --make-bed

                  which creates (by default)
                  plink.bed ( binary file, genotype information )
                  plink.fam ( first six columns of mydata.ped )
                  plink.bim ( extended MAP file: two extra cols = allele names)
                  The .fam and .bim files are still plain text files: these can be viewed with a standard text editor. Do not try to view the .bed file however: it is a compressed file and you'll only see lots of strange characters on the screen...

                  My problem is that unix shell return the error

                  plink: unknown option "--file"
                  plink: unknown option "--make-bed"

                  Anyone knows why???

                  Comment


                  • #10
                    Originally posted by Guillefriis View Post
                    from http://pngu.mgh.harvard.edu/~purcell...ata.shtml#bed:

                    To save space and time, you can make a binary ped file (*.bed). This will store the pedigree/phenotype information in separate file (*.fam) and create an extended MAP file (*.bim) (which contains information about the allele names, which would otherwise be lost in the BED file). To create these files use the command:

                    plink --file mydata --make-bed

                    which creates (by default)
                    plink.bed ( binary file, genotype information )
                    plink.fam ( first six columns of mydata.ped )
                    plink.bim ( extended MAP file: two extra cols = allele names)
                    The .fam and .bim files are still plain text files: these can be viewed with a standard text editor. Do not try to view the .bed file however: it is a compressed file and you'll only see lots of strange characters on the screen...

                    My problem is that unix shell return the error

                    plink: unknown option "--file"
                    plink: unknown option "--make-bed"

                    Anyone knows why???
                    What version of plink are you running? Do you have the .ped and .map files available for the --file spec you are providing?

                    Comment


                    • #11
                      I alredy figured it out, thanks! My problem was that at some point of designing my pipeline I downloaded "PuTTy-Tools" as asked por using ´'PLINK'. I thought it had something to do with the unix-like shell for windows and it was necessary for something... but it turned to be a completely different software that was masking the plink command, even when I had the plink executable file in my working directory! Maybe somebody makes the same mistake so this can be useful.

                      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
                      18 views
                      0 likes
                      Last Post seqadmin  
                      Started by seqadmin, 04-10-2024, 10:19 PM
                      0 responses
                      22 views
                      0 likes
                      Last Post seqadmin  
                      Started by seqadmin, 04-10-2024, 09:21 AM
                      0 responses
                      16 views
                      0 likes
                      Last Post seqadmin  
                      Started by seqadmin, 04-04-2024, 09:00 AM
                      0 responses
                      47 views
                      0 likes
                      Last Post seqadmin  
                      Working...
                      X