Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • From bam to wig format

    Hello,

    I have bam files and I need to convert it to wig format to be like this:

    variableStep chrom=chr2
    300701 12.5
    300702 12.5
    300703 12.5
    300704 12.5
    300705 12.5

    I know that there is an options in samtools called: pileup or mpileup, but it doesn't work well with me for the following reason:
    if only some nucleotides of a read is mapped to a genome, it reports coverage equally to all nucleotides of that read. I need to report only coverage for mapped nucleotides within the read, do u know any other tool that make this?

    Thanks,

  • #2
    Try some thing like this:
    samtools depth yourfile.bam | awk '{if ($1!=prev)print "variableStep chrom="$1;print $2"\t"$3;prev=$1}


    example :
    samtools depth TCGA-23-1110-01A-01W-0486-08_IlluminaGA-DNASeq_capture.bam | awk '{if ($1!=prev)print "variableStep chrom="$1;print $2"\t"$3;prev=$1}' |head
    variableStep chrom=chrM
    22 1
    23 1
    24 1
    25 1
    26 1
    27 1
    28 1
    29 2
    30 3

    Comment

    Latest Articles

    Collapse

    • seqadmin
      The Impact of AI in Genomic Medicine
      by seqadmin



      Artificial intelligence (AI) has evolved from a futuristic vision to a mainstream technology, highlighted by the introduction of tools like OpenAI's ChatGPT and Google's Gemini. In recent years, AI has become increasingly integrated into the field of genomics. This integration has enabled new scientific discoveries while simultaneously raising important ethical questions1. Interviews with two researchers at the center of this intersection provide insightful perspectives into...
      02-26-2024, 02:07 PM
    • seqadmin
      Multiomics Techniques Advancing Disease Research
      by seqadmin


      New and advanced multiomics tools and technologies have opened new avenues of research and markedly enhanced various disciplines such as disease research and precision medicine1. The practice of merging diverse data from various ‘omes increasingly provides a more holistic understanding of biological systems. As Maddison Masaeli, Co-Founder and CEO at Deepcell, aptly noted, “You can't explain biology in its complex form with one modality.”

      A major leap in the field has
      ...
      02-08-2024, 06:33 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by seqadmin, 02-28-2024, 06:12 AM
    0 responses
    21 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 02-23-2024, 04:11 PM
    0 responses
    69 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 02-21-2024, 08:52 AM
    0 responses
    77 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 02-20-2024, 08:57 AM
    0 responses
    67 views
    0 likes
    Last Post seqadmin  
    Working...
    X