Header Leaderboard Ad

Collapse

edit RGID in header

Collapse

Announcement

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

  • shawpa
    replied
    Thanks so much. This is exactly what I needed.

    Leave a comment:


  • Alex Renwick
    replied
    Originally posted by shawpa View Post
    I think I wasn't clear when I said I couldn't program very well. I actually meant I couldn't program as well as do what you are describing.
    There's no programming involved. You need to edit the header to add lines for samples L2, L3, and L4.

    Right now your header has only L1:
    Code:
    @RG     ID:L1   PL:ILLUMINA     PU:D0DHVACXX    LB:ryan SM:ryan
    You need all four in the header, and they need to have different sample names (SM):

    Code:
    @RG     ID:L1   PL:ILLUMINA     PU:D0DHVACXX    LB:ryan SM:ryan1
    @RG     ID:L2   PL:ILLUMINA     PU:D0DHVACXX    LB:ryan SM:ryan2
    @RG     ID:L3   PL:ILLUMINA     PU:D0DHVACXX    LB:ryan SM:ryan3
    @RG     ID:L4   PL:ILLUMINA     PU:D0DHVACXX    LB:ryan SM:ryan4
    You could use samtools view -h to make a sam file from the merged bam and then edit that file directly, but that's probably a bad idea since the file might be huge.

    The method Richard Finney suggests is to use samtools reheader:
    Code:
    samtools view -H file.bam > header.txt
    ...edit header.txt using any text editor...
    samtools reheader header.txt file.bam > file.fixedheader.bam

    Leave a comment:


  • shawpa
    replied
    Originally posted by Richard Finney View Post
    I think various RGs need to be on separate lines.
    You can use text editor to get the header you want, no "programming" involved using gedit/vim/emacs.
    It you did want to program, using the Unix tools sed,grep,cat and so in a script could solve the problem.
    When you get the header you want, try the samtools "reheader" option.
    I think I wasn't clear when I said I couldn't program very well. I actually meant I couldn't program as well as do what you are describing.

    Leave a comment:


  • kmcarr
    replied
    In the future you might want to use Picard Tools MergeSamFiles. It merges header information in addition to the alignment portions of the BAM files.

    Leave a comment:


  • Richard Finney
    replied
    I think various RGs need to be on separate lines.
    You can use text editor to get the header you want, no "programming" involved using gedit/vim/emacs.
    It you did want to program, using the Unix tools sed,grep,cat and so in a script could solve the problem.
    When you get the header you want, try the samtools "reheader" option.

    Leave a comment:


  • shawpa
    started a topic edit RGID in header

    edit RGID in header

    I assigned RGID's to 4 different sets of files. I labeled them L1, L2, L3, L4 to indicate which lane they were from. I was having issues after samtools merge and I think the problem is that the first in.bam header overwrote the other headers (this is in the samtools manual). Basically I have orphan reads now because they have a RGID that isn't in the header. All the other RG tags are identical in the bam files. I was told that I needed to add the other ID's to my header in the merged file. So I guess the header needs to say something like RGID: L1, L2, L3, L4 for it to work properly but I don't think you can put comma's. I don't really know how to reformat text files and on a scale of 1-10 in programming knowledge, I would put myself at a 2. Can someone please give me an example code for how to edit this header? I will attach the header of my existing file below if that helps.
    Attached Files

Latest Articles

Collapse

  • seqadmin
    How RNA-Seq is Transforming Cancer Studies
    by seqadmin



    Cancer research has been transformed through numerous molecular techniques, with RNA sequencing (RNA-seq) playing a crucial role in understanding the complexity of the disease. Maša Ivin, Ph.D., Scientific Writer at Lexogen, and Yvonne Goepel Ph.D., Product Manager at Lexogen, remarked that “The high-throughput nature of RNA-seq allows for rapid profiling and deep exploration of the transcriptome.” They emphasized its indispensable role in cancer research, aiding in biomarker...
    09-07-2023, 11:15 PM
  • seqadmin
    Methods for Investigating the Transcriptome
    by seqadmin




    Ribonucleic acid (RNA) represents a range of diverse molecules that play a crucial role in many cellular processes. From serving as a protein template to regulating genes, the complex processes involving RNA make it a focal point of study for many scientists. This article will spotlight various methods scientists have developed to investigate different RNA subtypes and the broader transcriptome.

    Whole Transcriptome RNA-seq
    Whole transcriptome sequencing...
    08-31-2023, 11:07 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by seqadmin, 09-22-2023, 09:05 AM
0 responses
14 views
0 likes
Last Post seqadmin  
Started by seqadmin, 09-21-2023, 06:18 AM
0 responses
11 views
0 likes
Last Post seqadmin  
Started by seqadmin, 09-20-2023, 09:17 AM
0 responses
13 views
0 likes
Last Post seqadmin  
Started by seqadmin, 09-19-2023, 09:23 AM
0 responses
28 views
0 likes
Last Post seqadmin  
Working...
X