Header Leaderboard Ad

Collapse

strand specific wig files

Collapse

Announcement

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

  • strand specific wig files

    Hi,

    I am trying to create strand-specific wig files from a bam file.
    I used the pileup option and i thought it worked very good. Now I have checked it again with the mpileup and it looks very strange to me.

    This is how I did it before:
    Code:
    samtools view -h -f 0x10 dilpAll.sorted.bam | samtools pileup -S - | cut -f 1,2,4| awk 'BEGIN{print "tracktype=\"wiggle_0\"\tname=\"dilp (reversestrand)\"\tdescription=\"dilp (reverse strand)\""} {if(NR==1){curChr=$1; print "variableStep chrom="curChr" span=1";} 
    if($1 == curChr){print $2"\t"$3;}else{curChr=$1; print "curChr="curChr;}}' > wigFiles/dilp_rs.wig
    
    samtools view -h -F 0x10 dilpAll.sorted.bam | samtools pileup -S - | cut -f 1,2,4| awk 'BEGIN{print "track type=\"wiggle_0\"\tname=\"dilp (forward strand)\"\tdescription=\"dilp (forward strand)\""} {if(NR==1){curChr=$1; print "variableStep chrom="curChr" span=1";
    } if($1 == curChr){print $2"\t"$3;}else{curChr=$1; print "curChr="curChr;}}' > wigFiles/dilp_fs.wig
    Now I just have changed it a bit to fit the mpileup options:
    Code:
    samtools view[COLOR="Red"] -b[/COLOR] -f 0x10 dilpAll.sorted.bam | samtools[COLOR="Red"] mpileup  - [/COLOR]| cut -f 1,2,4| awk 'BEGIN{print "tracktype=\"wiggle_0\"\tname=\"dilp (reversestrand)\"\tdescription=\"dilp (reverse strand)\""} {if(NR==1){curChr=$1; print "variableStep chrom="curChr" span=1";} 
    if($1 == curChr){print $2"\t"$3;}else{curChr=$1; print "curChr="curChr;}}' > wigFiles/dilp_rs.wig
    
    samtools view [COLOR="Red"]-b [/COLOR]-F 0x10 dilpAll.sorted.bam | samtools[COLOR="Red"] mpileup - [/COLOR]| cut -f 1,2,4| awk 'BEGIN{print "track type=\"wiggle_0\"\tname=\"dilp (forward strand)\"\tdescription=\"dilp (forward strand)\""} {if(NR==1){curChr=$1; print "variableStep chrom="curChr" span=1";
    } if($1 == curChr){print $2"\t"$3;}else{curChr=$1; print "curChr="curChr;}}' > wigFiles/dilp_fs.wig
    Than I compared it with a wig file for the omplete bam file:
    Code:
    samtools mpileup dilpMerged.sorted.bam | perl -ne 'BEGIN{print "track type=wiggle_0 name=fileName description=fileName\n"};($c, $start, undef, $depth) = split; if ($c ne $lastC) {print "variableStep chrom=chr$c\n"; };$lastC=$c;next unless $. % 10 ==0;print "$star
    t\t$depth\n" unless $depth<3;'  > wigFiles/dilpMerged.wig
    When doing it for both strands I get more line than I have together in the wig file for the complete bam file.
    -f: 113905
    -F: 121720
    w.o.: 141199

    Does someone have an explanation for these numbers?

    Thanks
    Assa

Latest Articles

Collapse

  • seqadmin
    A Brief Overview and Common Challenges in Single-cell Sequencing Analysis
    by seqadmin


    ​​​​​​The introduction of single-cell sequencing has advanced the ability to study cell-to-cell heterogeneity. Its use has improved our understanding of somatic mutations1, cell lineages2, cellular diversity and regulation3, and development in multicellular organisms4. Single-cell sequencing encompasses hundreds of techniques with different approaches to studying the genomes, transcriptomes, epigenomes, and other omics of individual cells. The analysis of single-cell sequencing data i...

    01-24-2023, 01:19 PM
  • seqadmin
    Introduction to Single-Cell Sequencing
    by seqadmin
    Single-cell sequencing is a technique used to investigate the genome, transcriptome, epigenome, and other omics of individual cells using high-throughput sequencing. This technology has provided many scientific breakthroughs and continues to be applied across many fields, including microbiology, oncology, immunology, neurobiology, precision medicine, and stem cell research.

    The advancement of single-cell sequencing began in 2009 when Tang et al. investigated the single-cell transcriptomes
    ...
    01-09-2023, 03:10 PM

ad_right_rmr

Collapse
Working...
X