Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wmseq
    Member
    • May 2011
    • 71

    #1

    why doesn't this linux command work for me?

    Hi every one,
    I'd like merging the following two HTSeq-count outputs using the following command--- paste UHR1_htseq-count.out UHR2_htseq-count.out brain1_htseq-
    count.out brain2_htseq-count.out | awk -F "\t" '{print
    $1"\t"$2"\t"$4"\t"$6"\t"$8 }' > All_htseqCounts.txt


    head UHR1_htseq-count.out
    A1BG 67
    A1CF 31
    A2BP 3

    head UHR2_htseq-count.out
    A1BG 67
    A1CF 39
    A2BP 1
    -----
    I got the following output.

    A1BG 67 A1BG 67
    A1CF 31 A1CF 39
    A2BP 3 A2BP 1
    ----
    In fact I want to get the folloing one.

    A1BG 67 67
    A1CF 31 39
    A2BP 3 1

    Is there any one who know what is wrong with the command?

    Thanks a lot?

    Richard
  • Richard Finney
    Senior Member
    • Feb 2009
    • 701

    #2
    paste file1 file2 | awk '{print $1" "$2" "$4}'

    Comment

    • wmseq
      Member
      • May 2011
      • 71

      #3
      Richard,
      I still got the same output---just merged the two files with ID of each kept.

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        Perhaps tab isn't the default delimiter for paste on your system? Maybe then

        Code:
        paste -d "\t" file1 file2 | awk '{OFS="\t"; print $1,$2,$4}'
        Alternatively, perhaps the files aren't actually tab delimited to begin with (try running "cut -f 1" on one of them).

        Comment

        • Richard Finney
          Senior Member
          • Feb 2009
          • 701

          #5
          Are you using bash?
          Run this command ...

          set | grep FS

          Also, look at the actual bytes ...
          od -x UHR1_htseq-count.out | head

          to see if that's a space or a tab.

          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, Today, 11:13 AM
          0 responses
          11 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, Today, 10:48 AM
          0 responses
          10 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-15-2026, 10:52 AM
          0 responses
          32 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-14-2026, 05:39 AM
          0 responses
          40 views
          0 reactions
          Last Post SEQadmin2  
          Working...