Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qnc
    Member
    • Jun 2010
    • 51

    #1

    Mac OSX Lion Terminal Version 2.2.2 (303) Problems

    Hi,

    The genomeCoverageBed program made each line without the "Chr" start making it hard to use in UCSC Genome browser.

    i.e.
    17 422997 422999 26
    17 422999 423001 27
    17 423001 423003 29


    There are over 10,000,000 lines so how do I add "chr" to the beginning of each like this:

    chr17 422997 422999 26
    chr17 422999 423001 27
    chr17 423001 423003 29


    I have tried:

    awk '{print "chr"$1,$2,$3,$4}' inputFile.bed > outputFile.bed
    awk '/^/{print "chr"$1,$2,$3,$4}' inputFile.bed > outputFile.bed
    sed -i .bak 's/^/chr/'inputFile.bed > outputFile.bed
    sed -i '''s/^/chr/' inputFile.bed > outputFile.bed
    sed 's/^/^chr/' inputFile.bed > outputFile.bed
    and others…

    All of which do the first line and nothing more?


    When I use $ head ch17.txt | od -c

    I get lots of weird charters

    0000000 t r a c k t y p e = b e d G r
    0000020 a p h n a m e = V a n i t a
    0000040 c o l o r = 0 , 1 2 8 , 0 \n 1 7
    0000060 \t 3 9 7 1 4 2 \t 3 9 7 1 5 2 \t 1
    0000100 \n 1 7 \t 3 9 7 1 5 2 \t 3 9 7 1 7
    0000120 1 \t 2 \n 1 7 \t 3 9 7 1 7 1 \t 3 9
    0000140 7 1 8 3 \t 3 \n 1 7 \t 3 9 7 1 8 3
    0000160 \t 3 9 7 1 9 2 \t 4 \n 1 7 \t 3 9 7
    0000200 1 9 2 \t 3 9 7 2 0 2 \t 3 \n 1 7 \t
    0000220 3 9 7 2 0 2 \t 3 9 7 2 2 1 \t 2 \n
    0000240 1 7 \t 3 9 7 2 2 1 \t 3 9 7 2 3 3
    0000260 \t 1 \n 1 7 \t 3 9 7 5 7 5 \t 3 9 7
    0000300 6 2 7 \t 1 \n 1 7 \t 3 9 7 7 7 1 \t
    0000320 3 9 7 7 9 6 \t 1 \n
    0000331

    Are people finding this problem as well and has anyone got a solution so that my BEDTools files can be used on UCSC Genome Browser?
  • westerman
    Rick Westerman
    • Jun 2008
    • 1104

    #2
    Your methods (at least some of them) should work. Perhaps a Mac OS-X problem?

    On linux I get:

    Code:
    prompt> cat t.tmp
    17  422997  422999  26
    17  422999  423001  27
    17  423001  423003  29
    
    prompt> sed 's/^/chr/' t.tmp 
    chr17  422997  422999  26
    chr17  422999  423001  27
    chr17  423001  423003  29
    Ditto for Solaris-OS (which does not use gsed -- the linux default). My Mac is not available but it is hard to see that such a basic program such as sed used in such a basic manner giving many problems.

    Comment

    • dpryan
      Devon Ryan
      • Jul 2011
      • 3478

      #3
      To add to what Rick wrote, I don't see any weird characters in the example output you showed. The control characters and character number stuff one would expect when piping through od.

      Comment

      • qnc
        Member
        • Jun 2010
        • 51

        #4
        Originally posted by westerman View Post
        Your methods (at least some of them) should work. Perhaps a Mac OS-X problem?

        On linux I get:

        Code:
        prompt> cat t.tmp
        17  422997  422999  26
        17  422999  423001  27
        17  423001  423003  29
        
        prompt> sed 's/^/chr/' t.tmp 
        chr17  422997  422999  26
        chr17  422999  423001  27
        chr17  423001  423003  29
        Ditto for Solaris-OS (which does not use gsed -- the linux default). My Mac is not available but it is hard to see that such a basic program such as sed used in such a basic manner giving many problems.
        Thanks guys so what should I do is there another terminal I can use or do I reinstall it.

        How hard is it to turn a PC into linux etc?

        Comment

        • dpryan
          Devon Ryan
          • Jul 2011
          • 3478

          #5
          I just tested on my home laptop and the first 3 commands you posted work fine (more or less, you told sed to edit in place so I changed things to make more sense) under OS X (10.6.8, though 10.7 is unlikely to be different). Either there's something very odd with your OS X installation or you're doing something else wrong.

          The difficulty of installing linux on a PC varies a lot with your past experience. If you've never done it before and are unlucky in having some obscure software then it can be difficult. Otherwise it's not terribly difficult. But I've been using various *nixes for about 15 years...

          Comment

          • qnc
            Member
            • Jun 2010
            • 51

            #6
            Originally posted by dpryan View Post
            I just tested on my home laptop and the first 3 commands you posted work fine (more or less, you told sed to edit in place so I changed things to make more sense) under OS X (10.6.8, though 10.7 is unlikely to be different). Either there's something very odd with your OS X installation or you're doing something else wrong.

            The difficulty of installing linux on a PC varies a lot with your past experience. If you've never done it before and are unlucky in having some obscure software then it can be difficult. Otherwise it's not terribly difficult. But I've been using various *nixes for about 15 years...

            Got some advice from this thread and so giving that a go. (http://seqanswers.com/forums/showthr...8420#post68420)

            I think I'll get a proper unix installed as well. no harm in having that working and it will also mean that my main mac is free to work on other things.

            What would you recommend as a os and things that I might need to get.

            Was going for 1TB hard drive is that enough or should I get more.

            Doing Whole Exome sequencing so getting files of around 10GB.

            Do you set it up as a ftp server for things like Galaxy?

            Want to get a reasonably good platform.

            Comment

            • dpryan
              Devon Ryan
              • Jul 2011
              • 3478

              #7
              Any Linux distribution would work, Ubunutu is one of the more popular ones at the moment. Storage size depends mostly on what you'll be doing, there are other threads on this forum with suggestions on that. I've never used Galaxy, it's easier for me to just directly use the programs for which it's a front-end.

              Comment

              • cliffbeall
                Senior Member
                • Jan 2010
                • 144

                #8
                Is it too obvious to suggest line endings? Mac default now should be new lines, but I know the old style CRs still get used sometimes. Excel and Filemaker will both do this.

                This still trips me up on occasion. tr "\r" "\n" then pipe to the command you want.

                Comment

                Latest Articles

                Collapse

                • SEQadmin2
                  Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                  by SEQadmin2



                  Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                  Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                  ...
                  10-14-2026, 09:55 AM
                • SEQadmin2
                  New Genomics Technologies Take Aim at Long-Standing Limits
                  by SEQadmin2


                  Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                  We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                  ...
                  09-28-2026, 10:25 AM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by SEQadmin2, 10-15-2026, 10:52 AM
                0 responses
                14 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-14-2026, 05:39 AM
                0 responses
                21 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-13-2026, 09:56 AM
                0 responses
                19 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-09-2026, 11:14 AM
                0 responses
                27 views
                0 reactions
                Last Post SEQadmin2  
                Working...