Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Anjali
    Member
    • Dec 2011
    • 17

    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
  • Anjali
    Member
    • Dec 2011
    • 17

    #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

    • kmcarr
      Senior Member
      • May 2008
      • 1181

      #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

      • Anjali
        Member
        • Dec 2011
        • 17

        #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

        • kmcarr
          Senior Member
          • May 2008
          • 1181

          #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

          • kmcarr
            Senior Member
            • May 2008
            • 1181

            #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

            • Anjali
              Member
              • Dec 2011
              • 17

              #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

              • frz
                Junior Member
                • May 2013
                • 7

                #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

                • Guillefriis
                  Junior Member
                  • Oct 2013
                  • 5

                  #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

                  • GenoMax
                    Senior Member
                    • Feb 2008
                    • 7142

                    #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

                    • Guillefriis86
                      Junior Member
                      • Jan 2014
                      • 2

                      #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

                      ad_right_rmr

                      Collapse

                      News

                      Collapse

                      Topics Statistics Last Post
                      Started by SEQadmin2, Today, 11:58 AM
                      0 responses
                      6 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, 06-05-2026, 10:09 AM
                      0 responses
                      21 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, 06-04-2026, 08:59 AM
                      0 responses
                      34 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, 06-02-2026, 12:03 PM
                      0 responses
                      55 views
                      0 reactions
                      Last Post SEQadmin2  
                      Working...