Entering edit mode
22 months ago
Pegasus
▴
120
Hi everyone,
I am trying to visualize my bam.file (RNA-seq) using IGV. Following a combination of Biostar and a recommended step posted by #Matt Shirley,
- I converted bam to bedgraph using
bedtools genomecov -ibam
- Generated the indexed sized genome using
faidx input.fasta -i chromsizes
- However, using the command line
bedGraphToBigWig SAMPLE.bedgraph GENOME_FASTA_INDEX SAMPLE.STRANDRaw.bigwig
, generated 0 byte-size bw file.
- My fasta.file is a small genome that contains 52 Contigs/scaffolds belonging to a one chromosome (Bacteria).
- Using the original fasta file also generated 0 byte-size bw file
- Is there any tool to merge the 52 contigs generated by Medusa scaffolder, and is such Merging essential for better downstream analysis' results?
Thank you
The genome file is a simple two-column file, first one being the chromosome name and second one the size of the chromosome. Example linked below.
https://github.com/igvteam/igv/blob/master/genomes/sizes/hg38.chrom.sizes
random note: you can easily generate a .chrom.sizes file with "samtools faidx", which generates a .fai file, and I believe you can even use the .fai in place of a .chrom.sizes since the first two columns of .fai are the chrom sizes
Actually, I started with the fai.file which generated the same 0byte bw file, and this is why I moved to the genomesize as recommended in several threads.
@ATpoint Yes, the resulting genomesize file showed a correct pattern (list of all contigs column1 and their sizes column2). However, although bam > bg was generated successfully, bg > bw resulted 0 byte file
My bad, I missed that you used the index file already. Please see my other suggestion.
Can you give a
head
of the bedGraph? I think bedtools needs the-bg
flag to output bedGraph rather than its histogram-like default.Here is the head of the bg.file (4 columns)
It is five columns, no? And indeed not bedGraph format. Try adding the
-bg
or-bga
option to genomecov.I included the argument -bg in my command line;
bedtools genomecov -ibam < input file name> -g <genome.gff> -bg <output name>
Although I got this error below, the command line resulted a bg file (yes, with 5 columns)
[mii] -g not found! Similar commands: "cc", "sq", "vs"
When I repeated same command with the genome.sizes file instead of gff, I got this error
Genome (-g) files are ignored when BAM input is provided.
Working on Linux