Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • 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?

  • #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


    • #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


      • #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


        • #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


          • #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


            • #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


              • #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

                • seqadmin
                  Essential Discoveries and Tools in Epitranscriptomics
                  by seqadmin


                  The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist on Modified Bases...
                  Today, 07:01 AM
                • 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

                ad_right_rmr

                Collapse

                News

                Collapse

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