This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Log2FC track Visualization in IGV

Hello,

Recently i have done some RNASeq analysis. Now i need to visualize the alignments in IGV.

For reference I have this figure 7-A from the paper The Fusarium graminearum Histone H3 K27 Methyltransferase KMT6 Regulates Development and Expression of Secondary Metabolite Gene Clusters

enter image description here

I want to create something similar to this. Specifically the log2 kmt6/WT track.

What I Have:

  1. Ref genome.fasta + genome.fasta.fai + genome.gtf/gff
  2. mut_aln.bam + mut_aln.bam.bai
  3. wt_aln.bam + wt_aln.bam.bai

What I have tried:

Generated the bigwig format tracks from both bam files using this command from deepTools package

bamCoverage -b flask_wt.bam -o $out_dir/flask_wt.bam.bw --normalizeUsing CPM --binSize 10 --extendReads -p 64

then i loaded them in IGV and everything works.

How to create the other track (putple one in figure above) which shows the log2kmt6/WT. I cannot seem to find any hints in the paper.

Thank you

visualization igv rnaseq

From the figure legend:

Changes in transcription for low nitrogen conditions are shown in purple as log2 value of the RPKM ratio of kmt6 vs. WT.

There is no info about the magnification in the figure above so one would assume that bars are all in the gene models.

So as per my understanding and alot of back and forth Q&A with chatGPT this is what i found

  1. If you have biological replicates then its best to merge the BAM files into one. samtools merge works here.
  2. Generate bigwig tracks foe both Treatment.bam and Control.bam
  3. I generated them using bamCoverage from deeptools package with normalization (you want) and bin-size of choice. I used following command
    bamCoverage --bam <your_bam_file.bam> --normalizeUsing <RPKM/CPM> --binSize <size_in_bp> --numberOfProcessors 12 \
             --outFileName <your_output_file.bw>
    
  4. Compare the two bigwig files using bigwigCompare from deeptools. I used follwoing command.
    bigwigCompare \
    --bigwig1 <treatment.bam.bw> --bigwig2 <control.bam.bw> \
    --pseudocount 1 --operation log2 --binSize<size_in_bp> --numberOfProcessors 12 \
    --outFileName <your_log2_output_file.bw>
    
  5. Import ref-genome along with the .bw files in IGV

Thank you.

1 answer

the bars are going Up and Down the axis, and labeled as Log2 kmt6/wt, my guess is that its based on the foldchange ?

With chatGpt i was able to find that its just based on comparison between the .bam.bw (bigwig) files.

bamCoverage --bam merged_flask_wt.bam --outFileName merged_flask_wt.bam.bw \
    --normalizeUsing CPM --binSize 10 --extendReads --numberOfProcessors 64
bamCoverage --bam merged_plant_wt.bam --outFileName merged_plant_wt.bam.bw \
    --normalizeUsing CPM --binSize 10 --extendReads --numberOfProcessors 64

bigwigCompare \
  --bigwig1 "$out_dir/merged_plant_wt.bam.bw" \
  --bigwig2 "$out_dir/merged_flask_wt.bam.bw" \
  --operation log2 --pseudocount 1 --numberOfProcessors 64\
  --outFileName "$out_dir/log2FC_CPM_flask_wt_vs_plants_wt.bw"

but I am not sure if this is the right thing to do.

Yes, that is a valid and common way to generate the track.

There's also bamCompare to make the comparison in one step.

Note, with RNA-seq the extendReads option is usually not recommended as it will extend reads over introns.

Noted, THank you for hilighting this

Log in to answer this question.